- Latest commit into this branch, merging after

This commit is contained in:
Dave Mc Nicoll 2024-11-13 14:02:03 -05:00
commit 70c6cde603
6 changed files with 24 additions and 3 deletions

View File

@ -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:

View File

@ -0,0 +1,9 @@
<?php
namespace Ulmus\Event\Repository;
use Ulmus\EntityCollection;
interface CollectionFromQueryItemInterface {
public function execute(array &$data) : array;
}

View File

@ -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);

View File

@ -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;

View File

@ -0,0 +1,8 @@
<?php
namespace Ulmus\Repository;
interface RepositoryInterface
{
}