protected function getEntityGenerator()
    {
        $entityGenerator = new EntityGenerator();
        $entityGenerator->setFieldVisibility(EntityGenerator::FIELD_VISIBLE_PROTECTED);
        $entityGenerator->setGenerateAnnotations(false);
        $entityGenerator->setGenerateStubMethods(true);
        $entityGenerator->setRegenerateEntityIfExists(false);
        $entityGenerator->setUpdateEntityIfExists(true);
        $entityGenerator->setNumSpaces(4);
        $entityGenerator->setAnnotationPrefix('ORM\\');

        if ($this->configuration['with_interface']) {
            $entityGenerator->setClassToInterface($this->configuration['namespace'] . '\\' . $this->model.'Interface');
        }

        return $entityGenerator;
    }