- Added a new MsSQL adapter
- Some bugfixes were made within annotations. - Added a new Object Instanciator which allows to manipulate and define how an object from an entity must be instanciated with given value.
This commit is contained in:
1 parent
9df7e65dcf
commit
5bd60129ea
22 files changed
+547
-103
No files matched your search
@@ -12,6 +12,8 @@ abstract class Ulmus
|
||||
|
||||
public static ConnectionAdapter $defaultAdapter;
|
||||
|
||||
public static Entity\ObjectInstanciator $objectInstanciator;
|
||||
|
||||
public static array $resolved = [];
|
||||
|
||||
public static function iterateQueryBuilder(QueryBuilder $queryBuilder, ?ConnectionAdapter $adapter = null) : Generator
|
||||
@@ -50,6 +52,11 @@ abstract class Ulmus
|
||||
return new static::$queryBuilderClass(...$arguments);
|
||||
}
|
||||
|
||||
public static function instanciateObject(string $type, array $arguments) : object
|
||||
{
|
||||
return ( static::$objectInstanciator ?? static::$objectInstanciator = new Entity\ObjectInstanciator() )->instanciate($type, $arguments);
|
||||
}
|
||||
|
||||
protected static function fetchQueryBuilder(QueryBuilder $queryBuilder, ?ConnectionAdapter $adapter = null) : array
|
||||
{
|
||||
return ( $adapter ?: static::$defaultAdapter )->pdo->select($queryBuilder->render(), $queryBuilder->parameters ?? [])->fetchAll();
|
||||
|
||||
Reference in new issue
Block a user