- 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 | ||||
|     { | ||||
|         return QueryBuilder\SqlQueryBuilder\MssqlQueryBuilder::class; | ||||
|         return QueryBuilder\Sql\MssqlQueryBuilder::class; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -9,7 +9,7 @@ class Join { | ||||
|     public function __construct( | ||||
|         public string $type, | ||||
|         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 $alias = null, | ||||
|     ) { | ||||
|  | ||||
| @ -10,10 +10,11 @@ class OrWhere extends Where { | ||||
|     public function __construct( | ||||
|         public string|\Stringable|array $field, | ||||
|         public mixed $value = null, | ||||
|         public null|string $operator = null, | ||||
|         public null|string $condition = Query\Where::CONDITION_OR, | ||||
|         public string $operator = Query\Where::OPERATOR_EQUAL, | ||||
|         public string $condition = Query\Where::CONDITION_OR, | ||||
|         public string|\Stringable|array|null $fieldValue = null, | ||||
|         public null|array $generateValue = null, | ||||
|     ) { | ||||
| 
 | ||||
|         $this->key = Attribute::handleArrayField($this->key); | ||||
|         parent::__construct($field, $value, $operator, $condition, $fieldValue, $generateValue); | ||||
|     } | ||||
| } | ||||
| @ -248,7 +248,7 @@ class EntityResolver { | ||||
| 
 | ||||
|     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 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->entityClass = $entityClass; | ||||
| @ -326,6 +326,16 @@ class EntityCollection extends \ArrayObject implements \JsonSerializable { | ||||
|         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 { | ||||
|         $list = []; | ||||
| 
 | ||||
| @ -336,7 +346,6 @@ class EntityCollection extends \ArrayObject implements \JsonSerializable { | ||||
|         return $list; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public function fromArray(array $datasets, ? string /*stringable*/ $entityClass = null) : self | ||||
|     { | ||||
|         foreach($datasets as $dataset) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user