Skip to content

Instantly share code, notes, and snippets.

@hpatoio
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hpatoio/d98fe1f6d456544b5795 to your computer and use it in GitHub Desktop.
Save hpatoio/d98fe1f6d456544b5795 to your computer and use it in GitHub Desktop.
ID Doctrine
<?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