/**
  * @param $url
  *
  * @return Trackable
  */
 protected function getTrackableEntity($url)
 {
     $redirect = new Redirect();
     $redirect->setUrl($url);
     $redirect->setRedirectId();
     $trackable = new Trackable();
     $trackable->setChannel('email')->setChannelId(1)->setRedirect($redirect)->setHits(rand(1, 10))->setUniqueHits(rand(1, 10));
     return $trackable;
 }
Exemple #2
0
 /**
  * Create a Trackable entity.
  *
  * @param $url
  * @param $channel
  * @param $channelId
  *
  * @return Trackable
  */
 protected function createTrackableEntity($url, $channel, $channelId)
 {
     $redirect = $this->getRedirectModel()->createRedirectEntity($url);
     $trackable = new Trackable();
     $trackable->setChannel($channel)->setChannelId($channelId)->setRedirect($redirect);
     return $trackable;
 }