/** * Executes an SQL command and returns auth items with the RBAMAuthItemBehavior attached. * @param CDbAuthManager owner * @param string sql to execute * @return array CAuthItems with RBAMAuthItemBehavior attached */ private function itemsFromSql($owner, $sql) { $items = array(); foreach ($owner->db->createCommand($sql)->queryAll() as $row) { if (($data = @unserialize($row['data'])) === false) { $data = null; } $item = new CAuthItem($owner, $row['name'], $row['type'], $row['description'], $row['bizrule'], $data); $item->attachBehavior('RbamAuthItemBehavior', 'RbamAuthItemBehavior'); $items[$row['name']] = $item; } return $items; }