« Programmation PHP avec Symfony/Doctrine » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 53 :
 
/**
* @ORM\Column(name="pronunciationspelling", type="string", length=100255, nullable=truefalse)
*/
private $spelling;
 
/**
* @ORM\Column(name="pronunciation", type="string", length=255, nullable=true)
*/
private $pronunciation;
Ligne 76 ⟶ 81 :
{
$this->homophons = new ArrayCollection();
}
 
public function setSpelling($p)
{
$this->spelling = $p;
 
return $this;
}
 
public function getSpelling()
{
return $this->spelling;
}
 
Ligne 128 ⟶ 145 :
 
{{remarque|1=L'annotation <code>@ORM\Table(name="word")</code> était facultative dans cet exemple, car le nom de la table peut être déduit du nom de l'entité.}}
 
<syntaxhighlight lang=php>
L'annotation code>@ORM\Table</code> peut servir à définir des clés composites :
* @ORM\Table(uniqueConstraints={
* @ORM\UniqueConstraint(name="spelling-pronunciation", columns={"spelling", "pronunciation"})
* })
</syntaxhighlight>
 
=== Triggers ===