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


PHP Admin\Admin类代码示例

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


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

示例1: createQuery

 public function createQuery($context = 'list')
 {
     /** @var ProxyQuery|QueryBuilder $query */
     $query = parent::createQuery($context);
     if ($context == 'list') {
         $parameters = $this->getFilterParameters();
         $domainValue = isset($parameters['domain']) ? $parameters['domain'] : false;
         list($tableAlias) = $query->getQueryBuilder()->getRootAliases();
         if ($domainValue) {
             $query->where($tableAlias . '.domain = :domain')->setParameter('domain', $domainValue);
         }
         $emptyLocale = !empty($parameters['emptyLocale']['value']) ? $parameters['emptyLocale']['value'] : false;
         if ($emptyLocale) {
             $query->andWhere($tableAlias . '.translations NOT LIKE :emptyLocale')->setParameter('emptyLocale', '%s:2:"' . $emptyLocale . '"%');
         }
         $location = !empty($parameters['location']['value']) ? $parameters['location']['value'] : false;
         if ($location) {
             if ($location == self::FILTER_LOCATION_FRONTEND) {
                 $query->andWhere($tableAlias . '.source NOT LIKE :excludeAdmin')->setParameter('excludeAdmin', '%admin\\.%');
             } elseif ($location == self::FILTER_LOCATION_BACKEND) {
                 $query->andWhere($tableAlias . '.source LIKE :excludeAdmin')->setParameter('excludeAdmin', '%admin\\.%');
             }
         }
     }
     return $query;
 }
开发者ID:octava,项目名称:cms,代码行数:26,代码来源:TranslationAdmin.php

示例2: getBaseTemplate

 /**
  * return the base template name
  *
  * @param Request $request
  * @param Admin $admin
  * @return string the template name
  */
 protected function getBaseTemplate(Request $request, Admin $admin)
 {
     if ($request->isXmlHttpRequest()) {
         return $admin->getTemplate('ajax');
     }
     return $admin->getTemplate('layout');
 }
开发者ID:networking,项目名称:init-cms-bundle,代码行数:14,代码来源:HelpTextController.php

示例3: getBatchActions

 public function getBatchActions()
 {
     // retrieve the default batch actions (currently only delete)
     $actions = parent::getBatchActions();
     $actions['archive'] = array('label' => $this->trans('Archiver', array(), 'SonataAdminBundle'), 'ask_confirmation' => true);
     return $actions;
 }
开发者ID:polypodes,项目名称:EuradioNantes.eu,代码行数:7,代码来源:EmissionAdmin.php

示例4: __construct

 public function __construct($code, $class, $baseControllerName)
 {
     parent::__construct($code, $class, $baseControllerName);
     if (!$this->hasRequest()) {
         $this->datagridValues = array('_page' => 1, '_per_page' => 25);
     }
 }
开发者ID:Quiss,项目名称:Evrika,代码行数:7,代码来源:BannerAdmin.php

示例5: getBatchActions

 public function getBatchActions()
 {
     $custom_actions['enable'] = array('label' => $this->trans('Habilitar'), 'ask_confirmation' => FALSE);
     $custom_actions['disable'] = array('label' => $this->trans('Deshabilitar'), 'ask_confirmation' => TRUE);
     $actions = array_merge($custom_actions, parent::getBatchActions());
     return $actions;
 }
开发者ID:jewelhuq,项目名称:smpcl,代码行数:7,代码来源:ClassifieldAdmin.php

示例6: createQuery

 public function createQuery($context = 'list')
 {
     $query = parent::createQuery($context);
     $query->andWhere($query->expr()->eq($query->getRootAliases()[0] . '.customer', ':my_param'));
     $query->setParameter('my_param', true);
     return $query;
 }
开发者ID:Nexotap,项目名称:Ivory,代码行数:7,代码来源:CustomerAdmin.php

示例7: createQuery

 public function createQuery($context = 'list')
 {
     $query = parent::createQuery($context);
     $query->leftJoin('o.translations', 't');
     $query->addSelect('t');
     return $query;
 }
开发者ID:kminh,项目名称:AOTranslationBundle,代码行数:7,代码来源:MessageAdmin.php

示例8: getBatchActions

 /**
  * @return array
  */
 public function getBatchActions()
 {
     $actions = parent::getBatchActions();
     $actions['enabled'] = array('label' => $this->trans('batch_enable_comments'), 'ask_confirmation' => false);
     $actions['disabled'] = array('label' => $this->trans('batch_disable_comments'), 'ask_confirmation' => false);
     return $actions;
 }
开发者ID:roelveldhuizen,项目名称:SonataNewsBundle,代码行数:10,代码来源:CommentAdmin.php

示例9: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $instance->setCoordenadaY(self::__DEFAULT_LAT);
     $instance->setCoordenadaX(self::__DEFAULT_LNG);
     return $instance;
 }
开发者ID:alexhumar,项目名称:jc-tesis-servidor,代码行数:7,代码来源:PoiAdmin.php

示例10: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $parent = $this->getRoot()->getSubject();
     $instance->setPdfmerge($parent);
     return $instance;
 }
开发者ID:saliih,项目名称:yasmine-print,代码行数:7,代码来源:PdflistAdmin.php

示例11: getNewInstance

 /**
  * Setting default values
  * @inheritdoc
  */
 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $instance->setVisibility('2');
     $instance->setCourseLanguage($this->getTranslator()->getLocale());
     return $instance;
 }
开发者ID:daffef,项目名称:chamilo-lms,代码行数:11,代码来源:CourseAdmin.php

示例12: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $instance->setCreatedOn(new \DateTime("now"));
     $instance->setCreatedBy($this->security->getToken()->getUser());
     return $instance;
 }
开发者ID:c4d3r,项目名称:mcsuite-application-eyeofender,代码行数:7,代码来源:CategoryAdmin.php

示例13: getNewInstance

 public function getNewInstance()
 {
     $user = $this->getConfigurationPool()->getContainer()->get('security.context')->getToken()->getUser();
     $instance = parent::getNewInstance();
     $instance->setUser($user);
     return $instance;
 }
开发者ID:krombox,项目名称:motion,代码行数:7,代码来源:EventAdmin.php

示例14: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     /* @var $instance Employee */
     $instance->getProjects()->add($this->projectRepo->findOneBy(['isInternal' => true]));
     return $instance;
 }
开发者ID:bOmBeLq,项目名称:polcode,代码行数:7,代码来源:EmployeeAdmin.php

示例15: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $instance->setApplyLimit(-1);
     $instance->setEnded(new \DateTime());
     return $instance;
 }
开发者ID:TJUSSE,项目名称:ICSS,代码行数:7,代码来源:RecruitAdmin.php


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