Exemplo n.º 1
0
    public function count($historic = false)
    {
        $columns = array($this->table->getColumn('LK'));

        if ($historic == false) {
            if (empty($this->where)) {
                $this->where = DB::where($this->table->getColumn('histtop'), DB::term('Y'));
            } else {
                $this->where->addAnd($this->table->getColumn('histtop'), DB::term('Y'));
            }
        }

        if (empty($this->order)) {
            $this->order = new base_database_Order($this->table->getColumn('LK'), base_database_Order::ASC);
        }

        $select = $this->_createSelectStatement($columns);
        $result = $select->fetchDatabase();

        return count($result);
    }