Source for file DoctrineORMCommand.php
Documentation is available at DoctrineORMCommand.php
use Symfony\ Component\ Console\ Helper\ HelperSet,
Symfony\ Component\ Console\ Helper\ DialogHelper,
Doctrine\ DBAL\ Tools\ Console\ Helper\ ConnectionHelper,
Doctrine\ ORM\ Tools\ Console\ Helper\ EntityManagerHelper;
* This command adds the Doctrine 2 CLI to the list of options in the yiic tool. You must
* configure protected/config/console.php with the same information as set out in your
* main.php including the component and Wildkat alias.
* This command file should then live in protected/commands
* @category YiiExtensions
* @package Wildkat\YiiExt\DoctrineOrm
* @author Kevin Bradwick <kevin@wildk.at>
* @license New BSD http://www.opensource.org/licenses/bsd-license.php
* @version Release: ##VERSION##
* @link http://www.wildk.at
* This gets executed when the command runs
unset ($_SERVER['argv'][1]);
$cmd = new \ Doctrine\ DBAL\ Tools\ Console\ Command\ RunSqlCommand();
$cmd = new \ Doctrine\ DBAL\ Tools\ Console\ Command\ ImportCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ ClearCache\ MetadataCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ ClearCache\ ResultCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ ClearCache\ QueryCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ SchemaTool\ CreateCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ SchemaTool\ UpdateCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ SchemaTool\ DropCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ EnsureProductionSettingsCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ ConvertDoctrine1SchemaCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ GenerateRepositoriesCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ GenerateEntitiesCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ GenerateProxiesCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ ConvertMappingCommand();
$cmd = new \ Doctrine\ ORM\ Tools\ Console\ Command\ RunDqlCommand();
* Returns the default entity manager
* @return Doctrine\ORM\EntityManager
return Yii::app()->doctrine->getEntityManager();
}//end getEntityManager()
* @return Symfony\component\Console\Application
$helperSet = new HelperSet(
'db' => new ConnectionHelper($em->getConnection()),
'em' => new EntityManagerHelper($em),
'dialog' => new DialogHelper(),
$cli = new Symfony\ Component\ Console\ Application(
'Doctrine Command Line Interface',
Doctrine\ Common\ Version::VERSION
$cli->setHelperSet($helperSet);
$cli->setCatchExceptions(true);
|