Bonjour à tous,
Dans mon application, j'ai un système de gestion de tickets avec la possibilité d'avoir des champs supplémentaires. J'ai donc la relation suivante :
TicketChamp ---- oneToMany ----> TicketChampValeur ----> manyToOne ----> Ticket
TicketChamp.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 <?php /** * @ORM\OneToMany(targetEntity="Agp\TicketBundle\Entity\TicketChampValeur", mappedBy="ticketChamp") */ protected $champValeurs;
TicketChampValeur.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 /** * @ORM\Id * @ORM\ManyToOne(targetEntity="Agp\TicketBundle\Entity\TicketChamp", inversedBy="champValeurs") * @ORM\JoinColumn(name="ticketChamp_id", referencedColumnName="id") */ private $ticketChamp; /** * @ORM\Id * @ORM\ManyToOne(targetEntity="Agp\TicketBundle\Entity\Ticket", inversedBy="champValeurs") * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id") */ private $ticket;
Ticket.php
Tout fonctionne correctement jusqu'au moment où je tente d'accéder à $champValeur via l'entité Ticket.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 <?php /** * @ORM\OneToMany(targetEntity="Agp\TicketBundle\Entity\TicketChampValeur", mappedBy="ticket") */ protected $champValeurs;
J'ai l'erreur suivante :
j'ai simplement tenté de faire :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Fatal error: Doctrine\ORM\Proxy\ProxyFactory::getProxy() [function.require]: Failed opening required 'C:\wamp\www\Symfony\app/cache/dev/doctrine/orm/Proxies\AgpTicketBundleEntityTicketChampProxy.php' (include_path='.;C:\php\pear') in C:\wamp\www\Symfony\vendor\doctrine\lib\Doctrine\ORM\Proxy\ProxyFactory.php on line 85
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <?php foreach($ticket->getChampValeurs() as $champValeur){ var_dump($champValeur); }
Si quelqu'un a une idée sur ce que j'ai loupé ça serait sympa.
Merci d'avance
Partager