Skip to content

Commit dc55897

Browse files
authored
Merge pull request calcinai#223 from SynergiTech/master
add includeArchived() to query
2 parents 2fe2e12 + acb3324 commit dc55897

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/XeroPHP/Remote/Query.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Query
2222
private $toDate;
2323
private $date;
2424
private $offset;
25+
private $includeArchived;
2526

2627
public function __construct(Application $app)
2728
{
@@ -31,6 +32,7 @@ public function __construct(Application $app)
3132
$this->modifiedAfter = null;
3233
$this->page = null;
3334
$this->offset = null;
35+
$this->includeArchived = false;
3436
}
3537

3638
/**
@@ -207,6 +209,11 @@ public function offset($offset = 0)
207209
return $this;
208210
}
209211

212+
public function includeArchived($includeArchived = true) {
213+
$this->includeArchived = (bool) $includeArchived;
214+
return $this;
215+
}
216+
210217
/**
211218
* @return Collection
212219
*/
@@ -258,6 +265,10 @@ public function execute()
258265
$request->setParameter('offset', $this->offset);
259266
}
260267

268+
if ($this->includeArchived !== false) {
269+
$request->setParameter('includeArchived', 'true');
270+
}
271+
261272
$request->send();
262273

263274
$elements = new Collection();

0 commit comments

Comments
 (0)