[DoctrineBundle] fixed CS

This commit is contained in:
Fabien Potencier 2011-05-01 23:01:52 +02:00
parent 0029cbc397
commit 3286819145
18 changed files with 149 additions and 111 deletions

View File

@ -28,16 +28,18 @@ class CreateDatabaseDoctrineCommand extends DoctrineCommand
{ {
$this $this
->setName('doctrine:database:create') ->setName('doctrine:database:create')
->setDescription('Create the configured databases.') ->setDescription('Create the configured databases')
->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command.') ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:database:create</info> command creates the default connections database: The <info>doctrine:database:create</info> command creates the default
connections database:
<info>./app/console doctrine:database:create</info> <info>./app/console doctrine:database:create</info>
You can also optionally specify the name of a connection to create the database for: You can also optionally specify the name of a connection to create the
database for:
<info>./app/console doctrine:database:create --connection=default</info> <info>./app/console doctrine:database:create --connection=default</info>
EOT EOT
); );
} }

View File

@ -27,21 +27,24 @@ class DropDatabaseDoctrineCommand extends DoctrineCommand
{ {
$this $this
->setName('doctrine:database:drop') ->setName('doctrine:database:drop')
->setDescription('Drop the configured databases.') ->setDescription('Drop the configured databases')
->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command.') ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command')
->addOption('force', null, InputOption::VALUE_NONE, 'Set this parameter to execute this action.') ->addOption('force', null, InputOption::VALUE_NONE, 'Set this parameter to execute this action')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:database:drop</info> command drops the default connections database: The <info>doctrine:database:drop</info> command drops the default connections
database:
<info>./app/console doctrine:database:drop</info> <info>./app/console doctrine:database:drop</info>
The --force parameter has to be used to actually drop the database. The --force parameter has to be used to actually drop the database.
You can also optionally specify the name of a connection to drop the database for: You can also optionally specify the name of a connection to drop the database
for:
<info>./app/console doctrine:database:drop --connection=default</info> <info>./app/console doctrine:database:drop --connection=default</info>
<error>Be careful: All data in a given database will be lost when executing this command.</error> <error>Be careful: All data in a given database will be lost when executing
this command.</error>
EOT EOT
); );
} }

View File

@ -28,21 +28,23 @@ class GenerateEntitiesDoctrineCommand extends DoctrineCommand
{ {
$this $this
->setName('doctrine:generate:entities') ->setName('doctrine:generate:entities')
->setDescription('Generate entity classes and method stubs from your mapping information.') ->setDescription('Generate entity classes and method stubs from your mapping information')
->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to initialize the entity or entities in.') ->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to initialize the entity or entities in')
->addOption('entity', null, InputOption::VALUE_OPTIONAL, 'The entity class to initialize (shortname without namespace).') ->addOption('entity', null, InputOption::VALUE_OPTIONAL, 'The entity class to initialize (shortname without namespace)')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:generate:entities</info> command generates entity classes and method stubs from your mapping information: The <info>doctrine:generate:entities</info> command generates entity classes
and method stubs from your mapping information:
You have to limit generation of entities to an individual bundle: You have to limit generation of entities to an individual bundle:
<info>./app/console doctrine:generate:entities MyCustomBundle</info> <info>./app/console doctrine:generate:entities MyCustomBundle</info>
Alternatively, you can limit generation to a single entity within a bundle: Alternatively, you can limit generation to a single entity within a bundle:
<info>./app/console doctrine:generate:entities "MyCustomBundle" --entity="User"</info> <info>./app/console doctrine:generate:entities "MyCustomBundle" --entity="User"</info>
You have to specify the shortname (without namespace) of the entity you want to filter for. You have to specify the shortname (without namespace) of the entity you want
to filter for.
EOT EOT
); );
} }

View File

