本文整理汇总了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);
}
}
}
}
}