当前位置: 首页>>代码示例>>PHP>>正文


PHP Object_Abstract::getGetInheritedValues方法代码示例

本文整理汇总了PHP中Object_Abstract::getGetInheritedValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Object_Abstract::getGetInheritedValues方法的具体用法?PHP Object_Abstract::getGetInheritedValues怎么用?PHP Object_Abstract::getGetInheritedValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Object_Abstract的用法示例。


在下文中一共展示了Object_Abstract::getGetInheritedValues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 /**
  * @param Object_Concrete $object
  * @return void
  */
 public function save($object)
 {
     $getters = $this->getBrickGetters();
     foreach ($getters as $getter) {
         $brick = $this->{$getter}();
         if ($brick instanceof Object_Objectbrick_Data_Abstract) {
             if ($brick->getDoDelete()) {
                 $brick->delete($object);
                 $setter = "s" . substr($getter, 1);
                 $this->{$setter}(null);
                 //check if parent object has brick, and if so, create an empty brick to enable inheritance
                 $parentBrick = null;
                 $inheritanceModeBackup = Object_Abstract::getGetInheritedValues();
                 Object_Abstract::setGetInheritedValues(true);
                 if (Object_Abstract::doGetInheritedValues($object)) {
                     $container = $object->getValueFromParent($this->fieldname);
                     if (!empty($container)) {
                         $parentBrick = $container->{$getter}();
                     }
                 }
                 Object_Abstract::setGetInheritedValues($inheritanceModeBackup);
                 if (!empty($parentBrick)) {
                     $brickType = "Object_Objectbrick_Data_" . ucfirst($parentBrick->getType());
                     $brick = new $brickType($object);
                     $brick->setFieldname($this->getFieldname());
                     $brick->save($object);
                     $this->{$setter}($brick);
                 }
             } else {
                 $brick->setFieldname($this->getFieldname());
                 $brick->save($object);
             }
         } else {
             if ($brick == null) {
                 $parentBrick = null;
                 $inheritanceModeBackup = Object_Abstract::getGetInheritedValues();
                 Object_Abstract::setGetInheritedValues(true);
                 if (Object_Abstract::doGetInheritedValues($object)) {
                     $container = $object->getValueFromParent($this->fieldname);
                     if (!empty($container)) {
                         $parentBrick = $container->{$getter}();
                     }
                 }
                 Object_Abstract::setGetInheritedValues($inheritanceModeBackup);
                 if (!empty($parentBrick)) {
                     $brickType = "Object_Objectbrick_Data_" . ucfirst($parentBrick->getType());
                     $brick = new $brickType($object);
                     $brick->setFieldname($this->getFieldname());
                     $brick->save($object);
                 }
             }
         }
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:58,代码来源:Objectbrick.php


注:本文中的Object_Abstract::getGetInheritedValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。