/** * 取得角色数据对象 * * @param integer $roleId * @param ZtChart_Model_DbTable_Role $roleDAO * @return ZtChart_Model_Db_Table_Row */ public function fetchRow($roleId, $roleDAO = null) { if (null === $roleDAO) { $roleDAO = new ZtChart_Model_DbTable_Role(); } return $roleDAO->fetchRow(array('role_id = ?' => $roleId)); }
/** * * @param integer|string|ZtChart_Model_Db_Table_Row $role */ public function __construct($role) { if (null !== $role) { if (!$role instanceof ZtChart_Model_Db_Table_Row) { $roleDAO = new ZtChart_Model_DbTable_Role(); if (is_numeric($role)) { $role = $roleDAO->fetchRow($role); } } $this->_roleRow = $role; } }
/** * 取得一个角色 * * @param integer $roleId * @return ZtChart_Model_Db_Table_Row */ public function fetchRow($roleId) { return $this->_roleDAO->fetchRow($roleId); }