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(SubdepartmentPeer::ID, $pks, Criteria::IN);
         $objs = SubdepartmentPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #2
0
 public function handleErrorUpdateProfile()
 {
     $this->forward404Unless($this->getUser()->isAuthenticated(), 'not logged in, cannot edit profile, obviously');
     $this->tab = "editprofile";
     $this->profile = $this->getUser()->getProfile();
     $this->campuses = CampusPeer::doSelect(new Criteria());
     $this->departments = DepartmentPeer::doSelect(new Criteria());
     $this->subdepartments = SubdepartmentPeer::doSelect(new Criteria());
     $this->setTemplate("editProfile");
     return sfView::SUCCESS;
 }
Example #3
0
 public function getSubdepartments($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseSubdepartmentPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collSubdepartments === null) {
         if ($this->isNew()) {
             $this->collSubdepartments = array();
         } else {
             $criteria->add(SubdepartmentPeer::DEPARTMENT_ID, $this->getId());
             SubdepartmentPeer::addSelectColumns($criteria);
             $this->collSubdepartments = SubdepartmentPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(SubdepartmentPeer::DEPARTMENT_ID, $this->getId());
             SubdepartmentPeer::addSelectColumns($criteria);
             if (!isset($this->lastSubdepartmentCriteria) || !$this->lastSubdepartmentCriteria->equals($criteria)) {
                 $this->collSubdepartments = SubdepartmentPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastSubdepartmentCriteria = $criteria;
     return $this->collSubdepartments;
 }