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