ManaPHP\Counter\Adapter\Db::get PHP Method

get() public method

public get ( string $type, string $id ) : integer
$type string
$id string
return integer
    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;
    }