當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。