1
0
mirror of synced 2025-02-02 21:41:45 +03:00

#6613 #6614 simplifying entity definition - using auto-assigned string identifiers to reduce moving parts

This commit is contained in:
Marco Pivetta 2017-08-11 14:19:01 +02:00
parent 874d60d8c7
commit 594e60d3f7
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629
2 changed files with 9 additions and 5 deletions

View File

@ -10,7 +10,6 @@ namespace Doctrine\Tests\Models\DDC6613;
/**
* @Entity(readOnly=true)
* @Table(name="ddc6613_phone")
*/
@ -19,9 +18,13 @@ class Phone
/**
* @Id
* @GeneratedValue
* @GeneratedValue(strategy="NONE")
* @Column(type="integer")
*/
public $id;
public function __construct()
{
$this->id = uniqid('phone', true);
}
}

View File

@ -20,10 +20,10 @@ class User
/**
* @Id
* @GeneratedValue
* @Column(type="integer")
* @GeneratedValue(strategy="NONE")
* @Column(type="string")
*/
public $id;
private $id;
/**
@ -36,6 +36,7 @@ class User
*/
public function __construct()
{
$this->id = uniqid('user', true);
$this->phones = new ArrayCollection();
}