Pimcore\Model\Object\AbstractObject::doGetInheritedValues PHP Method

doGetInheritedValues() public static method

public static doGetInheritedValues ( Concrete $object = null ) : boolean
$object Concrete
return boolean
    public static function doGetInheritedValues(Concrete $object = null)
    {
        if (self::$getInheritedValues && $object !== null) {
            $class = $object->getClass();
            return $class->getAllowInherit();
        }
        return self::$getInheritedValues;
    }

Usage Example

 /**
  * enables inheritance for field collections, if xxxInheritance field is available and set to string 'true'
  *
  * @param string $key
  * @return mixed|\Pimcore\Model\Object\Fieldcollection
  */
 public function preGetValue($key)
 {
     if ($this->getClass()->getAllowInherit() && \Pimcore\Model\Object\AbstractObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition($key) instanceof \Pimcore\Model\Object\ClassDefinition\Data\Fieldcollections) {
         $checkInheritanceKey = $key . "Inheritance";
         if ($this->{'get' . $checkInheritanceKey}() == "true") {
             $parentValue = $this->getValueFromParent($key);
             $data = $this->{$key};
             if (!$data) {
                 $data = $this->getClass()->getFieldDefinition($key)->preGetData($this);
             }
             if (!$data) {
                 return $parentValue;
             } else {
                 if (!empty($parentValue)) {
                     $value = new \Pimcore\Model\Object\Fieldcollection($parentValue->getItems());
                     if (!empty($data)) {
                         foreach ($data as $entry) {
                             $value->add($entry);
                         }
                     }
                 } else {
                     $value = new \Pimcore\Model\Object\Fieldcollection($data->getItems());
                 }
                 return $value;
             }
         }
     }
     return parent::preGetValue($key);
 }
All Usage Examples Of Pimcore\Model\Object\AbstractObject::doGetInheritedValues