@ -30,21 +30,24 @@ class GenerateEntityDoctrineCommand extends DoctrineCommand
{ {
$this $this
->setName('doctrine:generate:entity') ->setName('doctrine:generate:entity')
->setDescription('Generate a new Doctrine entity inside a bundle.') ->setDescription('Generate a new Doctrine entity inside a bundle')
->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to initialize the entity in.') ->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to initialize the entity in')
->addArgument('entity', InputArgument::REQUIRED, 'The entity class to initialize.') ->addArgument('entity', InputArgument::REQUIRED, 'The entity class to initialize')
->addOption('mapping-type', null, InputOption::VALUE_OPTIONAL, 'The mapping type to to use for the entity.', 'xml') ->addOption('mapping-type', null, InputOption::VALUE_OPTIONAL, 'The mapping type to to use for the entity', 'xml')
->addOption('fields', null, InputOption::VALUE_OPTIONAL, 'The fields to create with the new entity.') ->addOption('fields', null, InputOption::VALUE_OPTIONAL, 'The fields to create with the new entity')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:generate:entity</info> task initializes a new Doctrine entity inside a bundle: The <info>doctrine:generate:entity</info> task initializes a new Doctrine
entity inside a bundle:
<info>./app/console doctrine:generate:entity "MyCustomBundle" "User\Group"</info> <info>./app/console doctrine:generate:entity "MyCustomBundle" "User\Group"</info>
The above would initialize a new entity in the following entity namespace <info>Bundle\MyCustomBundle\Entity\User\Group</info>. The above would initialize a new entity in the following entity namespace
<info>Bundle\MyCustomBundle\Entity\User\Group</info>.
You can also optionally specify the fields you want to generate in the new entity: You can also optionally specify the fields you want to generate in the new
entity:
<info>./app/console doctrine:generate:entity "MyCustomBundle" "User\Group" --fields="name:string(255) description:text"</info> <info>./app/console doctrine:generate:entity "MyCustomBundle" "User\Group" --fields="name:string(255) description:text"</info>
EOT EOT
); );
} }

View File

@ -29,13 +29,14 @@ class GenerateRepositoriesDoctrineCommand extends DoctrineCommand
{ {
$this $this
->setName('doctrine:generate:repositories') ->setName('doctrine:generate:repositories')
->setDescription('Generate repository classes from your mapping information.') ->setDescription('Generate repository classes from your mapping information')
->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to initialize the repositories in.') ->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to initialize the repositories in')
->addOption('entity', null, InputOption::VALUE_OPTIONAL, 'The entity class to generate the repository for (shortname without namespace).') ->addOption('entity', null, InputOption::VALUE_OPTIONAL, 'The entity class to generate the repository for (shortname without namespace)')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:generate:repositories</info> command generates the configured entity repository classes from your mapping information: The <info>doctrine:generate:repositories</info> command generates the
configured entity repository classes from your mapping information:
<info>./app/console doctrine:generate:repositories</info> <info>./app/console doctrine:generate:repositories</info>
EOT EOT
); );
} }

View File

@ -31,18 +31,20 @@ class ImportMappingDoctrineCommand extends DoctrineCommand
{ {
$this $this
->setName('doctrine:mapping:import') ->setName('doctrine:mapping:import')
->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to import the mapping information to.') ->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to import the mapping information to')
->addArgument('mapping-type', InputArgument::OPTIONAL, 'The mapping type to export the imported mapping information to.') ->addArgument('mapping-type', InputArgument::OPTIONAL, 'The mapping type to export the imported mapping information to')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setDescription('Import mapping information from an existing database.') ->setDescription('Import mapping information from an existing database')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:mapping:import</info> command imports mapping information from an existing database: The <info>doctrine:mapping:import</info> command imports mapping information
from an existing database:
<info>./app/console doctrine:mapping:import "MyCustomBundle" xml</info> <info>./app/console doctrine:mapping:import "MyCustomBundle" xml</info>
You can also optionally specify which entity manager to import from with the <info>--em</info> option: You can also optionally specify which entity manager to import from with the
<info>--em</info> option:
<info>./app/console doctrine:mapping:import "MyCustomBundle" xml --em=default</info> <info>./app/console doctrine:mapping:import "MyCustomBundle" xml --em=default</info>
EOT EOT
); );
} }

View File

@ -27,17 +27,19 @@ class InfoDoctrineCommand extends DoctrineCommand
{ {
$this $this
->setName('doctrine:mapping:info') ->setName('doctrine:mapping:info')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setDescription('Show basic information about all mapped entities.') ->setDescription('Show basic information about all mapped entities')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:mapping:info</info> shows basic information about which The <info>doctrine:mapping:info</info> shows basic information about which
entities exist and possibly if their mapping information contains errors or not. entities exist and possibly if their mapping information contains errors or
not.
<info>./app/console doctrine:mapping:info</info> <info>./app/console doctrine:mapping:info</info>
If you are using multiple entity managers you can pick your choice with the <info>--em</info> option: If you are using multiple entity managers you can pick your choice with the
<info>--em</info> option:
<info>./app/console doctrine:mapping:info --em=default</info> <info>./app/console doctrine:mapping:info --em=default</info>
EOT EOT
); );
} }

View File

@ -30,16 +30,18 @@ class ClearMetadataCacheDoctrineCommand extends MetadataCommand
$this $this
->setName('doctrine:cache:clear-metadata') ->setName('doctrine:cache:clear-metadata')
->setDescription('Clear all metadata cache for a entity manager.') ->setDescription('Clear all metadata cache for a entity manager')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:cache:clear-metadata</info> command clears all metadata cache for the default entity manager: The <info>doctrine:cache:clear-metadata</info> command clears all metadata
cache for the default entity manager:
<info>./app/console doctrine:cache:clear-metadata</info> <info>./app/console doctrine:cache:clear-metadata</info>
You can also optionally specify the <comment>--em</comment> option to specify which entity manager to clear the cache for: You can also optionally specify the <comment>--em</comment> option to specify
which entity manager to clear the cache for:
<info>./app/console doctrine:cache:clear-metadata --em=default</info> <info>./app/console doctrine:cache:clear-metadata --em=default</info>
EOT EOT
); );
} }

View File

@ -30,16 +30,18 @@ class ClearQueryCacheDoctrineCommand extends QueryCommand
$this $this
->setName('doctrine:cache:clear-query') ->setName('doctrine:cache:clear-query')
->setDescription('Clear all query cache for a entity manager.') ->setDescription('Clear all query cache for a entity manager')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:cache:clear-query</info> command clears all query cache for the default entity manager: The <info>doctrine:cache:clear-query</info> command clears all query cache for
the default entity manager:
<info>./app/console doctrine:cache:clear-query</info> <info>./app/console doctrine:cache:clear-query</info>
You can also optionally specify the <comment>--em</comment> option to specify which entity manager to clear the cache for: You can also optionally specify the <comment>--em</comment> option to specify
which entity manager to clear the cache for:
<info>./app/console doctrine:cache:clear-query --em=default</info> <info>./app/console doctrine:cache:clear-query --em=default</info>
EOT EOT
); );
} }

View File

@ -30,28 +30,33 @@ class ClearResultCacheDoctrineCommand extends ResultCommand
$this $this
->setName('doctrine:cache:clear-result') ->setName('doctrine:cache:clear-result')
->setDescription('Clear result cache for a entity manager.') ->setDescription('Clear result cache for a entity manager')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:cache:clear-result</info> command clears all result cache for the default entity manager: The <info>doctrine:cache:clear-result</info> command clears all result cache
for the default entity manager:
<info>./app/console doctrine:cache:clear-result</info> <info>./app/console doctrine:cache:clear-result</info>
You can also optionally specify the <comment>--em</comment> option to specify which entity manager to clear the cache for: You can also optionally specify the <comment>--em</comment> option to specify
which entity manager to clear the cache for:
<info>./app/console doctrine:cache:clear-result --em=default</info> <info>./app/console doctrine:cache:clear-result --em=default</info>
If you don't want to clear all result cache you can specify some additional options to control what cache is deleted: If you don't want to clear all result cache you can specify some additional
options to control what cache is deleted:
<info>./app/console doctrine:cache:clear-result --id=cache_key</info> <info>./app/console doctrine:cache:clear-result --id=cache_key</info>
Or you can specify a <comment>--regex</comment> to delete cache entries that match it: Or you can specify a <comment>--regex</comment> to delete cache entries that
match it:
<info>./app/console doctrine:cache:clear-result --regex="user_(.*)"</info> <info>./app/console doctrine:cache:clear-result --regex="user_(.*)"</info>
You can also specify a <comment>--prefix</comment> or <comment>--suffix</comment> to delete cache entries for: You can also specify a <comment>--prefix</comment> or
<comment>--suffix</comment> to delete cache entries for:
<info>./app/console doctrine:cache:clear-result --prefix="user_" --suffix="_frontend"</info> <info>./app/console doctrine:cache:clear-result --prefix="user_" --suffix="_frontend"</info>
EOT EOT
); );
} }

View File

@ -32,11 +32,12 @@ class ConvertMappingDoctrineCommand extends ConvertMappingCommand
parent::configure(); parent::configure();
$this $this
->setName('doctrine:mapping:convert') ->setName('doctrine:mapping:convert')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:mapping:convert</info> command converts mapping information between supported formats: The <info>doctrine:mapping:convert</info> command converts mapping information
between supported formats:
<info>./app/console doctrine:mapping:convert xml /path/to/output</info> <info>./app/console doctrine:mapping:convert xml /path/to/output</info>
EOT EOT
); );
} }

View File

@ -32,15 +32,17 @@ class CreateSchemaDoctrineCommand extends CreateCommand
$this $this
->setName('doctrine:schema:create') ->setName('doctrine:schema:create')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:schema:create</info> command creates the default entity managers schema: The <info>doctrine:schema:create</info> command creates the default entity
managers schema:
<info>./app/console doctrine:schema:create</info> <info>./app/console doctrine:schema:create</info>
You can also optionally specify the name of a entity manager to create the schema for: You can also optionally specify the name of a entity manager to create the
schema for:
<info>./app/console doctrine:schema:create --em=default</info> <info>./app/console doctrine:schema:create --em=default</info>
EOT EOT
); );
} }

