本文整理匯總了PHP中Mautic\CoreBundle\Model\FormModel::getEntity方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormModel::getEntity方法的具體用法?PHP FormModel::getEntity怎麽用?PHP FormModel::getEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mautic\CoreBundle\Model\FormModel
的用法示例。
在下文中一共展示了FormModel::getEntity方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEntity
/**
* {@inheritdoc}
*/
public function getEntity($id = null)
{
if ($id === null) {
return new Form();
}
return parent::getEntity($id);
}
示例2: getEntity
/**
* {@inheritdoc}
*
* @return null|Client|Consumer
*/
public function getEntity($id = null)
{
if ($id === null) {
return $this->apiMode == 'oauth2' ? new Client() : new Consumer();
}
return parent::getEntity($id);
}
示例3: getEntity
/**
* {@inheritdoc}
*
* @return TriggerEvent|null
*/
public function getEntity($id = null)
{
if ($id === null) {
return new TriggerEvent();
}
return parent::getEntity($id);
}
示例4: getEntity
public function getEntity($id = null)
{
if (!$id) {
return new Opportunity();
}
return parent::getEntity($id);
}
示例5: getEntity
/**
* Get a specific entity or generate a new one if id is empty
*
* @param $id
* @return null|object
*/
public function getEntity($id = null)
{
if ($id === null) {
return new LeadField();
}
$entity = parent::getEntity($id);
return $entity;
}
示例6: getEntity
/**
* Get a specific entity or generate a new one if id is empty.
*
* @param $id
*
* @return null|object
*/
public function getEntity($id = null)
{
if ($id === null) {
$entity = new Monitoring();
} else {
$entity = parent::getEntity($id);
}
return $entity;
}
示例7: getEntity
/**
* Get a specific entity or generate a new one if id is empty
*
* @param $id
*
* @return null|Email
*/
public function getEntity($id = null)
{
if ($id === null) {
$entity = new Email();
$entity->setSessionId('new_' . hash('sha1', uniqid(mt_rand())));
} else {
$entity = parent::getEntity($id);
if ($entity !== null) {
$entity->setSessionId($entity->getId());
}
}
return $entity;
}
示例8: getEntity
/**
* Get a specific entity or generate a new one if id is empty
*
* @param $id
* @return Category
*/
public function getEntity($id = null)
{
if ($id === null) {
return new Category();
}
$entity = parent::getEntity($id);
return $entity;
}
示例9: getEntity
/**
* {@inheritdoc}
*/
public function getEntity($id = null)
{
if ($id === null) {
return new User();
}
$entity = parent::getEntity($id);
if ($entity) {
//add user's permissions
$entity->setActivePermissions($this->em->getRepository('MauticUserBundle:Permission')->getPermissionsByRole($entity->getRole()));
}
return $entity;
}
示例10: getEntity
/**
* Here just so PHPStorm calms down about type hinting.
*
* @param null $id
*
* @return null|DynamicContent
*/
public function getEntity($id = null)
{
return parent::getEntity($id);
}
示例11: getEntity
/**
* Get a specific entity or generate a new one if id is empty
*
* @param $id
*
* @return null|Notification
*/
public function getEntity($id = null)
{
if ($id === null) {
$entity = new Notification();
} else {
$entity = parent::getEntity($id);
}
return $entity;
}
示例12: getEntity
/**
* Get a specific entity or generate a new one if id is empty
*
* @param $id
* @return null|Lead
*/
public function getEntity($id = null)
{
if ($id === null) {
return new Lead();
}
//set the point trigger model in order to get the color code for the lead
$repo = $this->getRepository();
$repo->setTriggerModel($this->factory->getModel('point.trigger'));
$entity = parent::getEntity($id);
return $entity;
}