Shopping basket in PHP PDO model
<p>Hello I want to create a shopping basket in PHP with PDO model and MVC architecture.
I have two tables</p>

<pre><code>Products [product_id , product_price , product_name ..etc]
Basket [basket_id, product_id, basket_quantity]
</code></pre>

<p>My problem is that I have two classes <code>Product()</code> and <code>Basket()</code> with the relevant constructors and get methods (<code>getProductPrice()</code>, <code>getBasketId()</code> ..etc).</p>

<p>So in the <strong>basket.php</strong> page I have </p>

<pre><code>$database = new BasketTable();

foreach ($view-&gt;basketList as $product) : {   
    $subTotal += ($product-&gt;getProductPrice()) * ($product-&gt;getBasketQuantity());
}
</code></pre>

<p>The thing is that in the method <code>getProductPrice()</code> doesn't exist in <code>BasketTable()</code>. So, do I have to add another foreach and create other variable (eg <code>$database2 = new ProductTable()</code>) ?</p>
