#6613 #6614 simplifying entity definition - using auto-assigned string identifiers to reduce moving parts
This commit is contained in:
parent
874d60d8c7
commit
594e60d3f7
@ -10,7 +10,6 @@ namespace Doctrine\Tests\Models\DDC6613;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Entity(readOnly=true)
|
|
||||||
* @Table(name="ddc6613_phone")
|
* @Table(name="ddc6613_phone")
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -19,9 +18,13 @@ class Phone
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Id
|
* @Id
|
||||||
* @GeneratedValue
|
* @GeneratedValue(strategy="NONE")
|
||||||
* @Column(type="integer")
|
* @Column(type="integer")
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->id = uniqid('phone', true);
|
||||||
|
}
|
||||||
}
|
}
|
@ -20,10 +20,10 @@ class User
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Id
|
* @Id
|
||||||
* @GeneratedValue
|
* @GeneratedValue(strategy="NONE")
|
||||||
* @Column(type="integer")
|
* @Column(type="string")
|
||||||
*/
|
*/
|
||||||
public $id;
|
private $id;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,6 +36,7 @@ class User
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->id = uniqid('user', true);
|
||||||
$this->phones = new ArrayCollection();
|
$this->phones = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user