mirror of
https://github.com/Mibew/mibew.git
synced 2025-04-28 17:16:41 +03:00
Describe "visitorTrack" event in Events class
This commit is contained in:
parent
1814298f4f
commit
e61b91dd5e
@ -20,6 +20,7 @@
|
|||||||
namespace Mibew\Controller;
|
namespace Mibew\Controller;
|
||||||
|
|
||||||
use Mibew\EventDispatcher\EventDispatcher;
|
use Mibew\EventDispatcher\EventDispatcher;
|
||||||
|
use Mibew\EventDispatcher\Events;
|
||||||
use Mibew\Settings;
|
use Mibew\Settings;
|
||||||
use Mibew\Thread;
|
use Mibew\Thread;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -34,6 +35,8 @@ class WidgetController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Provides a gateway for widget requests.
|
* Provides a gateway for widget requests.
|
||||||
*
|
*
|
||||||
|
* Triggers {@link \Mibew\EventDispatcher\Events::VISITOR_TRACK} event.
|
||||||
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return string Rendered page content
|
* @return string Rendered page content
|
||||||
*/
|
*/
|
||||||
@ -89,7 +92,7 @@ class WidgetController extends AbstractController
|
|||||||
// Provide an ability for others to make something on visitor
|
// Provide an ability for others to make something on visitor
|
||||||
// tracking
|
// tracking
|
||||||
$event_arguments = array('visitor' => $visitor);
|
$event_arguments = array('visitor' => $visitor);
|
||||||
EventDispatcher::getInstance()->triggerEvent('visitorTrack', $event_arguments);
|
EventDispatcher::getInstance()->triggerEvent(Events::VISITOR_TRACK, $event_arguments);
|
||||||
|
|
||||||
// Get invitation state
|
// Get invitation state
|
||||||
$invitation_state = invitation_state($visitor_id);
|
$invitation_state = invitation_state($visitor_id);
|
||||||
|
@ -155,4 +155,16 @@ final class Events
|
|||||||
* a response object to this field.
|
* a response object to this field.
|
||||||
*/
|
*/
|
||||||
const RESOURCE_NOT_FOUND = 'resourceNotFound';
|
const RESOURCE_NOT_FOUND = 'resourceNotFound';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Visitor is tracked by the system.
|
||||||
|
*
|
||||||
|
* This event is triggered every time a visitor is tracked by the widget. An
|
||||||
|
* associative array with the following items is passed to the event
|
||||||
|
* handlers:
|
||||||
|
* - "visitor": array, list of visitor's info. See returned value of
|
||||||
|
* {@link track_get_visitor_by_id()} function for details of its
|
||||||
|
* structure.
|
||||||
|
*/
|
||||||
|
const VISITOR_TRACK = 'visitorTrack';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user