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;
}
/** * @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; }