* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBStatistic'); /** * Statistic module for JSONP content view * * Simple interface to save JSONP statistic * * @version 0.2.0 * @package WB * @subpackage base */ class WBStatistic_JSONP extends WBStatistic { /** * name of page view table */ const TABLE = 'jsonpview'; /** * Current Mandator Id * @var string */ private $mandatorId = 0; /** * Set Id Of Mandator * * @param string $id */ public function setMandatorId($id) { $this->mandatorId = $id; } /** * Add Path * * Save path in statistic table * * @param string path * @param string processor */ public function addPath($path, $proc = '') { if (!$this->enabled) { return; } $path = trim($path, "/ \t\n\r"); $uid = $this->user->getId(); if (!$uid) { $uid = 0; } $timer = $this->sess->getTimer(); $save = array( 'trackid' => $this->getTrackingId(), 'processor' => $proc, 'path' => $path, 'mandatorid' => $this->mandatorId, 'addr' => $this->getAddress(), $this->uPrimary => $uid, 'counter' => $this->sess->getCounter(), 'elapsedstart' => $timer['elapsed_start'], 'elapsedlast' => $timer['elapsed_last'] ); if ($this->sess->has(WBStatistic::SESS_KEY_HINT)) { $save['hint'] = $this->sess->get(WBStatistic::SESS_KEY_HINT); } $this->table->save(self::TABLE, '__new', $save); } }