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


PHP Model\FormModel類代碼示例

本文整理匯總了PHP中Mautic\CoreBundle\Model\FormModel的典型用法代碼示例。如果您正苦於以下問題:PHP FormModel類的具體用法?PHP FormModel怎麽用?PHP FormModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getEntity

 /**
  * {@inheritdoc}
  *
  * @return Point|null
  */
 public function getEntity($id = null)
 {
     if ($id === null) {
         return new Point();
     }
     return parent::getEntity($id);
 }
開發者ID:woakes070048,項目名稱:mautic,代碼行數:12,代碼來源:PointModel.php

示例2: 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 LeadNote();
     }
     return parent::getEntity($id);
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:14,代碼來源:NoteModel.php

示例3: 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);
 }
開發者ID:Jornve,項目名稱:mautic,代碼行數:12,代碼來源:ClientModel.php

示例4: 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 Event();
     }
     $entity = parent::getEntity($id);
     return $entity;
 }
開發者ID:smotalima,項目名稱:mautic,代碼行數:15,代碼來源:EventModel.php

示例5: togglePublishStatus

 /**
  * {@inheritdoc}
  *
  * @param object $entity
  *
  * @return bool  Force browser refresh
  */
 public function togglePublishStatus($entity)
 {
     parent::togglePublishStatus($entity);
     //clear the cache
     /** @var \Mautic\CoreBundle\Helper\CacheHelper $cacheHelper */
     $cacheHelper = $this->factory->getHelper('cache');
     $cacheHelper->clearCache();
     return true;
 }
開發者ID:woakes070048,項目名稱:mautic,代碼行數:16,代碼來源:AddonModel.php

示例6: saveEntity

 public function saveEntity($entity, $unlock = true)
 {
     if (!$entity instanceof Opportunity) {
         throw new \InvalidArgumentException('entity is not an instance of Opportunity');
     }
     if (!$entity->getOwnerUser()) {
         $entity->setOwnerUser($this->factory->getUser(true));
     }
     if ($leadId = $this->factory->getRequest()->get('leadId', false)) {
         $entity->setLead($this->factory->getModel('lead')->getEntity($leadId));
     }
     parent::saveEntity($entity);
 }
開發者ID:redmantech,項目名稱:Mautic_CRM,代碼行數:13,代碼來源:OpportunityModel.php

示例7: 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 Asset();
     } else {
         $entity = parent::getEntity($id);
     }
     return $entity;
 }
開發者ID:smotalima,項目名稱:mautic,代碼行數:15,代碼來源:AssetModel.php

示例8: 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;
 }
開發者ID:HomeRefill,項目名稱:mautic,代碼行數:15,代碼來源:UserModel.php

示例9: deleteEntities

 /**
  * Delete an array of entities
  *
  * @param array $ids
  *
  * @return array
  */
 public function deleteEntities($ids)
 {
     $this->getRepository()->nullParents($ids);
     return parent::deleteEntities($ids);
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:12,代碼來源:PageModel.php

示例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);
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:11,代碼來源:DynamicContentModel.php

示例11: 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;
 }
開發者ID:smotalima,項目名稱:mautic,代碼行數:20,代碼來源:EmailModel.php

示例12: deleteEntity

 /**
  * @param object $entity
  */
 public function deleteEntity($entity)
 {
     // Delete custom avatar if one exists
     $imageDir = $this->factory->getSystemPath('images', true);
     $avatar = $imageDir . '/lead_avatars/avatar' . $entity->getId();
     if (file_exists($avatar)) {
         unlink($avatar);
     }
     parent::deleteEntity($entity);
 }
開發者ID:HomeRefill,項目名稱:mautic,代碼行數:13,代碼來源:LeadModel.php

示例13: deleteEntity

 /**
  * Delete an entity
  *
  * @param  $entity
  * @return null|object
  */
 public function deleteEntity($entity)
 {
     $bundle = $entity->getBundle();
     //if it doesn't have a dot, then assume the model will be $bundle.$bundle
     $modelName = strpos($bundle, '.') === false ? $bundle . '.' . $bundle : $bundle;
     $model = $this->factory->getModel($modelName);
     $repo = $model->getRepository();
     $tableAlias = $repo->getTableAlias();
     $entities = $model->getEntities(array('filter' => array('force' => array(array('column' => $tableAlias . '.category', 'expr' => 'eq', 'value' => $entity->getId())))));
     if (!empty($entities)) {
         foreach ($entities as $e) {
             $e->setCategory(null);
         }
         $model->saveEntities($entities, false);
     }
     parent::deleteEntity($entity);
 }
開發者ID:woakes070048,項目名稱:mautic,代碼行數:23,代碼來源:CategoryModel.php

示例14: saveEntity

 /**
  * Create/edit entity
  *
  * @param object $entity
  * @param bool   $unlock
  */
 public function saveEntity($entity, $unlock = true)
 {
     // Set widget name from widget type if empty
     if (!$entity->getName()) {
         $entity->setName($this->translator->trans('mautic.widget.' . $entity->getType()));
     }
     parent::saveEntity($entity, $unlock);
 }
開發者ID:HomeRefill,項目名稱:mautic,代碼行數:14,代碼來源:DashboardModel.php

示例15: deleteEntity

 /**
  * @param object $entity
  */
 public function deleteEntity($entity)
 {
     // Null all the event parents for this campaign to avoid database constraints
     $this->getEventRepository()->nullEventParents($entity->getId());
     parent::deleteEntity($entity);
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:9,代碼來源:CampaignModel.php


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