I'm just adding a working example to my last post; check the
implementation part at the end of the script;
Cheers, Allex
class Item {
var $_productID;
var $_quantity;
function Item($productID, $quantity) {
$this->_productID = $productID;
;10", 1);
$MyCart->addItem($newItem);
To iterate items in a Cart you may do something like that:
foreach ($MyCart->getItems as $Item) {
echo($Item->getProductId(), $Item->getQuantity);
}
Allex
Steve Turner wrote:
I am just learning to use objects. I am messing around with a sh
al browser point of view, I still have some troubles with avoiding
the same error messages while editing my php staff, that means the
development environment which I use (Eclipse + some plugins) can't
handle the include/require directives correctly.
Perhaps you may face the same issue .. ?
| +-interface (dir)
| | |-controller.php
| +-dataaccess (dir)
| | |-dbase.php
| |globals.php
|index.php
|
I'm running PHP 4.3.2 with Apache 2 on WinXP box.
Thanks,
Allex
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
4 matches
Mail list logo