This commit is contained in:
Yuri Kuznetsov
2024-11-15 13:08:10 +02:00
parent d8b3b5361a
commit 4eb375c1cf
22 changed files with 95 additions and 57 deletions
+4 -4
View File
@@ -457,8 +457,8 @@ class BaseEntity implements Entity
$type = $this->getAttributeType($attribute);
return $type === AttributeType::FOREIGN &&
$this->getAttributeParam($attribute, 'relation') === substr($attribute, 0, -2) &&
$this->getAttributeParam($attribute, 'foreign') === Attribute::ID &&
$this->getAttributeParam($attribute, AttributeParam::RELATION) === substr($attribute, 0, -2) &&
$this->getAttributeParam($attribute, AttributeParam::FOREIGN) === Attribute::ID &&
str_ends_with($attribute, 'Id');
}
@@ -583,8 +583,8 @@ class BaseEntity implements Entity
return null;
}
$relation = $entityDefs->getAttribute($attribute)->getParam('relation');
$foreign = $entityDefs->getAttribute($attribute)->getParam('foreign');
$relation = $entityDefs->getAttribute($attribute)->getParam(AttributeParam::RELATION);
$foreign = $entityDefs->getAttribute($attribute)->getParam(AttributeParam::FOREIGN);
if (!$relation) {
return null;