@@ 58-66 (lines=9) @@ | ||
55 | * @param array $ids |
|
56 | * @return mixed |
|
57 | */ |
|
58 | public function getList(array $ids) |
|
59 | { |
|
60 | $all = $this->getAll(); |
|
61 | $result = array_intersect_key((array)$all, $ids); |
|
62 | if(is_object($all)){ |
|
63 | return new $all($result); |
|
64 | } |
|
65 | return $result; |
|
66 | } |
|
67 | ||
68 | /** |
|
69 | * @param callable $filter |
|
@@ 72-80 (lines=9) @@ | ||
69 | * @param callable $filter |
|
70 | * @return mixed |
|
71 | */ |
|
72 | public function find(callable $filter = null) |
|
73 | { |
|
74 | $all = $this->getAll(); |
|
75 | $result = array_filter((array)$all, $filter); |
|
76 | if(is_object($all)){ |
|
77 | return new $all($result); |
|
78 | } |
|
79 | return $result; |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * @return mixed |