- Latest commit into this branch, merging after
This commit is contained in:
commit
70c6cde603
|
@ -207,6 +207,7 @@ class MsSQL implements AdapterInterface, MigrateInterface, SqlAdapterInterface {
|
|||
public static function escapeIdentifier(string $segment, int $type) : string
|
||||
{
|
||||
switch($type) {
|
||||
default:
|
||||
case static::IDENTIFIER_SCHEMA:
|
||||
case static::IDENTIFIER_DATABASE:
|
||||
case static::IDENTIFIER_TABLE:
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Ulmus\Event\Repository;
|
||||
|
||||
use Ulmus\EntityCollection;
|
||||
|
||||
interface CollectionFromQueryItemInterface {
|
||||
public function execute(array &$data) : array;
|
||||
}
|
|
@ -16,7 +16,7 @@ trait EventTrait
|
|||
return array_filter($this->eventList, fn($ev) => $ev instanceof $type);
|
||||
}
|
||||
|
||||
public function eventExecute(string $type, ...$arguments) : void
|
||||
public function eventExecute(string $type, &...$arguments) : void
|
||||
{
|
||||
foreach($this->eventFromType($type) as $event) {
|
||||
call_user_func_array([ $event, 'execute'], $arguments);
|
||||
|
|
|
@ -6,9 +6,10 @@ use Ulmus\Attribute\Property\{
|
|||
Field, OrderBy, Where, Having, Relation, Filter, Join, FilterJoin, WithJoin
|
||||
};
|
||||
use Ulmus\Common\EntityResolver;
|
||||
use Ulmus\Repository\RepositoryInterface;
|
||||
use Ulmus\Repository\WithOptionEnum;
|
||||
|
||||
class Repository
|
||||
class Repository implements RepositoryInterface
|
||||
{
|
||||
use EventTrait, Repository\ConditionTrait, Repository\EscapeTrait;
|
||||
|
||||
|
@ -874,6 +875,8 @@ class Repository
|
|||
$this->finalizeQuery();
|
||||
|
||||
foreach(Ulmus::iterateQueryBuilder($this->queryBuilder, $this->adapter) as $entityData) {
|
||||
$this->eventExecute(\Ulmus\Event\Repository\CollectionFromQueryItemInterface::class, $entityData);
|
||||
|
||||
$entity = $this->instanciateEntity($entityClass);
|
||||
$entity->loadedFromAdapter = $this->adapter->name;
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Ulmus\Repository;
|
||||
|
||||
interface RepositoryInterface
|
||||
{
|
||||
|
||||
}
|
Loading…
Reference in New Issue