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