final public function getRepository()
    {
        $repositories = &Application::current()->getSharedArray("ModelRepositories");
        if (!isset($repositories[$this->modelName])) {
            $repositories[$this->modelName] = $this->createRepository();
        }

        return $repositories[$this->modelName];
    }