public function getCoForm($con = null)
 {
     if ($this->aCoForm === null && $this->form_id !== null) {
         include_once 'lib/model/om/BaseCoFormPeer.php';
         $this->aCoForm = CoFormPeer::retrieveByPK($this->form_id, $con);
     }
     return $this->aCoForm;
 }
Beispiel #2
0
 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(CoFormPeer::ID, $pks, Criteria::IN);
         $objs = CoFormPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
 public static function doSelectJoinAllExceptProjectPosition(Criteria $c, $con = null)
 {
     foreach (sfMixer::getCallables('BaseCoFormApplicationPeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable) {
         call_user_func($callable, 'BaseCoFormApplicationPeer', $c, $con);
     }
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     CoFormApplicationPeer::addSelectColumns($c);
     $startcol2 = CoFormApplicationPeer::NUM_COLUMNS - CoFormApplicationPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     CoFormPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + CoFormPeer::NUM_COLUMNS;
     $c->addJoin(CoFormApplicationPeer::FORM_ID, CoFormPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = CoFormApplicationPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = CoFormPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getCoForm();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addCoFormApplication($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initCoFormApplications();
             $obj2->addCoFormApplication($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Beispiel #4
0
 public function countCoForms($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseCoFormPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(CoFormPeer::OWNER_ID, $this->getId());
     return CoFormPeer::doCount($criteria, $distinct, $con);
 }
Beispiel #5
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = CoFormPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setUuid($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setOwnerId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setName($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setSlug($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setDescription($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setStatus($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setType($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setCreatedAt($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setDeletedAt($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setUpdatedAt($arr[$keys[10]]);
     }
 }