• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Model\FormModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Mautic\CoreBundle\Model\FormModel的典型用法代码示例。如果您正苦于以下问题:PHP FormModel类的具体用法?PHP FormModel怎么用?PHP FormModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了FormModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: saveEntity

 /**
  * {@inheritdoc}
  *
  * @param Lead $entity
  * @param bool   $unlock
  */
 public function saveEntity($entity, $unlock = true)
 {
     //check to see if we can glean information from ip address
     if (!$entity->imported && count($ips = $entity->getIpAddresses())) {
         $fields = $entity->getFields();
         $details = $ips->first()->getIpDetails();
         if (!empty($details['city']) && empty($fields['core']['city']['value'])) {
             $entity->addUpdatedField('city', $details['city']);
         }
         if (!empty($details['region']) && empty($fields['core']['state']['value'])) {
             $entity->addUpdatedField('state', $details['region']);
         }
         if (!empty($details['country']) && empty($fields['core']['country']['value'])) {
             $entity->addUpdatedField('country', $details['country']);
         }
     }
     parent::saveEntity($entity, $unlock);
 }
开发者ID:woakes070048,项目名称:mautic,代码行数:24,代码来源:LeadModel.php


示例17: deleteEntities

 /**
  * {@inheritdoc}
  */
 public function deleteEntities($ids)
 {
     $entities = parent::deleteEntities($ids);
     $schemaHelper = $this->factory->getSchemaHelper('table');
     foreach ($entities as $id => $entity) {
         //delete the associated results table
         $schemaHelper->deleteTable("form_results_" . $id . "_" . $entity->getAlias());
     }
     $schemaHelper->executeChanges();
     return $entities;
 }
开发者ID:smotalima,项目名称:mautic,代码行数:14,代码来源:FormModel.php


示例18: saveEntity

 /**
  * {@inheritdoc}
  *
  * @var \MauticPlugin\MauticSocialBundle\Entity\Monitoring
  */
 public function saveEntity($monitoringEntity, $unlock = true)
 {
     // we're editing an existing record
     if (!$monitoringEntity->isNew()) {
         //increase the revision
         $revision = $monitoringEntity->getRevision();
         ++$revision;
         $monitoringEntity->setRevision($revision);
     } else {
         $now = new \DateTime();
         $monitoringEntity->setDateAdded($now);
     }
     parent::saveEntity($monitoringEntity, $unlock);
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:19,代码来源:MonitoringModel.php


示例19: deleteEntities

 /**
  * Delete an array of entities
  *
  * @param array $ids
  *
  * @return array
  */
 public function deleteEntities($ids)
 {
     $entities = parent::deleteEntities($ids);
     //remove the column from the leads table
     $leadsSchema = $this->factory->getSchemaHelper('column', 'leads');
     foreach ($entities as $e) {
         $leadsSchema->dropColumn($e->getAlias());
     }
     $leadsSchema->executeChanges();
 }
开发者ID:woakes070048,项目名称:mautic,代码行数:17,代码来源:FieldModel.php


示例20: saveEntity

 /**
  * {@inheritdoc}
  *
  * @param Focus      $entity
  * @param bool|false $unlock
  */
 public function saveEntity($entity, $unlock = true)
 {
     parent::saveEntity($entity, $unlock);
     // Generate cache after save to have ID available
     $content = $this->generateJavascript($entity);
     $entity->setCache($content);
     $this->getRepository()->saveEntity($entity);
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:14,代码来源:FocusModel.php



注:本文中的Mautic\CoreBundle\Model\FormModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MediaWiki\MediaWikiServices类代码示例发布时间:2022-05-23
下一篇:
PHP Helper\InputHelper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap