Пример #1
0
 /**
  * Returns the whole tree node for a given scope
  *
  * @param      int $scope		Scope to determine which root node to return
  * @param      Criteria $criteria	Optional Criteria to filter the query
  * @param      PropelPDO $con	Connection to use.
  * @return     Especialidad			Propel object for root node
  */
 public static function retrieveTree($scope = null, Criteria $criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(EspecialidadPeer::DATABASE_NAME);
     }
     $criteria->addAscendingOrderByColumn(EspecialidadPeer::LEFT_COL);
     $criteria->add(EspecialidadPeer::SCOPE_COL, $scope, Criteria::EQUAL);
     return EspecialidadPeer::doSelect($criteria, $con);
 }
Пример #2
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @return Especialidad[]
  * @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(EspecialidadPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(EspecialidadPeer::DATABASE_NAME);
         $criteria->add(EspecialidadPeer::IDESPECIALIDAD, $pks, Criteria::IN);
         $objs = EspecialidadPeer::doSelect($criteria, $con);
     }
     return $objs;
 }