- Fixes done for QueryBuilderInterface
This commit is contained in:
parent
b38b81d03c
commit
1dd9da6eb6
|
@ -230,6 +230,6 @@ class MsSQL implements AdapterInterface, MigrateInterface, SqlAdapterInterface {
|
||||||
|
|
||||||
public function queryBuilderClass() : string
|
public function queryBuilderClass() : string
|
||||||
{
|
{
|
||||||
return QueryBuilder\SqlQueryBuilder\MssqlQueryBuilder::class;
|
return QueryBuilder\Sql\MssqlQueryBuilder::class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Join {
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public string $type,
|
public string $type,
|
||||||
public null|string|\Stringable|array $key = null,
|
public null|string|\Stringable|array $key = null,
|
||||||
public null|string|\Stringable $foreignKey = null,
|
public null|string|\Stringable|array $foreignKey = null,
|
||||||
public null|string $entity = null,
|
public null|string $entity = null,
|
||||||
public null|string $alias = null,
|
public null|string $alias = null,
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -10,10 +10,11 @@ class OrWhere extends Where {
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public string|\Stringable|array $field,
|
public string|\Stringable|array $field,
|
||||||
public mixed $value = null,
|
public mixed $value = null,
|
||||||
public null|string $operator = null,
|
public string $operator = Query\Where::OPERATOR_EQUAL,
|
||||||
public null|string $condition = Query\Where::CONDITION_OR,
|
public string $condition = Query\Where::CONDITION_OR,
|
||||||
|
public string|\Stringable|array|null $fieldValue = null,
|
||||||
|
public null|array $generateValue = null,
|
||||||
) {
|
) {
|
||||||
|
parent::__construct($field, $value, $operator, $condition, $fieldValue, $generateValue);
|
||||||
$this->key = Attribute::handleArrayField($this->key);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -248,7 +248,7 @@ class EntityResolver {
|
||||||
|
|
||||||
protected function getTableAttribute()
|
protected function getTableAttribute()
|
||||||
{
|
{
|
||||||
return $this->getAnnotationFromClassname(Attribute\Obj\Table::class, false) ?: $this->getAnnotationFromClassname( Table::class, false );
|
return $this->getAttributeImplementing(Attribute\Obj\Table::class) ?: $this->getAnnotationFromClassname( Table::class, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,7 +8,7 @@ class EntityCollection extends \ArrayObject implements \JsonSerializable {
|
||||||
|
|
||||||
public ? string $entityClass = null;
|
public ? string $entityClass = null;
|
||||||
|
|
||||||
public static function instance(array $data, null|string $entityClass = null) : self
|
public static function instance(array $data = [], null|string $entityClass = null) : self
|
||||||
{
|
{
|
||||||
$instance = new static($data);
|
$instance = new static($data);
|
||||||
$instance->entityClass = $entityClass;
|
$instance->entityClass = $entityClass;
|
||||||
|
@ -326,6 +326,16 @@ class EntityCollection extends \ArrayObject implements \JsonSerializable {
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toFilteredArray(Callable $callback) : array {
|
||||||
|
$list = [];
|
||||||
|
|
||||||
|
foreach($this as $entity) {
|
||||||
|
$list[] = $callback($entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $list;
|
||||||
|
}
|
||||||
|
|
||||||
public function toJsonArray(bool $includeRelations = false) : array {
|
public function toJsonArray(bool $includeRelations = false) : array {
|
||||||
$list = [];
|
$list = [];
|
||||||
|
|
||||||
|
@ -336,7 +346,6 @@ class EntityCollection extends \ArrayObject implements \JsonSerializable {
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function fromArray(array $datasets, ? string /*stringable*/ $entityClass = null) : self
|
public function fromArray(array $datasets, ? string /*stringable*/ $entityClass = null) : self
|
||||||
{
|
{
|
||||||
foreach($datasets as $dataset) {
|
foreach($datasets as $dataset) {
|
||||||
|
|
Loading…
Reference in New Issue