當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Admin::getNewInstance方法代碼示例

本文整理匯總了PHP中Sonata\AdminBundle\Admin\Admin::getNewInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Admin::getNewInstance方法的具體用法?PHP Admin::getNewInstance怎麽用?PHP Admin::getNewInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sonata\AdminBundle\Admin\Admin的用法示例。


在下文中一共展示了Admin::getNewInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $parent = $this->getRoot()->getSubject();
     $instance->setPdfmerge($parent);
     return $instance;
 }
開發者ID:saliih,項目名稱:yasmine-print,代碼行數:7,代碼來源:PdflistAdmin.php

示例3: 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

示例4: 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

示例5: 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

示例6: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $instance->setApplyLimit(-1);
     $instance->setEnded(new \DateTime());
     return $instance;
 }
開發者ID:TJUSSE,項目名稱:ICSS,代碼行數:7,代碼來源:RecruitAdmin.php

示例7: getNewInstance

 /**
  * @return Menu
  */
 public function getNewInstance()
 {
     $site = $this->getCurrentSite();
     $instance = parent::getNewInstance();
     $instance->setSite($site);
     return $instance;
 }
開發者ID:skillberto,項目名稱:SonataPageMenuBundle,代碼行數:10,代碼來源:MenuAdmin.php

示例8: 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

示例9: getNewInstance

 /**
  * {@inheritdoc}
  */
 public function getNewInstance()
 {
     $gallery = parent::getNewInstance();
     if ($this->hasRequest()) {
         $gallery->setContext($this->getRequest()->get('context'));
     }
     return $gallery;
 }
開發者ID:nicolasricci,項目名稱:SonataMediaBundle,代碼行數:11,代碼來源:GalleryAdmin.php

示例10: getNewInstance

 /**
  * {@inheritdoc}
  */
 public function getNewInstance()
 {
     $media = parent::getNewInstance();
     if ($this->hasRequest()) {
         $media->setContext($context = $this->getRequest()->get('context'));
     }
     return $media;
 }
開發者ID:xaben,項目名稱:XabenMediaBundle,代碼行數:11,代碼來源:MediaAdmin.php

示例11: getNewInstance

 /**
  * {@inheritdoc}
  */
 public function getNewInstance()
 {
     $object = parent::getNewInstance();
     $inspection = new Inspection();
     $inspection->setDate(new \DateTime());
     $inspection->setComment("Initial inspection");
     $object->addInspection($inspection);
     return $object;
 }
開發者ID:NadirZenith,項目名稱:sonata-boilerplate,代碼行數:12,代碼來源:CarAdmin.php

示例12: getNewInstance

 public function getNewInstance()
 {
     $object = parent::getNewInstance();
     $object->setTranslatableLocale($this->getRequest()->getLocale());
     foreach (array_keys($this->languages) as $culture) {
         $object->addTranslation(new BlogTranslation($culture, 'title'));
         $object->addTranslation(new BlogTranslation($culture, 'content'));
     }
     return $object;
 }
開發者ID:rodgermd,項目名稱:21may,代碼行數:10,代碼來源:BlogAdmin.php

示例13: getNewInstance

 public function getNewInstance()
 {
     $date = date("m/d/Y H:i:s");
     $datetime = date_create($date);
     $instance = parent::getNewInstance();
     $instance->setDate($datetime);
     $instance->setTitle("no title ");
     $instance->setBody("no body ");
     return $instance;
 }
開發者ID:shine2lay,項目名稱:jack,代碼行數:10,代碼來源:BlogPostAdmin.php

示例14: getNewInstance

 public function getNewInstance()
 {
     $instance = parent::getNewInstance();
     $instance->setEnabled(true);
     $instance->setValid(true);
     //$instance->setDirection(1);
     //$instance->setProject(1);
     $instance->setDepartment('軟件學院');
     $instance->setMajor('軟件工程');
     return $instance;
 }
開發者ID:TJUSSE,項目名稱:ICSS,代碼行數:11,代碼來源:StudentAdmin.php

示例15: getNewInstance

 public function getNewInstance()
 {
     $object = parent::getNewInstance();
     $object->setTranslatableLocale($this->getRequest()->getLocale());
     foreach (array_keys($this->languages) as $culture) {
         $object->addTranslation(new AccommodationTranslation($culture, 'title'));
         $object->addTranslation(new AccommodationTranslation($culture, 'description'));
         $object->addTranslation(new AccommodationTranslation($culture, 'secondary_text'));
     }
     return $object;
 }
開發者ID:rodgermd,項目名稱:21may,代碼行數:11,代碼來源:AccommodationAdmin.php


注:本文中的Sonata\AdminBundle\Admin\Admin::getNewInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。