formula: parentName

This commit is contained in:
yuri
2017-02-14 11:17:35 +02:00
parent 159a2ee99d
commit 109ee17a47
3 changed files with 15 additions and 1 deletions
@@ -1,4 +1,4 @@
<?php
<?php
/************************************************************************
* This file is part of EspoCRM.
*
@@ -65,6 +65,13 @@ class AttributeFetcher
$methodName = 'getFetched';
}
if ($entity->getAttributeParam($attribute, 'isParentName') && $methodName == 'get') {
$relationName = $entity->getAttributeParam($attribute, 'relation');
if ($parent = $entity->get($relationName)) {
return $parent->get('name');
}
}
return $entity->$methodName($attribute);
}
@@ -48,6 +48,8 @@ class LinkParent extends Base
$fieldName.'Name' => array(
'type' => 'varchar',
'notStorable' => true,
'relation' => $fieldName,
'isParentName' => true
),
),
),
+5
View File
@@ -383,6 +383,11 @@ abstract class Entity implements IEntity
return null;
}
public function hasFetched($attributeName)
{
return array_key_exists($attributeName, $this->fetchedValuesContainer);
}
public function resetFetchedValues()
{
$this->fetchedValuesContainer = array();