Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function getEntity($id = null)
 {
     if ($id === null) {
         return new Form();
     }
     return parent::getEntity($id);
 }
Exemple #2
0
 /**
  * {@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);
 }
 /**
  * {@inheritdoc}
  *
  * @return TriggerEvent|null
  */
 public function getEntity($id = null)
 {
     if ($id === null) {
         return new TriggerEvent();
     }
     return parent::getEntity($id);
 }
 public function getEntity($id = null)
 {
     if (!$id) {
         return new Opportunity();
     }
     return parent::getEntity($id);
 }
Exemple #5
0
 /**
  * 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;
 }
 /**
  * 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;
 }
Exemple #7
0
 /**
  * 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;
 }
Exemple #8
0
 /**
  * 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;
 }
Exemple #9
0
 /**
  * {@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;
 }
Exemple #10
0
 /**
  * Here just so PHPStorm calms down about type hinting.
  *
  * @param null $id
  *
  * @return null|DynamicContent
  */
 public function getEntity($id = null)
 {
     return parent::getEntity($id);
 }
 /**
  * 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;
 }
Exemple #12
0
 /**
  * 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;
 }