function getByStationIdArray($id)
 {
     $siulf = new StationExcludeUserListFactory();
     $siulf->getByStationId($id);
     foreach ($siulf as $obj) {
         $list[$obj->getStation()] = NULL;
     }
     if (isset($list)) {
         return $list;
     }
     return array();
 }
 function setExcludeUser($ids)
 {
     Debug::text('Setting IDs...', __FILE__, __LINE__, __METHOD__, 10);
     if (is_array($ids)) {
         $tmp_ids = array();
         if (!$this->isNew()) {
             //If needed, delete mappings first.
             $lf_a = new StationExcludeUserListFactory();
             $lf_a->getByStationId($this->getId());
             foreach ($lf_a as $obj) {
                 $id = $obj->getExcludeUser();
                 Debug::text('ExcludeUser ID: ' . $obj->getExcludeUser() . ' 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.
         $lf_b = new UserListFactory();
         foreach ($ids as $id) {
             if (isset($ids) and !in_array($id, $tmp_ids)) {
                 $f = new StationExcludeUserFactory();
                 $f->setStation($this->getId());
                 $f->setExcludeUser($id);
                 $obj = $lf_b->getById($id)->getCurrent();
                 if ($this->Validator->isTrue('exclude_user', $f->Validator->isValid(), TTi18n::gettext('Selected Employee is invalid') . ' (' . $obj->getFullName() . ')')) {
                     $f->save();
                 }
             }
         }
         return TRUE;
     }
     Debug::text('No IDs to set.', __FILE__, __LINE__, __METHOD__, 10);
     return FALSE;
 }