public function setDAO(string $class, DAO $dao = null)
    {
        if (!is_subclass_of($class, Model::class))
            throw new DAOException("$class is not a valid Model");

        $this->dao[$class] = $dao;
        return $this;
    }