本文整理汇总了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;
}
示例2: getNewInstance
public function getNewInstance()
{
$instance = parent::getNewInstance();
$parent = $this->getRoot()->getSubject();
$instance->setPdfmerge($parent);
return $instance;
}
示例3: getNewInstance
public function getNewInstance()
{
$instance = parent::getNewInstance();
$instance->setCreatedOn(new \DateTime("now"));
$instance->setCreatedBy($this->security->getToken()->getUser());
return $instance;
}
示例4: getNewInstance
/**
* Setting default values
* @inheritdoc
*/
public function getNewInstance()
{
$instance = parent::getNewInstance();
$instance->setVisibility('2');
$instance->setCourseLanguage($this->getTranslator()->getLocale());
return $instance;
}
示例5: getNewInstance
public function getNewInstance()
{
$instance = parent::getNewInstance();
/* @var $instance Employee */
$instance->getProjects()->add($this->projectRepo->findOneBy(['isInternal' => true]));
return $instance;
}
示例6: getNewInstance
public function getNewInstance()
{
$instance = parent::getNewInstance();
$instance->setApplyLimit(-1);
$instance->setEnded(new \DateTime());
return $instance;
}
示例7: getNewInstance
/**
* @return Menu
*/
public function getNewInstance()
{
$site = $this->getCurrentSite();
$instance = parent::getNewInstance();
$instance->setSite($site);
return $instance;
}
示例8: getNewInstance
public function getNewInstance()
{
$instance = parent::getNewInstance();
$instance->setCoordenadaY(self::__DEFAULT_LAT);
$instance->setCoordenadaX(self::__DEFAULT_LNG);
return $instance;
}
示例9: getNewInstance
/**
* {@inheritdoc}
*/
public function getNewInstance()
{
$gallery = parent::getNewInstance();
if ($this->hasRequest()) {
$gallery->setContext($this->getRequest()->get('context'));
}
return $gallery;
}
示例10: getNewInstance
/**
* {@inheritdoc}
*/
public function getNewInstance()
{
$media = parent::getNewInstance();
if ($this->hasRequest()) {
$media->setContext($context = $this->getRequest()->get('context'));
}
return $media;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}