public function findAll()
    {
        // convert to criteria.
        $criteria = call_user_func_array(array($this, 'argsToCriteria'), func_get_args());
        
        // logical delete ?
        $schema = $this->getSchema();
        if ($schema->hasColumn('active')) {
            $criteria->where('active = ?', 1);
        }

        // to SQL.
        $sql = $criteria->toSQL();

        // query
        $sth = $this->query($sql, $criteria->getParams(), Database::TARGET_SLAVE);

        // to entities
        $entities = new Entities($this);
        $entities->setCriteria($criteria);
        foreach ($sth->fetchAll(Connection::FETCH_ASSOC) as $row) {
            $entities->add($this->build($row, true));
        }

        return $entities;
    }