Last active
August 29, 2015 14:04
-
-
Save djandyr/a3a996560a3e6ea34f9f to your computer and use it in GitHub Desktop.
Skipper18: Generate Getters and Setters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "vendor/autoload.php"; | |
// The path to your entities generated by skipper18 | |
$entityPath = array(__DIR__."/Entities"); | |
$config = Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration($entityPath, true); | |
$config->setMetadataDriverImpl( | |
new Doctrine\ORM\Mapping\Driver\AnnotationDriver( | |
new Doctrine\Common\Annotations\CachedReader( | |
new Doctrine\Common\Annotations\AnnotationReader(), | |
new Doctrine\Common\Cache\ArrayCache() | |
), | |
$entityPath | |
) | |
); | |
$connectionOptions = array( | |
'driver' => 'pdo_sqlite', | |
'path' => 'database.sqlite' | |
); | |
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config); | |
$helpers = new Symfony\Component\Console\Helper\HelperSet(array( | |
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), | |
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment