PHP Класс Sensio\Bundle\GeneratorBundle\Generator\DoctrineCrudGenerator

Автор: Fabien Potencier ([email protected])
Наследование: extends Sensio\Bundle\GeneratorBundle\Generator\Generator
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Symfony\Component\HttpKernel\Util\Filesystem $filesystem, string $skeletonDir ) Constructor.
generate ( Symfony\Component\HttpKernel\Bundle\BundleInterface $bundle, string $entity, Doctrine\ORM\Mapping\ClassMetadataInfo $metadata, string $format, string $routePrefix, array $needWriteActions ) Generate the CRUD controller.

Приватные методы

Метод Описание
generateConfiguration ( ) Generates the routing configuration.
generateControllerClass ( ) Generates the controller class only.
generateEditView ( string $dir ) Generates the edit.html.twig template in the final bundle.
generateIndexView ( string $dir ) Generates the index.html.twig template in the final bundle.
generateNewView ( string $dir ) Generates the new.html.twig template in the final bundle.
generateShowView ( string $dir ) Generates the show.html.twig template in the final bundle.
generateTestClass ( ) Generates the functional test class only.
getRecordActions ( ) : array Returns an array of record actions to generate (edit, show).
setFormat ( string $format ) Sets the configuration format.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( Symfony\Component\HttpKernel\Util\Filesystem $filesystem, string $skeletonDir )
$filesystem Symfony\Component\HttpKernel\Util\Filesystem A Filesystem instance
$skeletonDir string Path to the skeleton directory

generate() публичный Метод

Generate the CRUD controller.
public generate ( Symfony\Component\HttpKernel\Bundle\BundleInterface $bundle, string $entity, Doctrine\ORM\Mapping\ClassMetadataInfo $metadata, string $format, string $routePrefix, array $needWriteActions )
$bundle Symfony\Component\HttpKernel\Bundle\BundleInterface A bundle object
$entity string The entity relative class name
$metadata Doctrine\ORM\Mapping\ClassMetadataInfo The entity class metadata
$format string The configuration format (xml, yaml, annotation)
$routePrefix string The route name prefix
$needWriteActions array Wether or not to generate write actions