Files
pae.co.at/trunk/proactiveenglish/lib/model/EmployeePeer.php
2017-03-02 21:57:21 -06:00

62 lines
1.4 KiB
PHP

<?php
/**
* Subclass for performing query and update operations on the 'Employee' table.
*
*
*
* @package lib.model
*/
class EmployeePeer extends BaseEmployeePeer
{
/**
* Gets the staff members of the employees.
*
* @return staff employees
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getStaff()
{
$c = new Criteria();
$c->addJoin(self::POSITION, LuEmployeePositionPeer::ID);
$c->add(LuEmployeePositionPeer::POSITION, 'staff');
$c->add(self::ACTIVE, true);
$c->addAscendingOrderByColumn(self::SORT_ORDER);
$c->addAscendingOrderByColumn(self::NAME);
return self::doSelect($c);
}
/**
* Gets all the trainers of the employees.
*
* @return trainer employees
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getTrainers()
{
$c = new Criteria();
$c->addJoin(self::POSITION, LuEmployeePositionPeer::ID);
$c->add(LuEmployeePositionPeer::POSITION, 'trainer');
$c->add(self::ACTIVE, true);
$c->addAscendingOrderByColumn(self::SORT_ORDER);
$c->addAscendingOrderByColumn(self::NAME);
return self::doSelect($c);
}
/**
* Gets a employee by the slug
*
* @return the employee matching the slug
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getBySlug($slug)
{
$c = new Criteria();
$c->add(self::SLUG, $slug);
return self::doSelect($c);
}
}