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


PHP JobPeer类代码示例

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


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

示例1: executeList

 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $filters = null;
     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', 999);
     $pager = new sfPropelPager('AcademicCalendar', $rpp);
     $pager->setPeerMethod('doSelectOrdered');
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     $filter_string = "";
     if ($filters) {
         foreach ($filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     $this->actions = $actions;
 }
开发者ID:taryono,项目名称:school,代码行数:59,代码来源:actions.class.php

示例2: getParentName

 public function getParentName()
 {
     $parent = JobPeer::retrieveByPK($this->getParent());
     if ($parent) {
         return $parent->toString();
     } else {
         return '-';
     }
 }
开发者ID:taryono,项目名称:school,代码行数:9,代码来源:Job.php

示例3: executeList

 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c = new Criteria();
     $c->addAscendingOrderByColumn(CourseSchedulePeer::CLASS_GROUP_ID);
     $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(), 'course'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'course');
     $pager = new sfPropelPager('CourseSchedule', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course'));
     $this->getUser()->setAttribute('page', $page, 'course');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array();
     $this->actions = $actions;
     $this->subtitle = $dept->getName();
     $this->counseling = new Counseling();
     $this->dept = $dept;
 }
开发者ID:taryono,项目名称:school,代码行数:57,代码来源:actions.class.php

示例4: retrieveByCode

 public static function retrieveByCode($code, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria(JobPeer::DATABASE_NAME);
     $criteria->add(JobPeer::CODE, $code);
     $v = JobPeer::doSelect($criteria, $con);
     return !empty($v) > 0 ? $v[0] : null;
 }
开发者ID:taryono,项目名称:school,代码行数:10,代码来源:JobPeer.php

示例5: executeAddJob

 public function executeAddJob(sfWebRequest $request)
 {
     $jobId = $request->getParameter("id");
     $job = JobPeer::retrieveByPK($jobId);
     $profile = $this->getUser()->getProfile();
     $to = "photo@tufts.edu";
     $subject = $profile->getFirstName() . " " . $profile->getLastName() . " is requestting to be added to job " . $job->getEvent();
     mail($to, $subject, $subject);
     JobPeer::addEmailLogMessage($jobId, "Request to be added", "photo@tufts.edu");
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:10,代码来源:actions.class.php

示例6: executeList

 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(ColLocationPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addJoin(ColItemPeer::COL_LOCATION_ID, ColLocationPeer::ID);
     $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 ($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(), 'col_item'));
     $this->getUser()->setAttribute('max_per_page', 12, 'col_item');
     $pager = new sfPropelPager('ColItem', 12);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'col_item'));
     $this->getUser()->setAttribute('page', $page, 'col_item');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     $this->filter_string = $filter_string;
     $this->subtitle = '';
     $actions = array(array('name' => 'cetak', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->actions = $actions;
     $this->actions3 = array();
 }
开发者ID:taryono,项目名称:school,代码行数:55,代码来源:actions.class.php

示例7: executeShowStudent

 public function executeShowStudent()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $subject = SubjectPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($subject);
     $this->subtitle = $subject->toString() . ' - id:' . $subject->getId();
     $this->subject = $subject;
 }
开发者ID:taryono,项目名称:school,代码行数:15,代码来源:actions.class.php

示例8: getJobsForAutocomplete

 public static function getJobsForAutocomplete($q)
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers('Url');
     $c = new Criteria();
     $crit0 = $c->getNewCriterion(JobPeer::EVENT, $q . '%', Criteria::LIKE);
     $crit1 = $c->getNewCriterion(JobPeer::ID, $q . '%', Criteria::LIKE);
     $crit0->addOr($crit1);
     $c->add($crit0);
     $c->addDescendingOrderByColumn(JobPeer::EVENT);
     $c->setLimit(10);
     $jobs = JobPeer::doSelect($c);
     $arr = array();
     foreach ($jobs as $j) {
         $arr[] = array("name" => $j->getId() . " - " . $j->getEvent(), "url" => url_for('job_show', array("slug" => $j->getSlug())));
     }
     return $arr;
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:17,代码来源:JobPeer.php

示例9: executeList

 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $actions = array();
     $this->actions = $actions;
     $this->byEmployee = false;
     $this->subtitle = 'Riwayat Penilaian';
     $this->counseling = new Counseling();
 }
开发者ID:taryono,项目名称:school,代码行数:18,代码来源:actions.class.php

示例10: executeListByEmployee

 public function executeListByEmployee()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'counseling/listByEmployee');
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo');
     $actions = array();
     $this->actions = $actions;
     $this->subtitle = $employee->toString();
     $this->employee_id = $employee_id;
     $this->employee = $employee;
     $this->counseling = new Counseling();
 }
开发者ID:taryono,项目名称:school,代码行数:21,代码来源:actions.class.php

示例11: executeChartEmployees

 public function executeChartEmployees()
 {
     $data = array();
     foreach (JobPeer::doSelect(new Criteria()) as $job) {
         $c = new Criteria();
         $c->add(EmployeePeer::JOB_ID, $job->getId());
         $data[$job->getName()] = EmployeePeer::doCount($c);
     }
     //To create a bar chart we need to create a stBarOutline Object
     $bar = new stBarOutline(80, '#78B9EC', '#3495FE');
     $bar->key('', 10);
     //Passing the random data to bar chart
     $bar->data = $data;
     //Creating a stGraph object
     $g = new stGraph();
     $g->title('Employee Job Type Break-Down', '{font-size: 20px;}');
     $g->bg_colour = '#FFFFFF';
     $g->set_inner_background('#E3F0FD', '#CBD7E6', 90);
     $g->x_axis_colour('#8499A4', '#E4F5FC');
     $g->y_axis_colour('#8499A4', '#E4F5FC');
     //Pass stBarOutline object i.e. $bar to graph
     $g->data_sets[] = $bar;
     //Setting labels for X-Axis
     $g->set_x_labels(array_keys($data));
     // to set the format of labels on x-axis e.g. font, color, step
     $g->set_x_label_style(10, '#18A6FF', 0, 2);
     // To tick the values on x-axis
     // 2 means tick every 2nd value
     $g->set_x_axis_steps(2);
     //set maximum value for y-axis
     //we can fix the value as 20, 10 etc.
     //but its better to use max of data
     $g->set_y_max(max($data));
     $g->y_label_steps(4);
     $g->set_y_legend('# Employees', 12, '#18A6FF');
     echo $g->render();
     return sfView::NONE;
 }
开发者ID:anvaya,项目名称:nckids,代码行数:38,代码来源:actions.class.php

示例12: executeEdit

 public function executeEdit()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $member_type = MemberTypePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($member_type);
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     // if ($acl->getAddPriv()) array_push($actions, array('name'=>'copy','type'=>'submit', 'options'=>array('class'=>'save_button', 'onclick'=>"action_type.value=this.value")));
     if ($acl->getRemovePriv()) {
         array_push($actions, array('name' => 'delete', 'url' => 'member_type/delete?id=' . $member_type->getId(), 'color' => 'red'));
     }
     array_push($actions, array('name' => 'cancel', 'url' => 'member_type/list', 'color' => 'black'));
     $this->subtitle = $member_type->toString() . ' - id:' . $member_type->getId();
     $this->type = 'edit';
     $this->member_type = $member_type;
     $this->forward404Unless($this->member_type);
     $c = new Criteria();
     $this->member_jobs = MemberJobPeer::doSelect($c);
     foreach ($this->member_jobs as $member_job) {
         $c = new Criteria();
         $c->add(MemberJobPeer::PARENT, $member_job->getId());
         $c->add(MemberJobPeer::DISPLAY_MENU, true);
         $member_job->child = MemberJobPeer::doCount($c);
         $c = new Criteria();
         $c->add(MemberAclPeer::MEMBER_TYPE_ID, $this->member_type->getId(), Criteria::EQUAL);
         $c->add(MemberAclPeer::MEMBER_JOB_ID, $member_job->getId(), Criteria::EQUAL);
         $member_job->member_acl = MemberAclPeer::doSelectOne($c);
         $member_job->level = $member_job->getLevel();
         $member_job->order = $member_job->getMenuOrderRecursive();
     }
     function sortOrder($a, $b)
     {
         if ($a->order == $b->order) {
             return 0;
         }
         return $a->order < $b->order ? -1 : 1;
     }
     usort($this->member_jobs, 'sortOrder');
     $this->actions = $actions;
 }
开发者ID:taryono,项目名称:school,代码行数:49,代码来源:actions.class.php

示例13: getNumberOfJobs

 public function getNumberOfJobs()
 {
     $c = new Criteria();
     $c->add(JobPeer::PROJECT_ID, $this->getId());
     return JobPeer::doCount($c);
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:6,代码来源:Project.php

示例14: executeEdit

 public function executeEdit()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $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;
     $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_agenda);
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     if ($acl->getRemovePriv()) {
         array_push($actions, array('name' => 'delete', 'url' => 'class_agenda/delete?id=' . $class_agenda->getId() . '&sched_id=' . $course_schedule->getId(), 'color' => 'red'));
     }
     array_push($actions, array('name' => 'cancel', 'url' => 'class_agenda/list?id=' . $course_schedule->getId(), 'color' => 'black'));
     $this->subtitle = $class_agenda->toString() . ' - id:' . $class_agenda->getId();
     $this->type = 'edit';
     $this->class_agenda = $class_agenda;
     $this->actions = $actions;
     $this->course_schedule_id = $class_agenda->getCourseScheduleId();
     $this->course_schedule = $course_schedule;
     $actions2 = array(array('name' => '<span>Jadwal Pelajaran</span>', 'url' => 'course_sched/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'class_agenda/list?id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
开发者ID:taryono,项目名称:school,代码行数:42,代码来源:actions.class.php

示例15: getJob

 /**
  * Get the associated Job object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Job The associated Job object.
  * @throws     PropelException
  */
 public function getJob(PropelPDO $con = null)
 {
     if ($this->aJob === null && $this->job_id !== null) {
         $c = new Criteria(JobPeer::DATABASE_NAME);
         $c->add(JobPeer::ID, $this->job_id);
         $this->aJob = JobPeer::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->aJob->addJobPhotographers($this);
         		 */
     }
     return $this->aJob;
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:23,代码来源:BaseJobPhotographer.php


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