public function count(Zend_Db_Select $select = null) {
        if (!$select) {
            $select = $this->select();
        }
        $select->from($this->getName(), array('count' => new Zend_Db_Expr('COUNT(*)')));
        if ($row = $this->fetchRow($select)) {
            return (int)$row->count;
        }
        return 0;
    }