recurring_holiday_obj ) ) { return $this->recurring_holiday_obj; } else { $lf = TTnew( 'RecurringHolidayListFactory' ); /** @var RecurringHolidayListFactory $lf */ $lf->getById( $this->getRecurringHoliday() ); if ( $lf->getRecordCount() == 1 ) { $this->recurring_holiday_obj = $lf->getCurrent(); return $this->recurring_holiday_obj; } return false; } } /** * @return bool|mixed */ function getHolidayPolicy() { return $this->getGenericDataValue( 'holiday_policy_id' ); } /** * @param string $value UUID * @return bool */ function setHolidayPolicy( $value ) { $value = TTUUID::castUUID( $value ); return $this->setGenericDataValue( 'holiday_policy_id', $value ); } /** * @return mixed */ function getRecurringHoliday() { return $this->getGenericDataValue( 'recurring_holiday_id' ); } /** * @param string $value UUID * @return bool */ function setRecurringHoliday( $value ) { $value = TTUUID::castUUID( $value ); return $this->setGenericDataValue( 'recurring_holiday_id', $value ); } /** * @return bool */ function Validate() { // // BELOW: Validation code moved from set*() functions. // // Holiday Policy if ( $this->getHolidayPolicy() == '' || $this->getHolidayPolicy() == TTUUID::getZeroID() ) { $hplf = TTnew( 'HolidayPolicyListFactory' ); /** @var HolidayPolicyListFactory $hplf */ $this->Validator->isResultSetWithRows( 'holiday_policy', $hplf->getByID( $this->getHolidayPolicy() ), TTi18n::gettext( 'Invalid Holiday Policy' ) ); } // Selected Recurring Holiday $rhlf = TTnew( 'RecurringHolidayListFactory' ); /** @var RecurringHolidayListFactory $rhlf */ $this->Validator->isResultSetWithRows( 'recurring_holiday', $rhlf->getByID( $this->getRecurringHoliday() ), TTi18n::gettext( 'Selected Recurring Holiday is invalid' ) ); // // ABOVE: Validation code moved from set*() functions. // return true; } //This table doesn't have any of these columns, so overload the functions. /** * @return bool */ function getDeleted() { return false; } /** * @param $bool * @return bool */ function setDeleted( $bool ) { return false; } /** * @return bool */ function getCreatedDate() { return false; } /** * @param int $epoch EPOCH * @return bool */ function setCreatedDate( $epoch = null ) { return false; } /** * @return bool */ function getCreatedBy() { return false; } /** * @param string $id UUID * @return bool */ function setCreatedBy( $id = null ) { return false; } /** * @return bool */ function getUpdatedDate() { return false; } /** * @param int $epoch EPOCH * @return bool */ function setUpdatedDate( $epoch = null ) { return false; } /** * @return bool */ function getUpdatedBy() { return false; } /** * @param string $id UUID * @return bool */ function setUpdatedBy( $id = null ) { return false; } /** * @return bool */ function getDeletedDate() { return false; } /** * @param int $epoch EPOCH * @return bool */ function setDeletedDate( $epoch = null ) { return false; } /** * @return bool */ function getDeletedBy() { return false; } /** * @param string $id UUID * @return bool */ function setDeletedBy( $id = null ) { return false; } /** * @param $log_action * @return bool */ function addLog( $log_action ) { $obj = $this->getRecurringHolidayObject(); if ( is_object( $obj ) ) { return TTLog::addEntry( $this->getHolidayPolicy(), $log_action, TTi18n::getText( 'Recurring Holiday' ) . ': ' . $obj->getName(), null, $this->getTable() ); } return false; } } ?>