public function getDAO(string $class)
    {
        if (!isset($this->dao[$class]))
        {
            if (!is_subclass_of($class, Model::class))
                throw new DAOException("$class is not a valid Model");

            $tablename = $class::getTablename();
            $dao = DI::getInjector()->newInstance(
                DAO::class,
                ['classname' => $class, 'tablename' => $tablename, 'db' => $this]
            );
            $this->dao[$class] = $dao;
        }

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