predictator/co-visitation-counts

1.2.1 2017-04-04 09:20 UTC

This package is not auto-updated.

Last update: 2024-11-09 21:17:07 UTC


README

Usage

Add visits

$coVisit = new CoVisitationCounts();

$visitedObject = new CoVisitationCounts\VisitedObject('10');
$visit = new CoVisitationCounts\Visit('userId-12', $visitedObject);

$coVisit->addVisit($visit);

$currentVisitedObject = new CoVisitationCounts\VisitedObject('11');
$currentVisit = new CoVisitationCounts\Visit('userId-16', $currentVisitedObject, new \DateTime());

$result = $coVisit->getResult($currentVisit);

Export model

$model = $coVisit->exportModel(new CoVisitationCounts\CoVisitationCountsModel());
$result = $model->getResult($currentVisit);

Process export

/** @var VisitedObjectInterface $item */
foreach ($result as $item) {
    $item->getId(); 
}

Build Status

predictator.eu