function add($compile = true) { if (!isset($this->url)) { return $this->_error('url'); } $this->host = null; if (!($query = $this->_buildQuery())) { return false; } if (!$query->hasAttribute('referred')) { $query->setAttribute('referred', 'UNIX_TIMESTAMP()'); } if (!$query->insert()) { return $this->_error('insert'); } if ($compile) { SubscriptionStatistics::compile($this->host); } return true; }
function compile($host) { $instance = new SubscriptionStatistics(); $instance->host = $host; $instance->count = 1; return $instance->update(); }