Bisna's teachings 2.1 and 2.2 "@Table" annotations were never imported

I am using zend mvc along with the exercises 2.1 and 2.2 related to the bisna driver.

For a new project, I use the annotation driver just for convenience (i thout). As soon as I created my object from the database and tried to load them, but they continue to generate an error:

[Semantical Error] The annotation "@Table" in class MyWheels\Entity\Bmulog was never imported.

I tried adding the ORM \ prefix to them, but that did not solve it.

my config file read's:

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"

pluginPaths.Bisna\Application\Resource\ = "Bisna/Application/Resource"
autoloaderNamespaces[] = Bisna
autoloaderNamespaces[] = Doctrine
autoloaderNamespaces[] = MyWheels
autoloaderNamespaces[] = Symfony

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"

resources.doctrine.cache.instances.default.namespace    = "Application_"
resources.doctrine.dbal.connections.default.parameters.dbname   = "mywheels"
resources.doctrine.dbal.connections.default.parameters.user = "root"
resources.doctrine.dbal.connections.default.parameters.password = ""
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.adapterClass = "Doctrine\ORM\Mapping\Driver\AnnotationDriver"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingNamespace = "MyWheels\Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingDirs[] = APPLICATION_PATH "\..\library\MyWheels\Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderClass = "Doctrine\Common\Annotations\AnnotationReader" 

will anyone tell me what is going wrong here?

my entity code:

<?php

namespace MyWheels\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * MyWheels\Entity\Bmulog
 *
 * @Table(name="bmulog")
 * @Entity
 */
class Bmulog
{
    /**
     * @var integer $id
     *
     * @Column(name="id", type="integer", nullable=false)
     * @Id
     * @GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var text $request
     *
     * @Column(name="request", type="text", nullable=false)
     */
    private $request;

    /**
     * @var text $responce
     *
     * @Column(name="responce", type="text", nullable=false)
     */
    private $responce;

    /**
     * @var string $ip
     *
     * @Column(name="ip", type="string", length=200, nullable=false)
     */
    private $ip;

    /**
     * @var string $browser
     *
     * @Column(name="browser", type="string", length=200, nullable=false)
     */
    private $browser;

    /**
     * @var datetime $date
     *
     * @Column(name="date", type="datetime", nullable=false)
     */
    private $date;


}

Doctrine 2.2.0 leads to about the same error:

[Semantical Error] The annotation "@Doctrine\ORM\Mapping\Table" in class MyWheels\Entity\Bmulog does not exist, or could not be auto-loaded.
+5
source share
1 answer

Use Doctrine\ORM\Mappingimplies adding an import alias as a prefix for Doctrine annotation tags.

@ORM\Table
@ORM\Entity
@ORM\Column
@ORM\... (Any Doctrine annotation)
+5
source

All Articles