public function executeIndex() { $c = new Criteria(); $c->add(PublicInformationPeer::ID, 134); $public_information = PublicInformationPeer::doSelectOne($c); $this->public_information = $public_information; }
public function executeListStatus() { $c = new Criteria(); $c->add(JobPeer::CODE, 'pmb_menu/listStatus'); $job = JobPeer::doSelectOne($c); $cw = new Criteria(); $cw->add(JobInformationPeer::JOB_ID, $job->getId()); $job_information = JobInformationPeer::doSelectOne($cw); $public_information = PublicInformationPeer::retrieveByPk($job_information->getPublicInformationId()); $job_category = JobCategoryPeer::retrieveByPk($job_information->getJobCategoryId()); $this->job = $job; $this->job_information = $job_information; $this->job_category = $job_category; $this->public_information = $public_information; }
public function filter($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'PUBLIC_INFORMATION_ID') { $c->addJoin(JobInformationPeer::JOB_ID, JobPeer::ID); $c->addJoin(PublicInformationPeer::ID, JobInformationPeer::PUBLIC_INFORMATION_ID); $column = PublicInformationPeer::getTableMap()->getColumn('ID'); } elseif ($key == 'JOB_CATEGORY_ID') { $c->addJoin(JobInformationPeer::JOB_ID, JobPeer::ID); $c->addJoin(JobCategoryPeer::ID, JobInformationPeer::JOB_CATEGORY_ID); $column = JobCategoryPeer::getTableMap()->getColumn('ID'); } else { $column = JobPeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::INTEGER) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } else { if ($creoleType == CreoleTypes::CHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } } }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = PublicInformationPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setClassGroupId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setPublicInformationCategoryId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setPublished($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setToward($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setDetail($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setStart($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setSubject($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setDepartmentId($arr[$keys[8]]); } }
public function executeLogout() { $c = new Criteria(); $c->add(PublicInformationPeer::ID, 134); $public_information = PublicInformationPeer::doSelectOne($c); $this->public_information = $public_information; $this->getContext()->getUser()->signOut(); #if ($this->hasRequestParameter('exec') && $this->getRequestParameter('exec') == 'logout') { # $this->getContext()->getUser()->signOut(); # $this->redirect('default/index'); #} elseif ($this->getUser()->isAuthenticated2('bo')) { # $this->redirect('auth/index'); #} }
public function executeShowInfo() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'sm_content/listInfo'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $public_information = PublicInformationPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($public_information); $this->subtitle = $public_information->toString() . ' - id:' . $public_information->getId(); $actions = array(array('name' => 'back', 'url' => 'sm_content/listInfo', 'color' => 'black')); $this->actions = $actions; $this->public_information = $public_information; }
public static function doSelectJoinAllExceptJobCategory(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } JobInformationPeer::addSelectColumns($c); $startcol2 = JobInformationPeer::NUM_COLUMNS - JobInformationPeer::NUM_LAZY_LOAD_COLUMNS + 1; JobPeer::addSelectColumns($c); $startcol3 = $startcol2 + JobPeer::NUM_COLUMNS; PublicInformationPeer::addSelectColumns($c); $startcol4 = $startcol3 + PublicInformationPeer::NUM_COLUMNS; $c->addJoin(JobInformationPeer::JOB_ID, JobPeer::ID); $c->addJoin(JobInformationPeer::PUBLIC_INFORMATION_ID, PublicInformationPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = JobInformationPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = JobPeer::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->getJob(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addJobInformation($obj1); break; } } if ($newObject) { $obj2->initJobInformations(); $obj2->addJobInformation($obj1); } $omClass = PublicInformationPeer::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->getPublicInformation(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addJobInformation($obj1); break; } } if ($newObject) { $obj3->initJobInformations(); $obj3->addJobInformation($obj1); } $results[] = $obj1; } return $results; }
echo UserGroupPeer::retrieveByPK($this->getContext()->getUser()->getAttribute('group_id', '', 'bo'))->getName(); ?> </h3> <h2 class="titlesubmenu">Tingkat</h2> <h3 class="titletext"><?php echo DepartmentPeer::retrieveByPK($this->getContext()->getUser()->getAttribute('department_id', '', 'bo'))->getName(); ?> </h3> </div> </div> <?php $c = new Criteria(); $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $c->add(PublicInformationPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN); $c->add(PublicInformationPeer::PUBLISHED, 1, Criteria::IN); $information = PublicInformationPeer::doSelect($c); ?> <div class="home_news"> <h1 class="titlecontent"><?php echo __('PublicInformation'); ?> </h1> <?php if ($this->getContext()->getUser()->getAttribute('group', null, 'bo') == 'root') { $microtime = microtime(); list($msec, $sec) = explode(chr(3), $microtime); $conf = 0; //menampilkan speed load echo 'Speed : ' . round($sec + $msec - $conf['headtime'], 3) . ' / sec'; $time_start = microtime(true); }
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(PublicInformationPeer::ID, $pks, Criteria::IN); $objs = PublicInformationPeer::doSelect($criteria, $con); } return $objs; }
public function getPublicInformation($con = null) { include_once 'lib/model/om/BasePublicInformationPeer.php'; if ($this->aPublicInformation === null && $this->public_information_id !== null) { $this->aPublicInformation = PublicInformationPeer::retrieveByPK($this->public_information_id, $con); } return $this->aPublicInformation; }
public function executeDeleteArticle() { $public_information = PublicInformationPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($public_information); $ref_error = 0; foreach ($public_information->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $public_information->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('public_information/deleteArticle/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('public_information/deleteArticle', '_ERR_DELETE_ (' . $public_information->toString() . ' - id:' . $public_information->getId() . ')'); } else { $public_information->delete(); } return $this->forward('public_information', 'listArticle'); }
public function getPublicInformationsJoinDepartment($criteria = null, $con = null) { include_once 'lib/model/om/BasePublicInformationPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collPublicInformations === null) { if ($this->isNew()) { $this->collPublicInformations = array(); } else { $criteria->add(PublicInformationPeer::PUBLIC_INFORMATION_CATEGORY_ID, $this->getId()); $this->collPublicInformations = PublicInformationPeer::doSelectJoinDepartment($criteria, $con); } } else { $criteria->add(PublicInformationPeer::PUBLIC_INFORMATION_CATEGORY_ID, $this->getId()); if (!isset($this->lastPublicInformationCriteria) || !$this->lastPublicInformationCriteria->equals($criteria)) { $this->collPublicInformations = PublicInformationPeer::doSelectJoinDepartment($criteria, $con); } } $this->lastPublicInformationCriteria = $criteria; return $this->collPublicInformations; }