public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(EmployeeLeavePeer::ID, $pks, Criteria::IN); $objs = EmployeeLeavePeer::doSelect($criteria, $con); } return $objs; }
public function getEmployeeLeaves($criteria = null, $con = null) { include_once 'lib/model/om/BaseEmployeeLeavePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collEmployeeLeaves === null) { if ($this->isNew()) { $this->collEmployeeLeaves = array(); } else { $criteria->add(EmployeeLeavePeer::EMPLOYEE_LEVEL_ID, $this->getId()); EmployeeLeavePeer::addSelectColumns($criteria); $this->collEmployeeLeaves = EmployeeLeavePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(EmployeeLeavePeer::EMPLOYEE_LEVEL_ID, $this->getId()); EmployeeLeavePeer::addSelectColumns($criteria); if (!isset($this->lastEmployeeLeaveCriteria) || !$this->lastEmployeeLeaveCriteria->equals($criteria)) { $this->collEmployeeLeaves = EmployeeLeavePeer::doSelect($criteria, $con); } } } $this->lastEmployeeLeaveCriteria = $criteria; return $this->collEmployeeLeaves; }