本文整理汇总了PHP中DepartmentPeer::doSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP DepartmentPeer::doSelect方法的具体用法?PHP DepartmentPeer::doSelect怎么用?PHP DepartmentPeer::doSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DepartmentPeer
的用法示例。
在下文中一共展示了DepartmentPeer::doSelect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: select_tag_departments
function select_tag_departments($name = 'departments', $selected = 2, $options = array())
{
$c = new Criteria();
$c->addAscendingOrderByColumn(DepartmentPeer::NAME);
$departments = DepartmentPeer::doSelect($c);
return select_tag($name, objects_for_select($departments, 'getUuid', 'getName', $selected, array()), $options);
}
示例2: executeList
public function executeList()
{
$c = new Criteria();
$c->add(DepartmentPeer::STATUS, Constant::RECORD_STATUS_DELETED, Criteria::NOT_EQUAL);
$c->addAscendingOrderByColumn(DepartmentPeer::TITLE);
$this->departments = DepartmentPeer::doSelect($c);
}
示例3: departmentAvailable
public function departmentAvailable($id)
{
$return = array();
$current = DepartmentPeer::retrieveByPK($id);
if ($current) {
$return[] = $id;
} else {
return null;
}
$childCriteria = new Criteria();
$childCriteria->add(DepartmentPeer::PARENT, $id, Criteria::EQUAL);
$child = DepartmentPeer::doSelect($childCriteria);
if (!$child) {
return $return;
}
$childArray = array();
foreach ($child as $c) {
$return[] = $c->getId();
$childArray[] = $c->getId();
}
$moreChildCriteria = new Criteria();
$moreChildCriteria->add(DepartmentPeer::PARENT, $childArray, Criteria::IN);
$moreChild = DepartmentPeer::doSelect($moreChildCriteria);
if (!$moreChild) {
return $return;
}
foreach ($moreChild as $c) {
$return[] = $c->getId();
}
return $return;
//$moreChildCriteria = new Criteria()
}
示例4: doSelectByStudent
public static function doSelectByStudent(Criteria $criteria, $con = null)
{
$usertype = sfContext::getInstance()->getUser()->getAttribute('usertype', 'common', 'bo');
$student = null;
$student_id = null;
if ($usertype == 'student') {
$student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$student = StudentPeer::retrieveByPK($student_id);
}
if ($student == null) {
$student_id = sfContext::getInstance()->getRequest()->getParameter('student_id');
$student = StudentPeer::retrieveByPK($student_id);
}
$criteria->add(StudentPeer::CURRICULUM_ID, $student->getCurriculumId());
$criteria->addJoin(StudentPeer::CURRICULUM_ID, CurriculumPeer::ID);
$criteria->addJoin(CurriculumPeer::DEPARTMENT_ID, DepartmentPeer::ID);
$tmp_depts = DepartmentPeer::doSelect($criteria);
$depts = array();
foreach ($tmp_depts as $key => $val) {
$pi = $val->getParentalIndex();
$prefix = '';
for ($i = 0; $i < $val->level - 1; $i++) {
$prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
}
$val->setdescription($prefix . $val->getDescription());
$val->setCode($prefix . $val->getCode());
$depts[$pi] = $val;
}
ksort($depts);
$result = array();
foreach ($depts as $r) {
$result[] = $r;
}
return $result;
}
示例5: GetDepartment
public static function GetDepartment()
{
$c = new Criteria();
$c->add(DepartmentPeer::STATUS, Constant::RECORD_STATUS_ACTIVE);
$departments = DepartmentPeer::doSelect($c);
return $departments;
}
示例6: executeIndex
/**
* Executes index action
*
*/
public function executeIndex()
{
if ($this->getUser()->isAuthenticated()) {
$this->redirect('@show_user_personal');
return sfView::SUCCESS;
}
$this->departments = DepartmentPeer::doSelect(new Criteria());
//$this->forward('default', 'module');
}
示例7: smsAvailable
public function smsAvailable($departmentId)
{
return true;
$departmentAvailable = array('TK');
$dc = new Criteria();
$dc->add(DepartmentPeer::CODE, $departmentAvailable, Criteria::IN);
$dc->add(DepartmentPeer::ID, $departmentId, Criteria::EQUAL);
$department = DepartmentPeer::doSelect($dc);
if ($department) {
return true;
} else {
return false;
}
}
示例8: getlist
public function getlist($param)
{
$department_id = $param['department_id'];
$departmentAvailable = $this->tools->departmentAvailable($department_id);
$this->criteria->add(DepartmentPeer::ID, $departmentAvailable, Criteria::IN);
$this->criteria->addAscendingOrderByColumn(DepartmentPeer::NAME);
$sectionTemp = DepartmentPeer::doSelect($this->criteria);
$sections = array();
foreach ($sectionTemp as $section) {
$sections[] = $section->toArray();
}
$output = array('success' => 1, 'data' => $sections);
$this->jsonwrapper->print_json($output);
}
示例9: executeEnquiry
public function executeEnquiry()
{
$this->getEnquirer();
$this->getLayoutParam();
$this->step = 'enquiry';
/* Get Department */
$c = new Criteria();
$c->addAscendingOrderByColumn(DepartmentPeer::ID);
//$c->addAscendingOrderByColumn(DepartmentPeer::ID);
$department = DepartmentPeer::doSelect($c);
$this->departments = array();
foreach ($department as $d) {
if (!array_key_exists($d->getParent(), $this->departments)) {
$this->departments[$d->getParent()] = array();
}
$this->departments[$d->getParent()][] = $d->toArray();
}
$this->departments = $this->jsonwrapper->json_encode($this->departments);
}
示例10: getDepartments
public function getDepartments($DepParent)
{
try {
$result = array();
$criteria = new Criteria('workflow');
$criteria->add(DepartmentPeer::DEP_PARENT, $DepParent, Criteria::EQUAL);
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
$objects = DepartmentPeer::doSelect($criteria, $con);
$oUsers = new Users();
foreach ($objects as $oDepartment) {
$node = array();
$node['DEP_UID'] = $oDepartment->getDepUid();
$node['DEP_PARENT'] = $oDepartment->getDepParent();
$node['DEP_TITLE'] = $oDepartment->getDepTitle();
$node['DEP_STATUS'] = $oDepartment->getDepStatus();
$node['DEP_MANAGER'] = $oDepartment->getDepManager();
$node['DEP_LDAP_DN'] = $oDepartment->getDepLdapDn();
$node['DEP_LAST'] = 0;
$manager = $oDepartment->getDepManager();
if ($manager != '') {
$UserUID = $oUsers->load($manager);
$node['DEP_MANAGER_USERNAME'] = isset($UserUID['USR_USERNAME']) ? $UserUID['USR_USERNAME'] : '';
$node['DEP_MANAGER_FIRSTNAME'] = isset($UserUID['USR_FIRSTNAME']) ? $UserUID['USR_FIRSTNAME'] : '';
$node['DEP_MANAGER_LASTNAME'] = isset($UserUID['USR_LASTNAME']) ? $UserUID['USR_LASTNAME'] : '';
} else {
$node['DEP_MANAGER_USERNAME'] = '';
$node['DEP_MANAGER_FIRSTNAME'] = '';
$node['DEP_MANAGER_LASTNAME'] = '';
}
$criteria = new \Criteria();
$criteria->add(UsersPeer::DEP_UID, $node['DEP_UID'], \Criteria::EQUAL);
$node['DEP_MEMBERS'] = UsersPeer::doCount($criteria);
$criteriaCount = new Criteria('workflow');
$criteriaCount->clearSelectColumns();
$criteriaCount->addSelectColumn('COUNT(*)');
$criteriaCount->add(DepartmentPeer::DEP_PARENT, $oDepartment->getDepUid(), Criteria::EQUAL);
$rs = DepartmentPeer::doSelectRS($criteriaCount);
$rs->next();
$row = $rs->getRow();
$node['HAS_CHILDREN'] = $row[0];
$result[] = $node;
}
if (count($result) >= 1) {
$result[count($result) - 1]['DEP_LAST'] = 1;
}
return $result;
} catch (exception $e) {
throw $e;
}
}
示例11: handleErrorUpdateProfile
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;
}
示例12: getAll
public static function getAll(PropelPDO $propelConnection)
{
$c = new Criteria();
$c->addAscendingOrderByColumn(DepartmentPeer::ID);
return DepartmentPeer::doSelect($c, $propelConnection);
}
示例13: handleErrorSaveNew
public function handleErrorSaveNew()
{
//$this->project = ProjectPeer::retrieveBySlug($this->getRequestParameter('project'));
//$this->forward404Unless($this->project, 'Project not found using slug ['.$this->getRequestParameter('project').']');
$this->project = new Project();
$this->campuses = CampusPeer::doSelect(new Criteria());
$this->departments = DepartmentPeer::doSelect(new Criteria());
$this->setTemplate('create');
return sfView::SUCCESS;
}
示例14: executeListFilter
public function executeListFilter()
{
$this->campuses = CampusPeer::doSelect(new Criteria());
$this->departments = DepartmentPeer::doSelect(new Criteria());
}
示例15: getDepartmentsRelatedByParent
public function getDepartmentsRelatedByParent($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseDepartmentPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
} elseif ($criteria instanceof Criteria) {
$criteria = clone $criteria;
}
if ($this->collDepartmentsRelatedByParent === null) {
if ($this->isNew()) {
$this->collDepartmentsRelatedByParent = array();
} else {
$criteria->add(DepartmentPeer::PARENT, $this->getId());
DepartmentPeer::addSelectColumns($criteria);
$this->collDepartmentsRelatedByParent = DepartmentPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(DepartmentPeer::PARENT, $this->getId());
DepartmentPeer::addSelectColumns($criteria);
if (!isset($this->lastDepartmentRelatedByParentCriteria) || !$this->lastDepartmentRelatedByParentCriteria->equals($criteria)) {
$this->collDepartmentsRelatedByParent = DepartmentPeer::doSelect($criteria, $con);
}
}
}
$this->lastDepartmentRelatedByParentCriteria = $criteria;
return $this->collDepartmentsRelatedByParent;
}