示例#1
0
 public static function GetDesignation()
 {
     $c = new Criteria();
     $c->add(DesignationPeer::STATUS, Constant::RECORD_STATUS_DELETED, Criteria::NOT_EQUAL);
     $designations = DesignationPeer::doSelect($c);
     return $designations;
 }
示例#2
0
 public function executeList()
 {
     $c = new Criteria();
     //$c->add(DesignationPeer::TITLE, 'None', Criteria::NOT_EQUAL);
     $c->add(DesignationPeer::STATUS, Constant::RECORD_STATUS_DELETED, Criteria::NOT_EQUAL);
     $c->addAscendingOrderByColumn(DesignationPeer::DEPARTMENT_ID);
     $c->addAscendingOrderByColumn(DesignationPeer::TITLE);
     $this->designations = DesignationPeer::doSelect($c);
 }
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(DesignationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(DesignationPeer::DATABASE_NAME);
         $criteria->add(DesignationPeer::ID, $pks, Criteria::IN);
         $objs = DesignationPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
示例#4
0
 /**
  * Gets an array of Designation objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this Department has previously been saved, it will retrieve
  * related Designations from storage. If this Department is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array Designation[]
  * @throws     PropelException
  */
 public function getDesignations($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(DepartmentPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collDesignations === null) {
         if ($this->isNew()) {
             $this->collDesignations = array();
         } else {
             $criteria->add(DesignationPeer::DEPARTMENT_ID, $this->id);
             DesignationPeer::addSelectColumns($criteria);
             $this->collDesignations = DesignationPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(DesignationPeer::DEPARTMENT_ID, $this->id);
             DesignationPeer::addSelectColumns($criteria);
             if (!isset($this->lastDesignationCriteria) || !$this->lastDesignationCriteria->equals($criteria)) {
                 $this->collDesignations = DesignationPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastDesignationCriteria = $criteria;
     return $this->collDesignations;
 }