I'm getting a well-known error for Doctrine, but nothing seems to work.
[Semantical Error] The annotation "@Doctrine\ORM\Mapping\Entity" in class ac\User\Entity\User does not exist, or could not be auto-loaded.
My class starts off like this:
<?php
namespace ac\User\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class User
My cli-config.php
<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src/Entity"), $isDevMode);
// database configuration parameters
$conn = array(
'driver' => 'pdo_mysql',
);
// obtaining the entity manager
$entityManager = EntityManager::create($conn, $config);
return ConsoleRunner::createHelperSet($entityManager);
There must be 100 questions out there about this. Doctrine really needs to come to a consensus on this.