Skip to content

Commit 7eee107

Browse files
authored
Merge pull request #677 from Jessedev1/main
Added getPurchaseOrderLines() function for PurchaseOrders, just like …
2 parents 49f51ed + 5b42de7 commit 7eee107

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($select = '')
164+
{
165+
if (array_key_exists('__deferred', $this->attributes['PurchaseOrderLines'])) {
166+
$this->attributes['PurchaseOrderLines'] = (new PurchaseOrderLine($this->connection()))->filter("PurchaseOrderID eq guid'{$this->PurchaseOrderID}'", '', $select);
167+
}
168+
169+
return $this->attributes['PurchaseOrderLines'];
170+
}
162171
}

0 commit comments

Comments
 (0)