Bonjour à tous, je débute sur symfony
j'ai une base de donnée relationnelle connecté à mon site
avec une table hardware relier a une table hwsupportlog
en relation 1.n avec une clé étrangere sur la table hwsupportlog
j'effectue une requête doctrine qui fonctionne dans hardwareTable.class.php
1 2 3 4 5 6 7 8 9 10 11 12
|
public function getHardware()
{
$q = Doctrine_Query::create()
->from('hardware h')
->leftjoin('h.typehardwareIdTypeHardware t')
->leftjoin('h.softwareIdSoftwareCurrent s')
->leftjoin('h.hwsupportlogs r');
return $q->execute();
} |
dans actions.class.php j'appelle la requête
$this->hardwares = Doctrine_Core::getTable('hardware')->getHardware();
et dans indexSuccess j'ai tout les champs sauf celui de la table hwsupportlog
1 2 3 4 5
| <td><?php echo $hardware->typehardwareIdTypeHardware->getName() ?></td>
<td><?php echo $hardware->typehardwareIdTypeHardware->getDescription() ?></td>
<td> </td>
<td><?php echo $hardware->hwsupportlogs->getHardwareIdHardware() ?></td> |
avec l'erreur suivante
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Doctrine_Collection' does not have a method 'getHardwareIdHardware' in E:\wamp\bin\php\php5.3.0\PEAR\symfony\escaper\sfOutputEscaperObjectDecorator.class.php on line 64
je n'arrive pas à accéder a la table hwsupportlog $hardware->hwsupportlogs->getHardwareIdHardware()
et je n'ai trouvé aucun exemple sur le site de symfony ni de doctrine pour ce cas là.
merci pour votre aide
Partager