Quick search:

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 getHours($useFilter=true) {
		if ($useFilter && $this->hours !== null) {
			reset($this->hours);
			return $this->hours;
		}

		Gen::includeClass('Hours', $this->getClassDir());
		Gen::includeClass('PntSqlCombiFilter', 'pnt/db/query');

		//create filter for employeeId = $this->get('id')
		$employeeIdFilter = PntSqlFilter::getInstance('Hours', 'employeeId', '=', $this->get('id'));

		$dateFilter = $useFilter ? $this->getGlobalDateFilter() : null;
		if ($dateFilter) {
			$dateFilter->set('itemType', 'Hours');
			//AND both filters
			$filter = new PntSqlCombiFilter();
			$filter->addPart($employeeIdFilter);
			$filter->addPart($dateFilter);
		} else {
			$filter = $employeeIdFilter;
		}

		$clsDes = PntClassDescriptor::getInstance('Hours');
		$hours = $clsDes->getPeanutsAccordingTo($filter);
		if ($useFilter)
			$this->hours = $hours; 
		//else: do not cache the unfiltered result

		return $hours;
	}
Copyright (c) MetaClass, 2003-2013

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/ .