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

Minor update to User model to unify the factory code.

parent 22b3e49d
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,10 @@ class Auth_UserModel extends Unl_Model {
$objects[$objectId] = $object;
}
foreach ($objects as $user) {
$user->_setClean();
}
if (Unl_Util::isArray($id)) {
return $objects;
} else {
......@@ -73,13 +77,13 @@ class Auth_UserModel extends Unl_Model {
}
$records = $db->query($select)->fetchAll();
$objects = new Unl_Model_Collection('Auth_UserModel');
$userIds = array(-1);
foreach ($records as $record) {
$object = Unl_Model_Registry::getInstance()->getOrAdd(new self($record));
$objectId = $object->getId();
$objects[$objectId] = $object;
$userIds[] = $record['userId'];
}
$objects = self::find($userIds);
if (Unl_Util::isArray($username)) {
return $objects;
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment