Ejemplo n.º 1
0
<?php

/**
 * (c) Axoloth
 * herbertExtrademo
 * 
 * this code is call when th plugin is activate in Wordpress.
 * Here we create the table using the Doctrine SchemaTool
 * and our entities definitions.
 * 
 * Schema will be drop when the plugin will be desactivate in Wordpress: see desactivate.php
 */
use Axoloth\HerbertExtra\Doctrine\Doctrine;
use Doctrine\ORM\Tools\SchemaTool;
$em = Doctrine::getInstance()->getEntityManager();
$tool = new SchemaTool($em);
$classes = array($em->getClassMetadata('HerbertExtraDemo\\Models\\Entity\\Author'));
$tool->createSchema($classes);
Ejemplo n.º 2
0
 public function __construct(Container $container, $concrete)
 {
     $this->entityManager = Doctrine::getInstance()->getEntityManager();
     $this->formFactory = SymfonyForm::getInstance()->getFormFactory();
 }