- Merge with Mssql repository bugfix
This commit is contained in:
1 parent
724ab250ab
commit
e1990e7cc0
11 files changed
+95
-87
No files matched your search
+5
-1
@@ -204,6 +204,10 @@ trait EntityTrait {
|
||||
*/
|
||||
public function isLoaded() : bool
|
||||
{
|
||||
if (empty($this->entityLoadedDataset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( null === $pkField = $this->resolveEntity()->getPrimaryKeyField($this) ) {
|
||||
throw new Exception\EntityPrimaryKeyUnknown(sprintf("Entity %s has no field containing attributes 'primary_key'", static::class));
|
||||
}
|
||||
@@ -315,7 +319,7 @@ trait EntityTrait {
|
||||
*/
|
||||
public static function field($name, ? string $alias = null) : EntityField
|
||||
{
|
||||
return new EntityField(static::class, $name, $alias ?: Repository::DEFAULT_ALIAS, Ulmus::resolveEntity(static::class));
|
||||
return new EntityField(static::class, $name, $alias ? Ulmus::repository(static::class)->adapter->adapter()->escapeIdentifier($alias, Adapter\AdapterInterface::IDENTIFIER_FIELD) : Repository::DEFAULT_ALIAS, Ulmus::resolveEntity(static::class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user