当前位置: 首页>>代码示例>>PHP>>正文


PHP MauticFactory::getIpAddress方法代码示例

本文整理汇总了PHP中Mautic\CoreBundle\Factory\MauticFactory::getIpAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP MauticFactory::getIpAddress方法的具体用法?PHP MauticFactory::getIpAddress怎么用?PHP MauticFactory::getIpAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mautic\CoreBundle\Factory\MauticFactory的用法示例。


在下文中一共展示了MauticFactory::getIpAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: changePoints

 /**
  * @param               $lead
  * @param MauticFactory $factory
  * @param               $action
  * @param               $config
  * @param               $form
  */
 public static function changePoints($lead, MauticFactory $factory, $action, $config, $form)
 {
     $model = $factory->getModel('lead');
     //create a new points change event
     $event = new PointsChangeLog();
     $event->setType('form');
     $event->setEventName($form->getId() . ":" . $form->getName());
     $event->setActionName($action->getName());
     $event->setIpAddress($factory->getIpAddress());
     $event->setDateAdded(new \DateTime());
     $event->setDelta($config['points']);
     $event->setLead($lead);
     $lead->addPointsChangeLog($event);
     $lead->addToPoints($config['points']);
     $model->saveEntity($lead, false);
 }
开发者ID:Jandersolutions,项目名称:mautic,代码行数:23,代码来源:FormEventHelper.php

示例2: changePoints

 /**
  * @param $event
  * @param $lead
  *
  * @return bool
  */
 public static function changePoints($event, $lead, MauticFactory $factory)
 {
     $points = $event['properties']['points'];
     $somethingHappened = false;
     if ($lead != null && !empty($points)) {
         $lead->addToPoints($points);
         //add a lead point change log
         $log = new PointsChangeLog();
         $log->setDelta($points);
         $log->setLead($lead);
         $log->setType('campaign');
         $log->setEventName("{$event['campaign']['id']}: {$event['campaign']['name']}");
         $log->setActionName("{$event['id']}: {$event['name']}");
         $log->setIpAddress($factory->getIpAddress());
         $log->setDateAdded(new \DateTime());
         $lead->addPointsChangeLog($log);
         $somethingHappened = true;
     }
     return $somethingHappened;
 }
开发者ID:woakes070048,项目名称:mautic,代码行数:26,代码来源:CampaignEventHelper.php


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