Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>UPDATE: namespace Entities; has to be in the beginning of every Entity</p> <p>It's something with the autoloader. I'm very new to Doctrine 2 (even new to 1.2) but I think it's in your:</p> <pre><code> $classLoader = new \Doctrine\Common\ClassLoader('Entities', APPPATH.'doctrine'); $classLoader-&gt;register(); </code></pre> <p>Try adding a realpath(APPPATH.'doctrine'). I use Zend Framework so it looks a little different in the bootstrap but maybe it'll help:</p> <pre><code>/** * Initialize auto loader of Doctrine * * @return Doctrine_Manager */ protected function _initDoctrine() { $this-&gt;bootstrap('autoload'); require_once('Doctrine/Common/ClassLoader.php'); /* $classLoader = new \Doctrine\Common\ClassLoader('Doctrine'); $classLoader-&gt;setIncludePath(APPLICATION_PATH . '/../library/'); $classLoader-&gt;register();/* */ // Create the doctrine autoloader and remove it from the spl autoload stack (it adds itself) require_once 'Doctrine/Common/ClassLoader.php'; $doctrineAutoloader = array(new \Doctrine\Common\ClassLoader(), 'loadClass'); //$doctrineAutoloader-&gt;register(); spl_autoload_unregister($doctrineAutoloader); $autoloader = Zend_Loader_Autoloader::getInstance(); // Push the doctrine autoloader to load for the Doctrine\ namespace $autoloader-&gt;pushAutoloader($doctrineAutoloader, 'Doctrine'); $classLoader = new \Doctrine\Common\ClassLoader('Entities', realpath(__DIR__ . '/models/'), 'loadClass'); $autoloader-&gt;pushAutoloader(array($classLoader, 'loadClass'), 'Entities'); $classLoader = new \Doctrine\Common\ClassLoader('Symfony', realpath(__DIR__ . '/../library/Doctrine/'), 'loadClass'); $autoloader-&gt;pushAutoloader(array($classLoader, 'loadClass'), 'Symfony'); $doctrineConfig = $this-&gt;getOption('doctrine'); $config = new \Doctrine\ORM\Configuration(); $cache = new \Doctrine\Common\Cache\ArrayCache; $config-&gt;setMetadataCacheImpl($cache); $config-&gt;setQueryCacheImpl($cache); $driverImpl = new Doctrine\ORM\Mapping\Driver\YamlDriver(APPLICATION_PATH . '/configs/mappings/yaml'); //$driverImpl = $config-&gt;newDefaultAnnotationDriver($doctrineConfig['path']['entities']); $config-&gt;setMetadataDriverImpl($driverImpl); //$driverImpl = $config-&gt;newDefaultAnnotationDriver( // array($doctrineConfig['paths']['entities'])); //$config-&gt;setMetadataDriverImpl($driverImpl); $config-&gt;setProxyDir(APPLICATION_PATH . '/../proxies'); $config-&gt;setProxyNamespace('App\Proxies'); $connectionOptions = array( 'driver' =&gt; $doctrineConfig['conn']['driv'], 'user' =&gt; $doctrineConfig['conn']['user'], 'password' =&gt; $doctrineConfig['conn']['pass'], 'dbname' =&gt; $doctrineConfig['conn']['dbname'], 'host' =&gt; $doctrineConfig['conn']['host'] ); $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config); $eventManager = $em-&gt;getEventManager(); $eventManager-&gt;addEventSubscriber(new Maxlib_EventSubscriber_Sortable()); $registry = Zend_Registry::getInstance(); $registry-&gt;entitymanager = $em; return $em; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload