-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix one to one inverse side cached entity association key generation
- Loading branch information
1 parent
3a44a3d
commit dc9f31d
Showing
8 changed files
with
265 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace Doctrine\Tests\Models\Cache; | ||
|
||
/** | ||
* @Entity | ||
* @Table("cache_client_address") | ||
*/ | ||
class Address | ||
{ | ||
const CLASSNAME = __CLASS__; | ||
|
||
/** | ||
* @Id | ||
* @GeneratedValue | ||
* @Column(type="integer") | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @JoinColumn(name="person_id", referencedColumnName="id") | ||
* @OneToOne(targetEntity="Person", inversedBy="address") | ||
*/ | ||
protected $person; | ||
|
||
/** | ||
* @Column | ||
*/ | ||
protected $location; | ||
|
||
public function __construct($location) | ||
{ | ||
$this->location = $location; | ||
} | ||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
public function getPerson() | ||
{ | ||
return $this->person; | ||
} | ||
|
||
public function setPerson(Person $person) | ||
{ | ||
$this->person = $person; | ||
} | ||
|
||
public function getLocation() | ||
{ | ||
return $this->location; | ||
} | ||
|
||
public function setLocation($location) | ||
{ | ||
$this->location = $location; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
namespace Doctrine\Tests\Models\Cache; | ||
|
||
/** | ||
* @Entity | ||
* @Table("cache_person") | ||
* @Cache("NONSTRICT_READ_WRITE") | ||
*/ | ||
class Person | ||
{ | ||
const CLASSNAME = __CLASS__; | ||
|
||
/** | ||
* @Id | ||
* @GeneratedValue | ||
* @Column(type="integer") | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @Column(unique=true) | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* @OneToOne(targetEntity="Address", mappedBy="person") | ||
*/ | ||
private $address; | ||
|
||
public function __construct($name) | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function setName($name) | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
/** | ||
* @return Address | ||
*/ | ||
public function getAddress() | ||
{ | ||
return $this->address; | ||
} | ||
|
||
/** | ||
* @param Address $address | ||
*/ | ||
public function setAddress(Address $address) | ||
{ | ||
$this->address = $address; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters