本文整理汇总了PHP中DepartmentPeer::doSelectOne方法的典型用法代码示例。如果您正苦于以下问题:PHP DepartmentPeer::doSelectOne方法的具体用法?PHP DepartmentPeer::doSelectOne怎么用?PHP DepartmentPeer::doSelectOne使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DepartmentPeer
的用法示例。
在下文中一共展示了DepartmentPeer::doSelectOne方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSelectByRegPeriod
public static function doSelectByRegPeriod(Criteria $c = null, $rpi = null)
{
$tsi = null;
if ($rpi == null) {
$tsi = sfContext::getInstance()->getRequest()->getParameter('id');
}
if ($rpi == null && $tsi == null) {
return array();
}
$ids = '';
if ($rpi != null) {
$c = new Criteria();
$c->addJoin(RegPeriodPeer::CURRICULUM_ID, CurriculumPeer::ID);
$c->addJoin(CurriculumPeer::DEPARTMENT_ID, DepartmentPeer::ID);
$c->add(RegPeriodPeer::ID, $rpi);
$dept = DepartmentPeer::doSelectOne($c);
$ids = $dept->getIdRecurs();
}
if ($tsi != null) {
$c = new Criteria();
$c->addJoin(RegPeriodPeer::CURRICULUM_ID, CurriculumPeer::ID);
$c->addJoin(CurriculumPeer::DEPARTMENT_ID, DepartmentPeer::ID);
$c->addJoin(TestSchedulePeer::REG_TEST_PERIOD_ID, RegTestPeriodPeer::ID);
$c->add(TestSchedulePeer::ID, $tsi);
$dept = DepartmentPeer::doSelectOne($c);
$ids = $dept->getIdRecurs();
}
$sql = "select * from test_subject where department_id in ({$ids})";
$connection = Propel::getConnection();
$statement = $connection->createStatement();
$result = $statement->executeQuery($sql, ResultSet::FETCHMODE_NUM);
$objs = TestSubjectPeer::populateObjects($result);
return $objs;
}
示例2: getDepartment
/**
* Get the associated Department object
*
* @param PropelPDO Optional Connection object.
* @return Department The associated Department object.
* @throws PropelException
*/
public function getDepartment(PropelPDO $con = null)
{
if ($this->aDepartment === null && $this->department_id !== null) {
$c = new Criteria(DepartmentPeer::DATABASE_NAME);
$c->add(DepartmentPeer::ID, $this->department_id);
$this->aDepartment = DepartmentPeer::doSelectOne($c, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aDepartment->addEmployees($this);
*/
}
return $this->aDepartment;
}
示例3: Criteria
p.subheader { font-size: 10px; }
table.list_content { border-collapse: collapse; width: auto; margin: auto; margin-top: 20px; }
table.list_content td, table.list_content th { border: 1px solid black; padding: 2px 4px; vertical-align: top; }
.list_content th { font-style: italic; background-color: #F7E859; text-align: left; }
.even td { background-color: #F4F4F2; }
center.title { font-weight: bold; font-size: 14px; }
center.subtitle { font-weight: bold; font-size: 10px; margin-bottom: 0px; }
.pager_top { width: 100%; text-align: left; }
.pager_record, .pager_page { display: none; }
td.list { text-align: center; }
</style>
<?php
$c = new Criteria();
$c->add(DepartmentPeer::PARENT, 0, Criteria::EQUAL);
$dept = DepartmentPeer::doSelectOne($c);
$c = new Criteria();
$c->add(DepartmentDetailPeer::DEPARTMENT_ID, $dept->getId());
$department_detail = DepartmentDetailPeer::doSelectOne($c);
?>
<?php
if (isset($note)) {
?>
<table width="100%">
<tr>
<td width="50%" style="text-align: left; vertical-align: middle;">
<img src='<?php
echo image_path('logoBig_00.jpg', true);
?>