Quantcast
Channel: Commentaires sur : Add new Data Type in Doctrine 2 in Symfony 2
Browsing all 11 articles
Browse latest View live

Par : Toby Batch

Great post. I’m already half way to success with this but I’m hitting a little problem (I’m a bit of a n00b). Where are the Bundle or Generic Bundle, on what path relative to the Symfony2 root? Also I...

View Article



Par : Jordan Samouh

in your bundle which uses the new type, add the code in the function boot in the main class of your bundle. Exemple: You have MyBundle/MyBundle.php in scr folder. add the code in the function boot()...

View Article

Par : Jeppe

Hey Where do you place the $em = Doctrine\ORM\EntityManager::create($conn, $config, $evm); line? I’m trying to do this in the bundles boot() method, but i dont have access to $conn, $config or $evm in...

View Article

Par : Jordan Samouh

try $em = $this->container->get(‘doctrine.orm.default_entity_manager’); to get the entity manager

View Article

Par : Jeppe

IT worked, thanks a lot Jordan. For anyone else, note that the EM is not present during build(), so it needs to be placed in boot(). I ended up having the following: public function boot() {...

View Article


Par : Symfony 2: Personnaliser les champs de la table générée par...

[...] de jouer avec mon entité User. Indirectement elle me permet de:Donner des types non supportés (par défaut) par Doctrine, tels que tinyint, timestamp ou encore longtext.J’ai aussi la possibilité...

View Article

Par : YoGis

To Jeppe, I would like to add support for geometry_columns. I added the following in my bundle : use Doctrine\DBAL\Types\Type; class geolocHelloBundle extends Bundle { public function boot() {...

View Article

Par : Markus Siebeneicher

Thanks for the article, helped me well. I had just to do some modification of the namespace structure! Bon courage!

View Article


Par : Christian Burger

Nice, thx. Just want to add, that when using boot() to register the new type like Jeppe proposed, it helps to surround the whole type registration with if(!Type::hasType('longblob')) { [...] } or else...

View Article


Par : Justin Finkelstein

For those using Symfony 2 who need a TINYINT, here’s a solution: https://gist.github.com/ilithium/3b8237a86e4db0fee8d1

View Article

Par : Jose Celano

You can also add the type using config.yml file: doctrine: dbal: driver: « %database_driver% » host: « %database_host% » port: « %database_port% » dbname: « %database_name% » user: « %database_user% »...

View Article
Browsing all 11 articles
Browse latest View live




Latest Images