THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Bonjour,

J'aimerais récupérer tous les éléments de la table "cart_item" en utilisant la classe CartItemQuery sans passer de paramètres.

Merci,

Last edited by Mikius (03-11-2016 16:19:30)

Offline

Offline


Merci pour ça me renvoie toujours un élément de la table et non tous les éléménts.

object(Thelia\Model\CartItem)[663] protected 'dispatcher' => null protected 'new' => boolean false protected 'deleted' => boolean false protected 'modifiedColumns' => array (size=0) empty protected 'virtualColumns' => array (size=0) empty protected 'id' => int 2 protected 'cart_id' => int 2 protected 'product_id' => int 9 protected 'quantity' => float 2 protected 'product_sale_elements_id' => int 81 protected 'price' => string '13.333333' (length=9) protected 'promo_price' => string '0.000000' (length=8) protected 'price_end_of_life' => object(DateTime)[664] public 'date' => string '2016-11-23 12:56:53' (length=19) public 'timezone_type' => int 3 public 'timezone' => string 'Europe/Paris' (length=12) protected 'promo' => int 0 protected 'created_at' => object(DateTime)[665] public 'date' => string '2016-10-24 13:56:53' (length=19) public 'timezone_type' => int 3 public 'timezone' => string 'Europe/Paris' (length=12) protected 'updated_at' => object(DateTime)[666] public 'date' => string '2016-10-24 13:57:06' (length=19) public 'timezone_type' => int 3 public 'timezone' => string 'Europe/Paris' (length=12) protected 'aCart' => null protected 'aProduct' => null protected 'aProductSaleElements' => null protected 'alreadyInSave' => boolean false

Offline

Offline

Offline


Alors c'est de la magie, parce que CartItemQuery::create()->find(); renvoie tous les enregistrements de la table.


OpenStudio Toulouse

Offline


$items = CartItemQuery::create()->find();
        foreach ($items as $item) {
            echo'<pre>'.var_dump($item).'</pre>';
        }

Offline


Quand je fais ma boucle dessus ça me renvoie un élément hmm