Пример #1
0
 /**
  * Public constructor. Overrides the parent constructor, making sure there are lft/rgt columns which make it
  * compatible with nested sets.
  *
  * @see \Awf\Mvc\DataModel::__construct()
  *
  * @param Container $container
  *
  * @throws \RuntimeException When lft/rgt columns are not found
  */
 public function __construct(\Awf\Container\Container $container = null)
 {
     parent::__construct($container);
     if (!$this->hasField('lft') || !$this->hasField('rgt')) {
         throw new \RuntimeException("Table {$this->tableName} is not compatible with TreeModel: it does not have lft/rgt columns");
     }
 }