1
0
mirror of synced 2025-01-18 22:41:43 +03:00

#1277 DDC-3346 DDC-3531 - refactoring test assets for readability

This commit is contained in:
Marco Pivetta 2015-01-23 16:22:17 +01:00
parent 36bc448880
commit 04a271a04e
2 changed files with 10 additions and 8 deletions

View File

@ -8,21 +8,20 @@ namespace Doctrine\Tests\Models\DDC3346;
*/
class DDC3346Article
{
const CLASSNAME = 'Doctrine\Tests\Models\DDC3346\DDC3346Article';
const CLASSNAME = __CLASS__;
/**
* @Id
* @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
public $id;
/**
* @var DDC3346Author
*
* @ManyToOne(targetEntity="DDC3346Author", inversedBy="articles")
* @JoinColumn(name="user_id", referencedColumnName="id")
*/
public $user;
public function setAuthor(DDC3346Author $author)
{
$this->user = $author;
}
}

View File

@ -8,18 +8,21 @@ namespace Doctrine\Tests\Models\DDC3346;
*/
class DDC3346Author
{
const CLASSNAME = 'Doctrine\Tests\Models\DDC3346\DDC3346Author';
const CLASSNAME = __CLASS__;
/**
* @Id @Column(type="integer")
* @GeneratedValue
*/
public $id;
/**
* @Column(type="string", length=255, unique=true)
*/
public $username;
/**
* @OneToMany(targetEntity="DDC3346Article", mappedBy="user", fetch="EAGER", cascade={"detach"})
*/
public $articles;
public $articles = array();
}