protected function createDataDescription() { $result = parent::createDataDescription(); if (in_array($this->getType(), array(self::COMPONENT_TYPE_FORM_ADD, self::COMPONENT_TYPE_FORM_ALTER))) { $field = $result->getFieldDescriptionByName('smap_id'); $field->setType(FieldDescription::FIELD_TYPE_STRING); $field->setMode(FieldDescription::FIELD_MODE_READ); } return $result; }
protected function createDataDescription() { $dd = LinkingEditor::createDataDescription(); if (in_array($this->getState(), ['add', 'edit'])) { $dd->getFieldDescriptionByName('smap_id')->setType(FieldDescription::FIELD_TYPE_SMAP_SELECTOR); $fd = new FieldDescription('news_is_top'); $fd->setType(FieldDescription::FIELD_TYPE_BOOL); $fd->setProperty('tag', 'top'); $dd->addFieldDescription($fd, DataDescription::FIELD_POSITION_AFTER, $this->getPK()); } return $dd; }