Posted by David Haynes on 06/09/06 18:08
Ramon wrote:
> class ProductList {
> var $m_oProductList = array();
>
> function add ($oProduct) {
> $this->m_oProductList[] =& $oProduct;
$this->m_oProductList[$oProduct->getID()] =& $oProduct;
// don't know if you need =& here, = may be enough
> }
>
> function getProductByID ($iID) {
> return $this->m_oProductList[ ??? ]; <-- and this is where I got
> stuck...
return $this->m_oProductList[$iID];
> }
> }
should work. [Caveat: it's Friday... ;-) ]
-david-
[Back to original message]
|