1: <?php
2: namespace NGS\Patterns;
3:
4: require_once(__DIR__.'/../Converter/PrimitiveConverter.php');
5: require_once(__DIR__.'/../Client/DomainProxy.php');
6:
7: use \NGS\Client\DomainProxy;
8: use \NGS\Converter\PrimitiveConverter;
9: use NGS\Name;
10:
11: class SearchBuilder extends Search
12: {
13: private $specification;
14:
15: public function __construct(Specification $specification)
16: {
17: $this->specification = $specification;
18: }
19:
20: public function __get($name)
21: {
22: return $this->specification->{$name};
23: }
24:
25: public function __set($name, $value)
26: {
27: $this->specification->{$name} = $value;
28: }
29:
30: public function search()
31: {
32: return
33: DomainProxy::instance()->searchWithSpecification(
34: Name::parent($this->specification),
35: $this->specification,
36: $this->limit,
37: $this->offset,
38: $this->order);
39: }
40: }
41: