本文整理汇总了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);
}
示例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;
}