当前位置: 首页>>代码示例>>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;未经允许,请勿转载。