public function get($type, $id) { /** * @var \ManaPHP\Counter\Adapter\Db\Model $counter */ $counter = new $this->_model(); $counter = $counter::findFirst(['hash' => md5($type . ':' . $id)]); return $counter === false ? 0 : (int) $counter->value; }