public function getColumnData()
{
+ $this->_postSetAttributes();
+
$res = [
'name' => $this->getAttribute('name'),
'type' => $this->getAttribute('column_type'),
class Model extends Field
{
- public function __construct($attributes)
+ public function getColumnData()
{
- parent::__construct($attributes);
+ $res = parent::getColumnData();
+ $res['model'] = $this->getAttribute('model');
+ $res['entity'] = $this->getAttribute('entity');
+ $res['attribute'] = $this->getAttribute('attribute');
+ return $res;
}
public function getDefaultAttributes()
protected function _postSetAttributes()
{
- if (!$this->hasAttribute('entity')) {
- $this->setAttribute('entity', $this->getAttribute('name'));
- }
+ $this->setAttributeIfNotSet('entity', 'entity_' . $this->getAttribute('name'));
}
}
{
protected $_adminType = 'select2';
protected $_databaseType = 'text';
+ protected $_columnType = 'select';
protected $_multiple = false;
public function getRelationship()