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


PHP EmployeePeer::doSelect方法代码示例

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


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

示例1: doSelectOrdered

 public static function doSelectOrdered()
 {
     $criteria = new Criteria();
     $criteria->addAscendingOrderByColumn(EmployeePeer::EMP_NO);
     $criteria->addAscendingOrderByColumn(EmployeePeer::NAME);
     return EmployeePeer::doSelect($criteria);
 }
开发者ID:taryono,项目名称:school,代码行数:7,代码来源:EmployeePeer.php

示例2: executeList

 public function executeList(sfWebRequest $request)
 {
     $c = new Criteria();
     $c->add(EmployeePeer::STATUS, Constant::RECORD_STATUS_DELETED, Criteria::NOT_EQUAL);
     $c->add(EmployeePeer::ROLE_ID, 1, Criteria::NOT_EQUAL);
     $c->addAscendingOrderByColumn(EmployeePeer::DEPARTMENT_ID);
     $this->employees = EmployeePeer::doSelect($c);
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:8,代码来源:actions.class.php

示例3: GetStaff

 public static function GetStaff()
 {
     $c = new Criteria();
     $c->add(EmployeePeer::STATUS, Constant::RECORD_STATUS_ACTIVE);
     $c->add(EmployeePeer::EMP_CATEGORY, 'staff');
     $employees = EmployeePeer::doSelect($c);
     if ($employees) {
         return $employees;
     } else {
         return false;
     }
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:12,代码来源:EmployeePeer.php

示例4: executeEmployeeExpiration

 public function executeEmployeeExpiration(sfWebRequest $request)
 {
     $this->form = new ReportExpirationForm();
     if ($request->isMethod('post')) {
         $this->form->bind($request->getParameter($this->form->getName()), $request->getFiles($this->form->getName()));
         if ($this->form->isValid()) {
             $date = $this->form->getValue('date');
             $date = mktime(0, 0, 0, $date['month'], $date['day'], $date['year']);
             $this->columns = $this->form->getValue('columns') ? $this->form->getValue('columns') : array();
             $c = new Criteria();
             $cton = $c->getNewCriterion(EmployeePeer::ID, null, Criteria::ISNULL);
             foreach ($this->columns as $column) {
                 $ex = $c->getNewCriterion('employee.' . $column, $date, Criteria::LESS_EQUAL);
                 $cton->addOr($ex);
             }
             $c->add($cton);
             $c->addAscendingOrderByColumn(EmployeePeer::LAST_NAME);
             $this->employees = EmployeePeer::doSelect($c);
             $this->date = $date;
             $this->setTemplate('employeeExpirationReport');
         }
     }
 }
开发者ID:anvaya,项目名称:nckids,代码行数:23,代码来源:actions.class.php

示例5: executeGetCounselorByAccal

 public function executeGetCounselorByAccal()
 {
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($accal);
     $c = new Criteria();
     $c->add(EmployeePeer::DEPARTMENT_ID, $accal->getDepartment()->getIdRecursArray(), Criteria::IN);
     $c->add(EmployeePeer::IS_COUNSELOR, 1);
     $objs = EmployeePeer::doSelect($c);
     $counselors = array();
     foreach ($objs as $o) {
         $counselors[$o->getId()] = $o->toString();
     }
     $this->content = $counselors;
     $this->setTemplate('buildOptions');
 }
开发者ID:taryono,项目名称:school,代码行数:16,代码来源:actions.class.php

示例6: getEmployees

 public function getEmployees($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseEmployeePeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collEmployees === null) {
         if ($this->isNew()) {
             $this->collEmployees = array();
         } else {
             $criteria->add(EmployeePeer::DEPARTMENT_ID, $this->getId());
             EmployeePeer::addSelectColumns($criteria);
             $this->collEmployees = EmployeePeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(EmployeePeer::DEPARTMENT_ID, $this->getId());
             EmployeePeer::addSelectColumns($criteria);
             if (!isset($this->lastEmployeeCriteria) || !$this->lastEmployeeCriteria->equals($criteria)) {
                 $this->collEmployees = EmployeePeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastEmployeeCriteria = $criteria;
     return $this->collEmployees;
 }
开发者ID:taryono,项目名称:school,代码行数:28,代码来源:BaseDepartment.php

示例7: executeListEmployee

 public function executeListEmployee()
 {
     $course_id = $this->getRequestParameter('course_id');
     $c = new Criteria();
     $c->add(CourseScheduleTutorPeer::COURSE_SCHEDULE_ID, $course_id);
     $c->addJoin(CourseScheduleTutorPeer::EMPLOYEE_ID, TeachingCompetencyPeer::EMPLOYEE_ID);
     $c->addJoin(TeachingCompetencyPeer::EMPLOYEE_ID, EmployeePeer::ID);
     $objs = EmployeePeer::doSelect($c);
     $employee_ids = array();
     foreach ($objs as $o) {
         $employee_ids[] = $o->getId();
     }
     $subject_id = $this->getRequestParameter('subject_id');
     $c = new Criteria();
     $c->add(TeachingCompetencyPeer::SUBJECT_ID, $subject_id, Criteria::IN);
     $c->add(TeachingCompetencyPeer::EMPLOYEE_ID, $employee_ids, Criteria::NOT_IN);
     $c->addJoin(TeachingCompetencyPeer::EMPLOYEE_ID, EmployeePeer::ID);
     $c->addAscendingOrderByColumn(EmployeePeer::NAME);
     $this->sort($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'employee'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'employee');
     $pager = new sfPropelPager('Employee', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'employee'));
     $this->getUser()->setAttribute('page', $page, 'employee');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions2 = $actions2;
     $this->subject_id = $subject_id;
     $this->course_id = $course_id;
 }
开发者ID:taryono,项目名称:school,代码行数:58,代码来源:actions.class.php

示例8: executeGetList

 public function executeGetList()
 {
     if ($this->hasRequestParameter('employee_name') && $this->getRequestParameter('employee_name') != '') {
         $name = $this->getRequestParameter('employee_name');
         $c = new Criteria();
         $c->add(EmployeePeer::NAME, "%{$name}%", Criteria::LIKE);
         $this->rows = EmployeePeer::doSelect($c);
     }
 }
开发者ID:taryono,项目名称:school,代码行数:9,代码来源:actions.class.php

示例9: getEmployees

 /**
  * Gets an array of Employee objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this Role has previously been saved, it will retrieve
  * related Employees from storage. If this Role is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array Employee[]
  * @throws     PropelException
  */
 public function getEmployees($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(RolePeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collEmployees === null) {
         if ($this->isNew()) {
             $this->collEmployees = array();
         } else {
             $criteria->add(EmployeePeer::ROLE_ID, $this->id);
             EmployeePeer::addSelectColumns($criteria);
             $this->collEmployees = EmployeePeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(EmployeePeer::ROLE_ID, $this->id);
             EmployeePeer::addSelectColumns($criteria);
             if (!isset($this->lastEmployeeCriteria) || !$this->lastEmployeeCriteria->equals($criteria)) {
                 $this->collEmployees = EmployeePeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastEmployeeCriteria = $criteria;
     return $this->collEmployees;
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:44,代码来源:BaseRole.php

示例10: UpdateCompanyGrades

 public static function UpdateCompanyGrades($company_id)
 {
     $c = new Criteria();
     $c->add(EmployeePeer::COMPANY_ID, $company_id);
     $employees = EmployeePeer::doSelect($c);
     foreach ($employees as $employee) {
         //calculate the employee grade
         /*$c = new Criteria();
         			$c->add(EmployeeGradePeer::COMPANY_ID,$company_id);
         			$c->add(EmployeeGradePeer::STATUS,Constant::RECORD_STATUS_ACTIVE);
         			$c->add(EmployeeGradePeer::MIN_VALUE, round ($employee->getRating(),Constant::ROUND_RATING),Criteria::LESS_EQUAL);
         			$c->add(EmployeeGradePeer::MAX_VALUE, round ($employee->getRating(),Constant::ROUND_RATING),Criteria::GREATER_EQUAL);
         			$grade = EmployeeGradePeer::doSelectOne($c);
         
         			
         			
         			if($grade)
         			$grade_id = $grade->getId();
         			else 
         			$grade_id = NULL;
         			*/
         $connection = Propel::getConnection();
         $rating = round($employee->getRating(), Constant::ROUND_RATING);
         $query = 'SELECT * FROM %s where company_id = %s and status = %s and ' . $rating . ' >= %s and ' . $rating . ' <= %s';
         $query = sprintf($query, EmployeeGradePeer::TABLE_NAME, $employee->getCompanyId(), Constant::RECORD_STATUS_ACTIVE, EmployeeGradePeer::MIN_VALUE, EmployeeGradePeer::MAX_VALUE);
         $statement = $connection->prepare($query);
         $statement->execute();
         $grade = $statement->fetch(PDO::FETCH_OBJ);
         if ($grade) {
             $grade_id = $grade->id;
         } else {
             $grade_id = NULL;
         }
         //now save employee object wicth calculated grade and rating
         $employee->setGradeId($grade_id);
         $employee->save();
     }
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:38,代码来源:Utility.php

示例11: executeEditPicket

 public function executeEditPicket()
 {
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $course_schedule_id = $course_schedule->getId();
     $grade_options = array();
     $c = new Criteria();
     $c->add(SubjectGradingPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId(), Criteria::IN);
     $c->addAscendingOrderByColumn(SubjectGradingPeer::ID);
     $grades = SubjectGradingPeer::doSelect($c);
     foreach ($grades as $grade) {
         $grade_options[$grade->getId()] = $grade->getGradeComponent()->toString();
     }
     $this->grade_options = $grade_options;
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $employee_options = array();
     $c = new Criteria();
     $c->add(EmployeePeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addAscendingOrderByColumn(EmployeePeer::NAME);
     $employees = EmployeePeer::doSelect($c);
     foreach ($employees as $employee) {
         $employee_options[$employee->getId()] = $employee->getName();
     }
     $this->employee_options = $employee_options;
     $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_agenda);
     $this->setTemplate('edit');
     $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'course_agenda/listPicket?course_id=' . $course_schedule->getId(), 'color' => 'black'));
     $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
     $this->type = 'edit';
     $actions2 = array(array('name' => '<span>Agenda Kelas</span>', 'url' => 'course_agenda/listPicket?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_unshift($actions2, array('name' => '<span>Daftar Mata Pelajaran</span>', 'url' => 'course_subtitute/list', 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Absensi Kelas</span>', 'url' => 'course_absence/listShow?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     $this->actions2 = $actions2;
     $this->course_schedule_id = $course_schedule_id;
     $this->course_schedule = $course_schedule;
     $this->class_agenda = $class_agenda;
 }
开发者ID:taryono,项目名称:school,代码行数:38,代码来源:actions.class.php

示例12: retrieveByPKs

 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(EmployeePeer::ID, $pks, Criteria::IN);
         $objs = EmployeePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
开发者ID:taryono,项目名称:school,代码行数:15,代码来源:BaseEmployeePeer.php

示例13: executeGetLectors

 public function executeGetLectors()
 {
     $subject_id = $this->getRequestParameter('subject_id');
     $accal_id = $this->getRequestParameter('accal_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($accal);
     $subject = SubjectPeer::retrieveByPK($subject_id);
     $subject_academic = null;
     if (!$subject) {
         $subject_academic_id = $this->getRequestParameter('subject_academic_id');
         $subject_academic = SubjectAccalPeer::retrieveByPK($subject_academic_id);
         $subject = $subject_academic->getSubject();
     }
     $this->forward404Unless($subject);
     $subject_id = $subject->getId();
     if ($subject_academic == null) {
         $c = new Criteria();
         $c->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $accal_id);
         $c->add(SubjectAccalPeer::SUBJECT_ID, $subject_id);
         $subject_academic = SubjectAccalPeer::doSelectOne($c);
     }
     $c = new Criteria();
     $c->add(TeachingCompetencyPeer::SUBJECT_ID, $subject_id);
     $c->addJoin(TeachingCompetencyPeer::EMPLOYEE_ID, EmployeePeer::ID);
     $c->addAscendingOrderByColumn(EmployeePeer::EMP_NO);
     $objs = EmployeePeer::doSelect($c);
     $lectors = array();
     $disabled = array();
     $cs_counts = array();
     foreach ($objs as $o) {
         $lectors[$o->getId()] = $o->toString();
         if ($subject_academic) {
             $c = new Criteria();
             $c->add(CourseSchedulePeer::EMPLOYEE_ID, $o->getId());
             $c->add(CourseSchedulePeer::SUBJECT_ACCAL_ID, $subject_academic->getId());
             $cs_count = CourseSchedulePeer::doCount($c);
             $cs_counts[$o->getId()] = $cs_count;
         }
     }
     $this->selected_lectors = array();
     if ($subject_academic) {
         $sals = $subject_academic->getSubjectAccalLectors();
         foreach ($sals as $sal) {
             $this->selected_lectors[$sal->getEmployeeId()] = 1;
         }
     }
     $this->cs_counts = $cs_counts;
     $this->lectors = $lectors;
     $this->forward404Unless($subject);
     $this->setTemplate('buildCheckBoxes');
     $this->disabled = $disabled;
     $this->accal = $accal;
     $this->subject_academic = $subject_academic;
 }
开发者ID:taryono,项目名称:school,代码行数:54,代码来源:actions.class.php

示例14: doSelectCoordinator

 public static function doSelectCoordinator()
 {
     $criteria = new Criteria();
     $depts = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo');
     $criteria->add(EmployeePeer::DEPARTMENT_ID, $depts->getChildRecurs(), Criteria::IN);
     $criteria->add(EmployeePeer::IS_THESIS_ADVISOR, true, Criteria::IN);
     return EmployeePeer::doSelect($criteria);
 }
开发者ID:taryono,项目名称:school,代码行数:8,代码来源:EmployeePeer.php

示例15: executeBatchClassroomTimesheet

 public function executeBatchClassroomTimesheet(sfWebRequest $request)
 {
     // using the filters and the selected ID's get the set of provider ID's
     $ids = $request->getParameter('ids');
     // apply filter
     $this->filters = new ClientFormFilter($this->getUser()->getAttribute('client.filters', array(), 'admin_module'));
     $c = $this->filters->buildCriteria($this->getFilters(), true);
     // limit to only the selected clients (save for later use in loop)
     $filter_crit = $c->add(ClientServicePeer::CLIENT_ID, $ids, Criteria::IN);
     // only get the set of employees
     $c->addGroupByColumn(ClientServicePeer::EMPLOYEE_ID);
     // get employees for all services
     $c->addJoin(ClientServicePeer::EMPLOYEE_ID, EmployeePeer::ID);
     $employees = EmployeePeer::doSelect($c);
     // for each provider, use the filter criteria to get just their timesheets
     $this->filters = new ClientFormFilter($this->getUser()->getAttribute('client.filters', array(), 'admin_module'));
     $filter_crit = $this->filters->buildCriteria($this->getFilters());
     $filter_crit->add(ClientPeer::ID, $ids, Criteria::IN);
     $timesheet = array();
     $i = 0;
     foreach ($employees as $employee) {
         $temp = clone $filter_crit;
         $timesheet[$i]['employee'] = $employee->getFullName();
         $temp->add(ClientServicePeer::EMPLOYEE_ID, $employee->getId());
         $client_servs = ClientServicePeer::doSelect($temp);
         $timesheet[$i]['clients_right'] = '';
         $timesheet[$i]['clients_left'] = '';
         $num = 0;
         foreach ($client_servs as $acs) {
             if ($num++ % 2) {
                 $timesheet[$i]['clients_right'] .= $acs->getClient()->getFullName() . " - " . $acs->getFrequency() . "\n";
             } else {
                 $timesheet[$i]['clients_left'] .= $acs->getClient()->getFullName() . " - " . $acs->getFrequency() . "\n";
             }
         }
         $timesheet[$i]['office'] = $acs->getOffice();
         $timesheet[$i]['service'] = $acs->getService();
         $timesheet[$i]['date'] = $acs->getStartDate('Y') . ' - ' . $acs->getEndDate('Y');
         $i++;
     }
     /*
         foreach($timesheet as $asheet){
         	echo $asheet['employee'].'<br />';
         	foreach($asheet['clients'] as $kid){
         		echo $kid->getClient().'<br />';
         	}
         	echo '<br />';
         }
     die();
     */
     // create the document
     $doc = new sfTinyDoc();
     $doc->createFrom(array('basename' => 'batchClassroomTimesheet'));
     $doc->loadXml('content.xml');
     $doc->mergeXmlBlock('timesheet', $timesheet);
     $doc->saveXml();
     $doc->close();
     // send and remove the document
     $doc->sendResponse();
     $doc->remove();
     throw new sfStopException();
 }
开发者ID:anvaya,项目名称:nckids,代码行数:62,代码来源:actions.class.php


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