* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBStatistic'); /** * Statistic module to save cookie preferences * * Simple interface to save page statistic * * @version 0.1.0 * @package WB * @subpackage base */ class WBStatistic_CookiePreferences extends WBStatistic { /** * name of page view table */ const TABLE = 'cookiepreferences'; /** * add path to page views * * Save path in statistic table * * @param string $path * @param string $namespace */ public function add($allowed) { if (!$this->enabled) { return; } $uid = $this->user->getId(); if (!$uid) { $uid = 0; } $timer = $this->sess->getTimer(); $list = array(); foreach ($allowed as $k => $v) { if (0 < $v) { $list[] = $k; } } $save = array( 'trackid' => $this->getTrackingId(), 'addr' => $this->getAddress(), $this->uPrimary => $uid, 'allowed' => implode(', ', $list) ); $this->table->save(self::TABLE, '__new', $save); } }