function Validate() { if ($this->getDeleted() == TRUE) { //Check to make sure there are no hours using this OT policy. $udtlf = new UserDateTotalListFactory(); $udtlf->getByAbsencePolicyId($this->getId()); if ($udtlf->getRecordCount() > 0) { $this->Validator->isTRUE('in_use', FALSE, TTi18n::gettext('This absence policy is in use')); } } return TRUE; }