public function getAccountRoleByRow($rec)
{
if ($rec !== false) {
$baseRole = $this->getRole($rec['role_id']);
if (!$baseRole) {
//Hardly probable case because of that foreign key is responsible for this
throw new Exception\AclException(sprintf("Base ACL role (role_id:%d) does not exist.", $rec['role_id']));
}
$role = new Role\AccountRoleObject($baseRole, $rec['account_id'], $rec['account_role_id'], $rec['name'], $rec['color'], $rec['is_automatic']);
$this->loadRolePermissions($role);
}
return isset($role) ? $role : null;
}