- Bugfixes in search request, WIP on JsonTrait
This commit is contained in:
parent
e3314f40ac
commit
b601939459
|
@ -13,7 +13,7 @@ class SQLite implements AdapterInterface, MigrateInterface, SqlAdapterInterface
|
|||
use SqlAdapterTrait;
|
||||
|
||||
const ALLOWED_ATTRIBUTES = [
|
||||
'default', 'primary_key', 'auto_increment'
|
||||
'default', 'primary_key', 'auto_increment', 'collate nocase', 'collate binary', 'collate rtrim',
|
||||
];
|
||||
|
||||
const DSN_PREFIX = "sqlite";
|
||||
|
|
|
@ -1055,9 +1055,10 @@ class Repository implements RepositoryInterface
|
|||
|
||||
public function instanciateEntity(? string $entityClass = null) : object
|
||||
{
|
||||
$entityClass ??= $this->entityClass;
|
||||
$entity = ( new \ReflectionClass($entityClass ?? $this->entityClass) )->newInstanceWithoutConstructor();
|
||||
$entity->initializeEntity();
|
||||
|
||||
return new $entityClass;
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function hasFilters() : bool
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
namespace Ulmus\Repository;
|
||||
|
||||
use Ulmus\{Common\EntityResolver, ConnectionAdapter, MysqlQueryBuilder, Repository, Query, Ulmus};
|
||||
use Ulmus\{ Repository, Query, Ulmus};
|
||||
|
||||
class MysqlRepository extends Repository {
|
||||
use JsonConditionTrait;
|
||||
|
||||
public function pragma(/*object|Stringable*/ $pragma, $argument = null, bool $callable = false) : self
|
||||
{
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
namespace Ulmus\Repository;
|
||||
|
||||
use Ulmus\{ConnectionAdapter, MysqlQueryBuilder, Repository, Query, Ulmus, Entity};
|
||||
use Ulmus\{Repository, Entity};
|
||||
|
||||
class SqliteRepository extends Repository {
|
||||
use JsonConditionTrait;
|
||||
|
||||
public function pragma(\Stringable|string $pragma, $argument = null, bool $callable = false) : self
|
||||
{
|
||||
|
|
|
@ -90,7 +90,8 @@ trait SearchRequestFromRequestTrait
|
|||
sprintf("Given value '%s' do not exists within enum '%s'. Try one of those values instead : %s", $value, $enum, $cases)
|
||||
);
|
||||
}
|
||||
} elseif ($type->builtIn) {
|
||||
}
|
||||
elseif ($type->builtIn || $value instanceof \Stringable ) {
|
||||
$this->$propertyName = $value;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue