/** * append a datarow object to the list * @param DataRow $data * @return boolean false if data table not match */ public function append(DataRow $data) { if ($data->getTable()) { if ($data->getTable()->getTableName() != $this->_table->getTableName()) { return false; } } else { $data->setTable($this->_table); } $this->_data[] = $data; return true; }
public function __construct(DataRow $row) { if ($row->getTable()->getTableName() !== DB::getRoleTableName()) { throw new SystemException('Wrong Role Table'); } $this->_data = $row->getAllData(); //load permission $this->loadPermission(); }
public function __construct(DataRow $row = null) { if ($row === null) { $this->_data = array('id' => 0, 'name' => '请选择科目'); $this->setTable(new Table('subjects')); } else { $this->_data = $row->getAllData(); $this->setTable($row->getTable()); } }