Skip to content

Commit f2d798b

Browse files
committed
Added getPurchaseOrderLines() function for PurchaseOrders, just like SalesOrders
1 parent 49f51ed commit f2d798b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Picqer/Financials/Exact/PurchaseOrder.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,13 @@ public function addItem(array $array)
159159
}
160160
$this->attributes['PurchaseOrderLines'][] = $array;
161161
}
162+
163+
public function getPurchaseOrderLines()
164+
{
165+
if (array_key_exists('__deferred', $this->attributes['PurchaseOrderLines'])) {
166+
$this->attributes['PurchaseOrderLines'] = (new PurchaseOrderLine($this->connection()))->filter("PurchaseOrderID eq guid'{$this->PurchaseOrderID}'");
167+
}
168+
169+
return $this->attributes['PurchaseOrderLines'];
170+
}
162171
}

0 commit comments

Comments
 (0)