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

__wakeup() public method

public __wakeup ( )
    public function __wakeup()
    {
        if (isset($this->_fulldump) && !self::$doNotRestoreKeyAndPath) {
            // set current key and path this is necessary because the serialized data can have a different path than the original element ( element was renamed or moved )
            $originalElement = AbstractObject::getById($this->getId());
            if ($originalElement) {
                $this->setKey($originalElement->getKey());
                $this->setPath($originalElement->getRealPath());
            }
        }
        if (isset($this->_fulldump) && $this->o_properties !== null) {
            $this->renewInheritedProperties();
        }
        if (isset($this->_fulldump)) {
            unset($this->_fulldump);
        }
    }

Usage Example

コード例 #1
0
ファイル: Concrete.php プロジェクト: sfie/pimcore
 /**
  *
  */
 public function __wakeup()
 {
     parent::__wakeup();
     // renew localized fields
     // do not use the getter ($this->getLocalizedfields()) as it somehow slows down the process around a sec
     // no clue why this happens
     if (property_exists($this, "localizedfields") && $this->localizedfields instanceof Localizedfield) {
         $this->localizedfields->setObject($this);
     }
 }