public function getRepository()
    {
        if (null == $this->repository) {
            $this->setRepository(
                Orm::getRepository($this->getEntityClassName())
            );
        }
        return $this->repository;
    }