public function setContent($content) { $this->__set('content', $content); $this->__set('contentTitle', \Acd\Model\ValueFormater::encode($content->getTitle(), \Acd\Model\ValueFormater::TYPE_TEXT_SIMPLE, \Acd\Model\ValueFormater::FORMAT_EDITOR)); $this->__set('aliasId', \Acd\Model\ValueFormater::encode($content->getAliasId(), \Acd\Model\ValueFormater::TYPE_TEXT_SIMPLE, \Acd\Model\ValueFormater::FORMAT_EDITOR)); $this->__set('contentTags', \Acd\Model\ValueFormater::encode($content->getTags(), \Acd\Model\ValueFormater::TYPE_TAGS, \Acd\Model\ValueFormater::FORMAT_EDITOR)); }
public function setField($field) { $this->field = $field; $this->__set('fieldId', $field->getId()); $this->__set('fieldName', $field->getName()); $this->__set('fieldValue', \Acd\Model\ValueFormater::encode($field->getValue(), $field->getType(), \Acd\Model\ValueFormater::FORMAT_EDITOR)); // Antes $field->getValue()); //$ref = $field->getRef(); $ref = $field->getValue(); //d($field->getValue()); if ($field->getType() === 'content' && $ref) { //d($field->getType()); $id = $field->getRef()['ref']; //d($id,$field->getValue()->get($id)->getTitle(), $field->getRef()); } //$ref = is_string($ref) ? $ref : ''; $this->__set('fieldRef', $ref); //d($ref); $this->__set('fieldStructureRef', $field->getStructureRef()); /* switch ($field->getType()) { case 'content': d($field->getValue()); $this->__set('fieldValue', $field->getValue()); break; default: $this->__set('fieldValue', $field->getValue()); break; } */ }