From 2914c443441bf5ea84e166934b7e23f6d97042d6 Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Wed, 1 Sep 2010 13:23:46 -0500 Subject: [PATCH] Replacing "Entities" with "Entity" --- .../ConvertDoctrine1SchemaDoctrineCommand.php | 4 ++-- .../Command/GenerateEntitiesDoctrineCommand.php | 2 +- .../Command/GenerateEntityDoctrineCommand.php | 6 +++--- .../Command/ImportMappingDoctrineCommand.php | 4 ++-- src/Symfony/Bundle/DoctrineBundle/README | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/ConvertDoctrine1SchemaDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/ConvertDoctrine1SchemaDoctrineCommand.php index e370f65702..f36d219c35 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/ConvertDoctrine1SchemaDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/ConvertDoctrine1SchemaDoctrineCommand.php @@ -73,7 +73,7 @@ EOT $type = $input->getArgument('mapping-type') ? $input->getArgument('mapping-type') : 'xml'; if ($type === 'annotation') { - $destPath .= '/Entities'; + $destPath .= '/Entity'; } else { $destPath .= '/Resources/config/doctrine/metadata'; } @@ -98,7 +98,7 @@ EOT $output->writeln(sprintf('Converting Doctrine 1 schema "%s"', $input->getArgument('d1-schema'))); foreach ($metadata as $class) { $className = $class->name; - $class->name = $namespace.'\\'.$bundleClass.'\\Entities\\'.$className; + $class->name = $namespace.'\\'.$bundleClass.'\\Entity\\'.$className; if ($type === 'annotation') { $path = $destPath.'/'.$className.'.php'; } else { diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php index f78e1951ef..617b08da3a 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php @@ -55,7 +55,7 @@ EOT protected function execute(InputInterface $input, OutputInterface $output) { $filterBundle = $input->getOption('bundle') ? str_replace('/', '\\', $input->getOption('bundle')) : false; - $filterEntity = $filterBundle ? $filterBundle . '\\Entities\\' . str_replace('/', '\\', $input->getOption('entity')) : false; + $filterEntity = $filterBundle ? $filterBundle . '\\Entity\\' . str_replace('/', '\\', $input->getOption('entity')) : false; if (!isset($filterBundle) && isset($filterEntity)) { throw new \InvalidArgumentException(sprintf('Unable to specify an entity without also specifying a bundle.')); diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php index 6100d31dff..dc155e66af 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntityDoctrineCommand.php @@ -42,7 +42,7 @@ The doctrine:generate:entity task initializes a new Doctrine entity ./symfony doctrine:generate:entity "Bundle\MyCustomBundle" "User\Group" -The above would initialize a new entity in the following entity namespace Bundle\MyCustomBundle\Entities\User\Group. +The above would initialize a new entity in the following entity namespace Bundle\MyCustomBundle\Entity\User\Group. You can also optionally specify the fields you want to generate in the new entity: @@ -71,7 +71,7 @@ EOT } $entity = $input->getArgument('entity'); - $entityNamespace = $namespace.'\\'.$bundle.'\\Entities'; + $entityNamespace = $namespace.'\\'.$bundle.'\\Entity'; $fullEntityClassName = $entityNamespace.'\\'.$entity; $tmp = str_replace('\\', '/', $fullEntityClassName); $tmp = str_replace('/', '\\', dirname($tmp)); @@ -108,7 +108,7 @@ EOT $exporter = $cme->getExporter($mappingType); if ($mappingType === 'annotation') { - $path = $dirs[$namespace].'/'.$bundle.'/Entities/'.str_replace($entityNamespace.'\\', null, $fullEntityClassName).'.php'; + $path = $dirs[$namespace].'/'.$bundle.'/Entity/'.str_replace($entityNamespace.'\\', null, $fullEntityClassName).'.php'; $exporter->setEntityGenerator($this->getEntityGenerator()); } else { diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php index 441f2fe1ac..016871a2c4 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php @@ -71,7 +71,7 @@ EOT $type = $input->getArgument('mapping-type') ? $input->getArgument('mapping-type') : 'xml'; if ($type === 'annotation') { - $destPath .= '/Entities'; + $destPath .= '/Entity'; } else { $destPath .= '/Resources/config/doctrine/metadata'; } @@ -99,7 +99,7 @@ EOT $output->writeln(sprintf('Importing mapping information from "%s" entity manager', $emName)); foreach ($metadata as $class) { $className = $class->name; - $class->name = $namespace.'\\'.$bundleClass.'\\Entities\\'.$className; + $class->name = $namespace.'\\'.$bundleClass.'\\Entity\\'.$className; if ($type === 'annotation') { $path = $destPath.'/'.$className.'.php'; } else { diff --git a/src/Symfony/Bundle/DoctrineBundle/README b/src/Symfony/Bundle/DoctrineBundle/README index c15fe7aeee..91111f19b7 100644 --- a/src/Symfony/Bundle/DoctrineBundle/README +++ b/src/Symfony/Bundle/DoctrineBundle/README @@ -89,7 +89,7 @@ path for the **GuestbookBundle** we created above: Any files found in here that have a suffix of **.dcm.xml** (or whatever mapping_driver you picked) are used as your entities mapping information. -In the **GuestbookBundle** we have a file named **Bundle.GuestbookBundle.Entities.Entry.dcm.xml** +In the **GuestbookBundle** we have a file named **Bundle.GuestbookBundle.Entity.Entry.dcm.xml** which contains the following XML: @@ -99,7 +99,7 @@ which contains the following XML: xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + @@ -121,13 +121,13 @@ mapping information with the command: $ php console doctrine:generate:entities -Now if you have a look in the bundles **Entities** directory you will see a new +Now if you have a look in the bundles **Entity** directory you will see a new file named **Entry.php** with some code like the following: [php] - // Bundle/GuestbookBundle/Entities/Entry.php + // Bundle/GuestbookBundle/Entity/Entry.php - namespace Bundle\GuestbookBundle\Entities; + namespace Bundle\GuestbookBundle\Entity; /** * @Entity @@ -214,7 +214,7 @@ You can easily generate a new Doctrine entity for a bundle by using the $ php console doctrine:generate:entity "Bundle\MySampleBundle" "User\Group" --fields="name:string(255) description:text" Now if you have a look inside the bundle you will see that you have a **Group** class -located here **Bundle/MySampleBundle/Entities/User/Group.php**. +located here **Bundle/MySampleBundle/Entity/User/Group.php**. Now you can customize the mapping information for the entity by editing the metadata information inside **Bundle/MySampleBundle/Resources/config/doctrine/metadata** and