|
Country |
Employee |
EmployeeIndexPage |
EmployeePropertyHoursPage |
EmployeePropertyHoursPart |
EmployeeSaveAction |
Gender |
GlobalFilterFormPart |
Hours |
HoursCategory |
HoursCategoryEditDetailsPage |
HoursSearchPage |
IndexPage |
MenuPart |
PntSqlFilterGlobalAction |
PntSqlFilterGlobalDialog |
|
getClassDir |
getEditInfo |
getGlobalDateFilter |
getHours |
getHoursSince |
getLabel |
getLabelSort |
getNHours |
getName |
getTableName |
getUiColumnPaths |
getUiFieldPaths |
getUiReportPaths |
initPropertyDescriptors |
|
function ($useFilter=true) {
if ($useFilter && $this->hours !== null) {
reset($this->hours);
return $this->hours;
}
Gen::includeClass('Hours', $this->());
Gen::includeClass('PntSqlCombiFilter', 'pnt/db/query');
//create filter for employeeId = $this->('id')
$employeeIdFilter = PntSqlFilter::getInstance('Hours', 'employeeId', '=', $this->('id'));
$dateFilter = $useFilter ? $this->() : null;
if ($dateFilter) {
$dateFilter->('itemType', 'Hours');
//AND both filters
$filter = new PntSqlCombiFilter();
$filter->($employeeIdFilter);
$filter->($dateFilter);
} else {
$filter = $employeeIdFilter;
}
$clsDes = PntClassDescriptor::getInstance('Hours');
$hours = $clsDes->($filter);
if ($useFilter)
$this->hours = $hours;
//else: do not cache the unfiltered result
return $hours;
}
|
Copyright (c) MetaClass, 2003-
This code is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
Click here for a copy of the license or see http://www.gnu.org/licenses/ .
|
|