View File

@ -32,15 +32,17 @@ class DropSchemaDoctrineCommand extends DropCommand
$this $this
->setName('doctrine:schema:drop') ->setName('doctrine:schema:drop')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:schema:drop</info> command drops the default entity managers schema: The <info>doctrine:schema:drop</info> command drops the default entity
managers schema:
<info>./app/console doctrine:schema:drop</info> <info>./app/console doctrine:schema:drop</info>
You can also optionally specify the name of a entity manager to drop the schema for: You can also optionally specify the name of a entity manager to drop the
schema for:
<info>./app/console doctrine:schema:drop --em=default</info> <info>./app/console doctrine:schema:drop --em=default</info>
EOT EOT
); );
} }

View File

@ -32,15 +32,17 @@ class EnsureProductionSettingsDoctrineCommand extends EnsureProductionSettingsCo
$this $this
->setName('doctrine:ensure-production-settings') ->setName('doctrine:ensure-production-settings')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:ensure-production-settings</info> command ensures that Doctrine is properly configured for a production environment.: The <info>doctrine:ensure-production-settings</info> command ensures that
Doctrine is properly configured for a production environment.:
<info>./app/console doctrine:ensure-production-settings</info> <info>./app/console doctrine:ensure-production-settings</info>
You can also optionally specify the <comment>--em</comment> option to specify which entity manager to use: You can also optionally specify the <comment>--em</comment> option to specify
which entity manager to use:
<info>./app/console doctrine:ensure-production-settings --em=default</info> <info>./app/console doctrine:ensure-production-settings --em=default</info>
EOT EOT
); );
} }

View File

@ -32,15 +32,16 @@ class GenerateProxiesDoctrineCommand extends GenerateProxiesCommand
$this $this
->setName('doctrine:generate:proxies') ->setName('doctrine:generate:proxies')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:generate:proxies</info> command generates proxy classes for your default entity manager: The <info>doctrine:generate:proxies</info> command generates proxy classes for
your default entity manager:
<info>./app/console doctrine:generate:proxies</info> <info>./app/console doctrine:generate:proxies</info>
You can specify the entity manager you want to generate the proxies for: You can specify the entity manager you want to generate the proxies for:
<info>./app/console doctrine:generate:proxies --em=name</info> <info>./app/console doctrine:generate:proxies --em=name</info>
EOT EOT
); );
} }

View File

@ -32,19 +32,22 @@ class RunDqlDoctrineCommand extends RunDqlCommand
$this $this
->setName('doctrine:query:dql') ->setName('doctrine:query:dql')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:query:dql</info> command executes the given DQL query and outputs the results: The <info>doctrine:query:dql</info> command executes the given DQL query and
outputs the results:
<info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u"</info> <info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u"</info>
You can also optional specify some additional options like what type of hydration to use when executing the query: You can also optional specify some additional options like what type of
hydration to use when executing the query:
<info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --hydrate=array</info> <info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --hydrate=array</info>
Additionally you can specify the first result and maximum amount of results to show: Additionally you can specify the first result and maximum amount of results to
show:
<info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30</info> <info>./app/console doctrine:query:dql "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30</info>
EOT EOT
); );
} }

View File

@ -32,11 +32,12 @@ class RunSqlDoctrineCommand extends RunSqlCommand
$this $this
->setName('doctrine:query:sql') ->setName('doctrine:query:sql')
->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command.') ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:query:sql</info> command executes the given DQL query and outputs the results: The <info>doctrine:query:sql</info> command executes the given DQL query and
outputs the results:
<info>./app/console doctrine:query:sql "SELECT * from user"</info> <info>./app/console doctrine:query:sql "SELECT * from user"</info>
EOT EOT
); );
} }

View File

@ -32,15 +32,17 @@ class UpdateSchemaDoctrineCommand extends UpdateCommand
$this $this
->setName('doctrine:schema:update') ->setName('doctrine:schema:update')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
->setHelp(<<<EOT ->setHelp(<<<EOT
The <info>doctrine:schema:update</info> command updates the default entity managers schema: The <info>doctrine:schema:update</info> command updates the default entity
managers schema:
<info>./app/console doctrine:schema:update</info> <info>./app/console doctrine:schema:update</info>
You can also optionally specify the name of a entity manager to update the schema for: You can also optionally specify the name of a entity manager to update the
schema for:
<info>./app/console doctrine:schema:update --em=default</info> <info>./app/console doctrine:schema:update --em=default</info>
EOT EOT
); );
} }