comparer 2 listes d'objets
salut a tous...
j'explique un peu ou je me casse la tete.
j'ai un objet (commande)
qui a 2 listes d'articles en paramètre (chaque article étant aussi un objet)
quel moyen s'offre a moi si je veux comparer les 2 listes.
un truc de ce style la quoi...
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
$product1 = new $product();
$product2 = new $product();
$commande = new $order();
$commande->setListe1=$product1;
$commande->setListe2=$product1;
$commande->setListe1=$product2;
if ($commande->getliste1==$commande->getliste2)
{
echo 'ca marche';
}
else
{
echo 'ca marche pas';
} |
merci a tous