当前位置: 首页>>代码示例>>PHP>>正文


PHP PersonPeer::doSelectOrderedCriteria方法代码示例

本文整理汇总了PHP中PersonPeer::doSelectOrderedCriteria方法的典型用法代码示例。如果您正苦于以下问题:PHP PersonPeer::doSelectOrderedCriteria方法的具体用法?PHP PersonPeer::doSelectOrderedCriteria怎么用?PHP PersonPeer::doSelectOrderedCriteria使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PersonPeer的用法示例。


在下文中一共展示了PersonPeer::doSelectOrderedCriteria方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doSelectActive

 /**
  * Retrieves an array of active Personal and ordered by Lastname.
  * @param Criteria $criteria
  * @param PropelPDO $con
  * @return <array>  Personal[]
  */
 public static function doSelectActive(Criteria $criteria, PropelPDO $con = null)
 {
     $criteria = PersonPeer::doSelectOrderedCriteria($criteria, $con);
     $criteria->add(PersonPeer::IS_ACTIVE, true);
     $criteria->addJoin(PersonPeer::ID, self::PERSON_ID);
     return self::doSelect($criteria, $con);
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:13,代码来源:TeacherPeer.php

示例2: configureWidgets

 public function configureWidgets()
 {
     $this->setWidget('student_id', new sfWidgetFormInputHidden());
     $this->setWidget('school_year_id', new sfWidgetFormInputHidden());
     $this->setWidget('request_date', new csWidgetFormDateInput());
     $this->setWidget('resolution_date', new csWidgetFormDateInput());
     $this->getWidget('disciplinary_sanction_type_id')->setOption('add_empty', true);
     $this->getWidget('sanction_type_id')->setOption('add_empty', true);
     $applicants_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($applicants_criteria);
     $results = array();
     foreach (PersonalPeer::doSelect(new Criteria()) as $personal) {
         $results[$personal->getPersonId()] = $personal->getPersonId();
     }
     foreach (TeacherPeer::doSelect(new Criteria()) as $teacher) {
         $results[$teacher->getPersonId()] = $teacher->getPersonId();
     }
     $applicants_criteria->add(PersonPeer::ID, $results, Criteria::IN);
     $this->getWidget('applicant_id')->setOption('criteria', $applicants_criteria);
     $preceptors_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($preceptors_criteria);
     $preceptors_criteria->addJoin(PersonPeer::ID, PersonalPeer::PERSON_ID);
     $this->getWidget('responsible_id')->setOption('criteria', $preceptors_criteria);
     $this->setWidget('document', new sfWidgetFormInputFile());
     if ($this->getObject()->getDocument()) {
         $this->setWidget('current_document', new mtWidgetFormPartial(array('module' => 'student_disciplinary_sanction', 'partial' => 'downloable_document', 'form' => $this)));
         $this->setWidget('delete_document', new sfWidgetFormInputCheckbox());
         $this->getWidgetSchema()->moveField('delete_document', sfWidgetFormSchema::BEFORE, 'document');
         $this->getWidgetSchema()->moveField('current_document', sfWidgetFormSchema::BEFORE, 'delete_document');
     }
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:31,代码来源:CnbaStudentDisciplinarySanctionForm.class.php

示例3: configure

 public function configure()
 {
     $this->setWidget('student_id', new sfWidgetFormInputHidden());
     $this->setWidget('school_year_id', new sfWidgetFormInputHidden());
     unset($this['resolution_date']);
     $this->setWidget('request_date', new csWidgetFormDateInput());
     $this->setValidator('request_date', new mtValidatorDateString());
     $this->getWidgetSchema()->setLabel('request_date', 'Day');
     $this->getWidgetSchema()->setHelp('value', 'This field represents the value of the disciplinary sanction');
     $this->setValidator('value', new sfValidatorNumber(array('required' => true)));
     $this->getWidget('disciplinary_sanction_type_id')->setOption('add_empty', true);
     $this->getWidget('sanction_type_id')->setOption('add_empty', true);
     $applicants_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($applicants_criteria);
     $results = array();
     foreach (PersonalPeer::doSelect(new Criteria()) as $personal) {
         $results[$personal->getPersonId()] = $personal->getPersonId();
     }
     foreach (TeacherPeer::doSelect(new Criteria()) as $teacher) {
         $results[$teacher->getPersonId()] = $teacher->getPersonId();
     }
     $applicants_criteria->add(PersonPeer::ID, $results, Criteria::IN);
     $this->getWidget('applicant_id')->setOption('criteria', $applicants_criteria);
     $preceptors_criteria = new Criteria();
     PersonPeer::doSelectOrderedCriteria($preceptors_criteria);
     $preceptors_criteria->addJoin(PersonPeer::ID, PersonalPeer::PERSON_ID);
     $this->getWidget('responsible_id')->setOption('criteria', $preceptors_criteria);
     $this->setWidget('document', new sfWidgetFormInputFile());
     $this->setValidator('document', new sfValidatorFile(array('path' => StudentDisciplinarySanction::getDocumentDirectory(), 'max_size' => '2097152', 'required' => false)));
     $this->getWidgetSchema()->setHelp('document', 'The file must be of the following types: jpeg, jpg, gif, png, pdf.');
     $this->getValidator('document')->setOption('mime_categories', array('web_images' => array('image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/gif'), 'documents' => array('application/pdf')));
     $this->getWidgetSchema()->moveField('observation', sfWidgetFormSchema::LAST);
     $this->getWidgetSchema()->moveField('document', sfWidgetFormSchema::AFTER, 'responsible_id');
     if ($this->getObject()->getDocument()) {
         $this->setWidget('current_document', new mtWidgetFormPartial(array('module' => 'student_disciplinary_sanction', 'partial' => 'downloable_document', 'form' => $this)));
         $this->setValidator('current_document', new sfValidatorPass(array('required' => false)));
         $this->setWidget('delete_document', new sfWidgetFormInputCheckbox());
         $this->setValidator('delete_document', new sfValidatorBoolean(array('required' => false)));
         $this->getWidgetSchema()->moveField('delete_document', sfWidgetFormSchema::BEFORE, 'document');
         $this->getWidgetSchema()->moveField('current_document', sfWidgetFormSchema::BEFORE, 'delete_document');
     }
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:42,代码来源:StudentDisciplinarySanctionForm.class.php

示例4: doSelectActivePreceptor

 public static function doSelectActivePreceptor(Criteria $criteria = null)
 {
     $criteria = is_null($criteria) ? new Criteria() : $criteria;
     $criteria->add(PersonalPeer::PERSONAL_TYPE, PersonalType::PRECEPTOR);
     PersonPeer::doSelectOrderedCriteria($criteria);
     $criteria->add(PersonPeer::IS_ACTIVE, true);
     $criteria->addJoin(PersonPeer::ID, self::PERSON_ID);
     $sf_user = sfContext::getInstance()->getUser();
     if ($sf_user->isHeadPreceptor()) {
         $personal_in = $sf_user->getPersonalIds();
         $criteria->add(self::ID, $personal_in, Criteria::IN);
     }
     return self::doSelect($criteria);
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:14,代码来源:PersonalPeer.php


注:本文中的PersonPeer::doSelectOrderedCriteria方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。