Last active
August 29, 2015 14:11
-
-
Save hpatoio/d98fe1f6d456544b5795 to your computer and use it in GitHub Desktop.
ID Doctrine
This file contains hidden or 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
<?php | |
namespace My\Model; | |
/** | |
* @ORM\Table(name="user") | |
* @ORM\Entity() | |
*/ | |
class User | |
{ | |
/** | |
* @var text | |
* | |
* @ORM\Id | |
* @ORM\Column(name="code", type="string", length=20) | |
*/ | |
private $code; | |
/** | |
* @ORM\OneToMany(targetEntity="My\Model\Program", mappedBy="user") | |
* @ORM\JoinColumn(name="code", referencedColumnName="user_code") | |
*/ | |
private $programs; | |
public function setCode($code) { | |
$this->code = $code; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment