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


PHP AclPeer::doSelectOne方法代码示例

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


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

示例1: 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;
     $user_group = UserGroupPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($user_group);
     if ($user_group->getJobTemplateId() == 11) {
         $c = new Criteria();
         $cton1 = $c->getNewCriterion(JobPeer::ID, 132, Criteria::NOT_IN);
         $cton2 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 1, Criteria::IN);
         $cton3 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 3, Criteria::IN);
         $cton4 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 11, Criteria::IN);
         $cton3->addOr($cton4);
         $cton2->addOr($cton3);
         $cton1->addAnd($cton2);
         $c->add($cton1);
         $c->addAscendingOrderByColumn(JobPeer::MENU_ORDER);
         $jobs = JobPeer::doSelect($c);
     } else {
         $c = new Criteria();
         $cton1 = $c->getNewCriterion(JobPeer::ID, 132, Criteria::NOT_IN);
         $cton2 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, $user_group->getJobTemplateId(), Criteria::IN);
         $cton3 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, $user_group->getJobTemplate()->getParent(), Criteria::IN);
         $cton4 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 11, Criteria::IN);
         $cton3->addOr($cton4);
         $cton2->addOr($cton3);
         $cton1->addAnd($cton2);
         $c->add($cton1);
         $c->addAscendingOrderByColumn(JobPeer::MENU_ORDER);
         $jobs = JobPeer::doSelect($c);
     }
     foreach ($jobs as $job) {
         $c = new Criteria();
         $c->add(JobPeer::PARENT, $job->getId());
         $c->add(JobPeer::DISPLAY_MENU, true);
         $job->child = JobPeer::doCount($c);
         $c = new Criteria();
         $c->add(AclPeer::USER_GROUP_ID, $user_group->getId(), Criteria::EQUAL);
         $c->add(AclPeer::JOB_ID, $job->getId(), Criteria::EQUAL);
         $job->acl = AclPeer::doSelectOne($c);
         $job->level = $job->getLevel();
         $job->order = $job->getMenuOrderRecursive();
     }
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     if ($user_group->getCode() != 'admin' && $user_group->getCode() != 'student' && $user_group->getCode() != 'lector') {
         array_push($actions, array('name' => 'delete', 'url' => 'user_group/delete?id=' . $user_group->getId(), 'color' => 'red'));
     }
     array_push($actions, array('name' => 'cancel', 'url' => 'user_group/list', 'color' => 'white'));
     $this->subtitle = $user_group->toString() . ' - id:' . $user_group->getId();
     $this->type = 'edit';
     $this->user_group = $user_group;
     $this->icon = 'user_edit.png';
     $this->actions = $actions;
     $this->jobs = $jobs;
 }
开发者ID:taryono,项目名称:school,代码行数:64,代码来源:actions.class.php


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