Current File : /home/karenpetzb/application/models/utils/CaddyFidelite.php |
<?php
class CaddyFidelite {
var $items = array();
function CaddyFidelite() {
$this->items = array();
}
function removeItem($idfidelite){
$newItems = array();
foreach($this->items as $item) {
if ($item->idFidelite != $idfidelite) {
array_push($newItems, $item);
}
}
$this->items = $newItems;
}
function addItem($idfidelite){
$currentItem = false;
foreach($this->items as $item) {
if ($item->idFidelite == $idfidelite) {
$currentItem = true;
}
}
if ($currentItem == false) {
$item = new ItemFidelite();
$item->getItemInfo($idfidelite);
if (!empty($item->nom)) {
array_push($this->items, $item);
}
}
}
}
?>