Bonsoir puis-je avoir un petit coup de pousse ? J’utilise doctrine 2.10.4 pour un petit projet là et je lance la commande de créations de table j’obtiens une erreur du type:
No Metadata Classes to process.
J’ai beau chercher je n’arrive pas à résoudre le problème.
Voici la configuration et ma class
<?php
####bootstrap.php
require implode(DIRECTORY_SEPARATOR,[dirname(__DIR__),"vendor","autoload.php"]);
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
// ...
$applicationMode="development";
if ($applicationMode == "development") {
$queryCache = new ArrayAdapter();
$metadataCache = new ArrayAdapter();
} else {
$queryCache = new PhpFilesAdapter('doctrine_queries');
$metadataCache = new PhpFilesAdapter('doctrine_metadata');
}
$config = new Configuration;
$config->setMetadataCache($metadataCache);
$driverImpl = $config->newDefaultAnnotationDriver(implode(DIRECTORY_SEPARATOR,[dirname(__DIR__),"src","Models"]));
$config->setMetadataDriverImpl($driverImpl);
$config->setQueryCache($queryCache);
$config->setProxyDir(implode(DIRECTORY_SEPARATOR,[dirname(__DIR__),"src","Proxies"]));
$config->setProxyNamespace('Graph\Proxies');
if ($applicationMode == "development") {
$config->setAutoGenerateProxyClasses(true);
} else {
$config->setAutoGenerateProxyClasses(false);
}
// database configuration parameters
$conn = array(
'driver' => 'pdo_sqlite',
'path' => dirname(__DIR__).'/db.sqlite',
);
// obtaining the entity manager
$entityManager = EntityManager::create($conn, $config);
return $entityManager;
<?php
namespace Graph\Models;
use Doctrine\ORM\Mapping as ORM;
/**
*@ORM\Entity
*@ORM\Table(name="users")
*/
class User extends Model{
/**
* @ORM\id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string")
*/
private $firstname;
/**
* @ORM\Column(type="string")
*/
private $lastname;
/**
* @ORM\Column(type="string")
*/
private $username;
/**
* @ORM\Column(type="string")
*/
private $email;
/**
* @ORM\Column(type="string")
*/
private $password;
/**
* @ORM\Column(type="string")
*/
private $image;
}
+0
-0