Доктрина не может найти мою сущность в папке models
проекта.
Тестовый файл:
<?php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array("models"), $isDevMode);
$dbParams = array(
'driver' => 'pdo_mysql',
'user' => '',
'password' => '',
'dbname' => '',
);
$entityManager = EntityManager::create($dbParams, $config);
try {
/** @var \models\Vars $repo */
$repo = $entityManager->getRepository('Vars');
echo 'success';
} catch (Exception $e) {
echo $e->getMessage();
}
Модели / Варс:
<?php
namespace models;
use Doctrine\ORM\Annotation as ORM;
/**
* @ORM\Entity(name="Vars")
* @ORM\Table(name="vars")
*/
class Vars
{
}
Я новичок в php. В любом случае спасибо.