laravel-doctrine
laravel-doctrine copied to clipboard
Metadata Configuration with chainning
When using metadata with chainning, configured in /config/doctine.php, the Entities (with annotation) is not reconized.
'metadata' => [
'driver' => 'config',
[
'driver' => 'config'
],
[
'driver' => 'annotation'
// 'namespace' => 'App'
// 'alias' => 'DoctrineModel'
],
[
'driver' => 'yaml',
],
[
'driver' => 'xml'
],
[
'driver' => 'static'
]
]
I can use annotations entities, but i need to set to:
'metadata' => [
[
'driver' => 'annotation'
]
]
PS: I am using with Laravel 5.1
I think i am having the same issue... It keeps saying me that "No identifier/primary key specified for Entity "App\Test". Every Entity must have an identifier/primary key.", although the annotations are there!
I already tried the config you mentioned, but it didnt work for me.
Also Laravel 5.1.
Could you post your Model?
no big deal... just playing around.
namespace App;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="tests")
* @ORM\HasLifecycleCallbacks()
*/
class Test {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="text")
*/
protected $email;
// getters & setters
}
I am doing like this:
doctrine.php:
'metadata' => [
[
'driver' => 'annotation',
'namespace' => 'App'
]
]
Model:
/**
*
* @var int
* @ORM\Id
* @ORM\Column(name="dummy_id", type="integer", unique=true, nullable=false)
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
Did you tried to run "vendor\bin\doctrine orm:info"?
sorry, i was editing the package's doctrine.php file.
thank you for your help! :)
Relax! It happens =P
You're welcome!