blob: 01ab4aa3139289abb3288f0acecccf283496262b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?
class SupplierPartList
{
public $suppliers = array();
public $supplier_parts = array();
public function addSupplierPart(SupplierPart $part)
{
//add in suppliers
$supplier = new Supplier($part->get('supplier_id'));
$this->addSupplier($supplier);
//add in our part.
$this->supplier_parts[$supplier->id][] = $part;
}
public function addSupplier(Supplier $supplier)
{
$this->suppliers[$supplier->get('name') . $supplier->id] = $supplier;
ksort($this->suppliers);
}
public function getSupplierParts($id)
{
return $this->supplier_parts[$id];
}
}
?>
|