class Model extends Field
{
+ protected static $_options = null;
+
public function getColumnData()
{
$res = parent::getColumnData();
return $res;
}
- protected function _postSetAttributes()
- {
- parent::_postSetAttributes();
- }
-
public function getDefaultAttributes()
{
return array_merge(parent::getDefaultAttributes(), ['attribute' => 'name', 'allows_null' => false, 'allows_multiple' => $this->_multiple]);
}
protected function _getOptions()
+ {
+ if (null === static::$_options) {
+ static::$_options = $this->__getOptions();
+ }
+ return static::$_options;
+ }
+
+ protected function __getOptions()
{
$modelClass = $this->getAttribute('optionsmodel');
$inst = new $modelClass();