public function getByProduct($product_id)
    {
        $result = null;
        $this->hook->attach('rating.get.before', $product_id, $result, $this);

        if (isset($result)) {
            return $result;
        }

        $sql = 'SELECT rating, votes FROM rating WHERE product_id=?';
        $result = $this->db->fetch($sql, array($product_id));

        $this->hook->attach('rating.get.after', $product_id, $result, $this);
        return $result;
    }