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

getProperties() public method

public getProperties ( ) : Property[]
return Property[]
    public function getProperties()
    {
        if ($this->o_properties === null) {
            // try to get from cache
            $cacheKey = "object_properties_" . $this->getId();
            $properties = Cache::load($cacheKey);
            if (!is_array($properties)) {
                $properties = $this->getDao()->getProperties();
                $elementCacheTag = $this->getCacheTag();
                $cacheTags = ["object_properties" => "object_properties", $elementCacheTag => $elementCacheTag];
                Cache::save($properties, $cacheKey, $cacheTags);
            }
            $this->setProperties($properties);
        }
        return $this->o_properties;
    }

Usage Example

Esempio n. 1
0
 /**
  * @param  AbstractObject $target
  * @param  AbstractObject $source
  * @return AbstractObject copied object
  */
 public function copyAsChild($target, $source)
 {
     //load properties
     $source->getProperties();
     //load all in case of lazy loading fields
     self::loadAllObjectFields($source);
     $new = clone $source;
     $new->o_id = null;
     $new->setChilds(null);
     $new->setKey(Element\Service::getSaveCopyName("object", $new->getKey(), $target));
     $new->setParentId($target->getId());
     $new->setUserOwner($this->_user->getId());
     $new->setUserModification($this->_user->getId());
     $new->setDao(null);
     $new->setLocked(false);
     $new->setCreationDate(time());
     $new->save();
     // $this->updateChilds($target, $new);
     return $new;
 }
All Usage Examples Of Pimcore\Model\Object\AbstractObject::getProperties