- WIP on attributes

This commit is contained in:
Dave Mc Nicoll committed 2023-01-26 18:47:53 +00:00
1 parent e6d0279c1a
commit 70021d829d
13 files changed
+174 -36

No files matched your search

+10 -10
View File
@@ -316,7 +316,7 @@ class Repository
$array = array_change_key_case($entity->toArray());
$dataset = array_change_key_case($entity->entityGetDataset(false, true));
# dump($array, $dataset);
return array_udiff_assoc($oldValues ? $dataset : $array , $oldValues ? $array : $dataset, function($e1, $e2) {
if ( is_array($e1) ) {
if (is_array($e2)) {
@@ -464,7 +464,7 @@ class Repository
return $this;
}
public function join(string $type, $table, $field, $value, ? string $alias = null, ? callable $callback = null) : self
public function join(string $type, $table, string|\Stringable $field, mixed $value, ? string $alias = null, ? callable $callback = null) : self
{
$join = $this->queryBuilder->withJoin($type, $this->escapeTable($table), $field, $value, false, $alias ? $this->escapeIdentifier($alias) : null);
@@ -475,7 +475,7 @@ class Repository
return $this;
}
public function outerJoin(string $type, $table, $field, $value, ? string $alias = null, ? callable $callback = null) : self
public function outerJoin(string $type, $table, string|\Stringable $field, mixed $value, ? string $alias = null, ? callable $callback = null) : self
{
$join = $this->queryBuilder->withJoin($type, $this->escapeTable($table), $field, $value, true, $alias ? $this->escapeIdentifier($alias) : null);
@@ -506,7 +506,7 @@ class Repository
}
public function groupBy($field) : self
public function groupBy(string|\Stringable $field) : self
{
$this->queryBuilder->groupBy($field);
@@ -522,7 +522,7 @@ class Repository
return $this;
}
public function orderBy($field, ? string $direction = null) : self
public function orderBy(string|\Stringable $field, ? string $direction = null) : self
{
$this->queryBuilder->orderBy($field, $direction);
@@ -572,7 +572,7 @@ class Repository
return $this;
}
public function wherePrimaryKey($value) : self
public function wherePrimaryKey(mixed $value) : self
{
if ( null === $primaryKeyField = Ulmus::resolveEntity($this->entityClass)->getPrimaryKeyField() ) {
throw new Exception\EntityPrimaryKeyUnknown("Entity has no field containing attributes 'primary_key'");
@@ -835,28 +835,28 @@ class Repository
return Ulmus::datasetQueryBuilder($this->queryBuilder, $this->adapter);
}
public function runQuery() /* : mixed */
public function runQuery() : mixed
{
$this->finalizeQuery();
return Ulmus::runQuery($this->queryBuilder, $this->adapter);
}
public function runInsertQuery() /* : mixed */
public function runInsertQuery() : mixed
{
$this->finalizeQuery();
return Ulmus::runInsertQuery($this->queryBuilder, $this->adapter);
}
public function runUpdateQuery() /* : mixed */
public function runUpdateQuery() : mixed
{
$this->finalizeQuery();
return Ulmus::runUpdateQuery($this->queryBuilder, $this->adapter);
}
public function runDeleteQuery() /* : mixed */
public function runDeleteQuery() : mixed
{
$this->finalizeQuery();