public function getPublicInformationCategory($con = null) { include_once 'lib/model/om/BasePublicInformationCategoryPeer.php'; if ($this->aPublicInformationCategory === null && $this->public_information_category_id !== null) { $this->aPublicInformationCategory = PublicInformationCategoryPeer::retrieveByPK($this->public_information_category_id, $con); } return $this->aPublicInformationCategory; }
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(PublicInformationCategoryPeer::ID, $pks, Criteria::IN); $objs = PublicInformationCategoryPeer::doSelect($criteria, $con); } return $objs; }
public static function doSelectJoinAllExceptDepartment(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } PublicInformationPeer::addSelectColumns($c); $startcol2 = PublicInformationPeer::NUM_COLUMNS - PublicInformationPeer::NUM_LAZY_LOAD_COLUMNS + 1; ClassGroupPeer::addSelectColumns($c); $startcol3 = $startcol2 + ClassGroupPeer::NUM_COLUMNS; PublicInformationCategoryPeer::addSelectColumns($c); $startcol4 = $startcol3 + PublicInformationCategoryPeer::NUM_COLUMNS; $c->addJoin(PublicInformationPeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $c->addJoin(PublicInformationPeer::PUBLIC_INFORMATION_CATEGORY_ID, PublicInformationCategoryPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = PublicInformationPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = ClassGroupPeer::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->getClassGroup(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addPublicInformation($obj1); break; } } if ($newObject) { $obj2->initPublicInformations(); $obj2->addPublicInformation($obj1); } $omClass = PublicInformationCategoryPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getPublicInformationCategory(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addPublicInformation($obj1); break; } } if ($newObject) { $obj3->initPublicInformations(); $obj3->addPublicInformation($obj1); } $results[] = $obj1; } return $results; }
public function executeDelete() { $public_information_category = PublicInformationCategoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($public_information_category); $ref_error = 0; foreach ($public_information_category->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $public_information_category->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('public_information_category/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('public_information_category/delete', '_ERR_DELETE_ (' . $public_information_category->toString() . ' - id:' . $public_information_category->getId() . ')'); } else { $public_information_category->delete(); } return $this->forward('public_information_category', 'list'); }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = PublicInformationCategoryPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setCode($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setName($arr[$keys[2]]); } }