function setUser($ids)
 {
     Debug::text('Setting User IDs : ', __FILE__, __LINE__, __METHOD__, 10);
     if (is_array($ids)) {
         if (!$this->isNew()) {
             //If needed, delete mappings first.
             $pgulf = new PolicyGroupUserListFactory();
             $pgulf->getByPolicyGroupId($this->getId());
             $tmp_ids = array();
             foreach ($pgulf as $obj) {
                 $id = $obj->getUser();
                 Debug::text('Policy ID: ' . $obj->getPolicyGroup() . ' ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
                 //Delete users that are not selected.
                 if (!in_array($id, $ids)) {
                     Debug::text('Deleting: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
                     $obj->Delete();
                 } else {
                     //Save ID's that need to be updated.
                     Debug::text('NOT Deleting : ' . $id, __FILE__, __LINE__, __METHOD__, 10);
                     $tmp_ids[] = $id;
                 }
             }
             unset($id, $obj);
         }
         //Insert new mappings.
         $ulf = new UserListFactory();
         foreach ($ids as $id) {
             if (isset($ids) and !in_array($id, $tmp_ids)) {
                 $pguf = new PolicyGroupUserFactory();
                 $pguf->setPolicyGroup($this->getId());
                 $pguf->setUser($id);
                 $ulf->getById($id);
                 if ($ulf->getRecordCount() > 0) {
                     $obj = $ulf->getCurrent();
                     if ($this->Validator->isTrue('user', $pguf->Validator->isValid(), TTi18n::gettext('Selected employee is invalid or already assigned to another policy group ') . ' (' . $obj->getFullName() . ')')) {
                         $pguf->save();
                     }
                 }
             }
         }
         return TRUE;
     }
     Debug::text('No User IDs to set.', __FILE__, __LINE__, __METHOD__, 10);
     return FALSE;
 }