Skip to content
Snippets Groups Projects
Commit 601369f3 authored by Tim Steiner's avatar Tim Steiner
Browse files

Handle ::find(NULL) on Group and User models.

parent 9e86e454
No related branches found
No related tags found
No related merge requests found
......@@ -64,10 +64,8 @@ class Auth_GroupModel extends Unl_Model
*/
static public function findByUser($user, $implicitMemberships = true)
{
if (Unl_Util::isArray($user) && count($user) == 0) {
if ((Unl_Util::isArray($user) && count($user) == 0) || $user === NULL) {
return new Unl_Model_Collection(__CLASS__);
} else if ($user === NULL) {
return null;
}
$db = Zend_Registry::get('db');
......@@ -147,10 +145,8 @@ class Auth_GroupModel extends Unl_Model
*/
static public function findByChildGroup($group, $impliedMemberships = true)
{
if (Unl_Util::isArray($group) && count($group) == 0) {
if ((Unl_Util::isArray($group) && count($group) == 0) || $group === NULL) {
return new Unl_Model_Collection(__CLASS__);
} else if ($group === NULL) {
return null;
}
$db = Zend_Registry::get('db');
......@@ -207,10 +203,8 @@ class Auth_GroupModel extends Unl_Model
*/
static public function findByParentGroup($group, $impliedMemberships = true, $primaryGroups = false)
{
if (Unl_Util::isArray($group) && count($group) == 0) {
if ((Unl_Util::isArray($id) && count($id) == 0) || $group === NULL) {
return new Unl_Model_Collection(__CLASS__);
} else if ($group === NULL) {
return null;
}
$db = Zend_Registry::get('db');
......
......@@ -107,10 +107,8 @@ class Auth_UserModel extends Unl_Model {
*/
static public function findByParentGroup($group, $impliedMemberships = true)
{
if (Unl_Util::isArray($group) && count($group) == 0) {
if ((Unl_Util::isArray($group) && count($group) == 0) || $group === NULL) {
return new Unl_Model_Collection(__CLASS__);
} else if ($group === NULL) {
return null;
}
$db = Zend_Registry::get('db');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment