@@ 106-106 (lines=1) @@ | ||
103 | } |
|
104 | ||
105 | public function offsetExists($offset) { |
|
106 | if (count($this->dataSource->getPrimaryKey()) > 1) return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey()); |
|
107 | if (!empty($this->settings['filter'])) { |
|
108 | $data = $this->dataSource->findByField(array_merge($this->settings['filter'], [$this->dataSource->getPrimaryKey()[0] => $offset])); |
|
109 | return isset($data[0]); |
|
@@ 119-119 (lines=1) @@ | ||
116 | } |
|
117 | ||
118 | public function offsetGet($offset) { |
|
119 | if (count($this->dataSource->getPrimaryKey()) > 1) return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey()); |
|
120 | if (!empty($this->settings['filter'])) { |
|
121 | $data = $this->dataSource->findByField(array_merge($this->settings['filter'], [$this->dataSource->getPrimaryKey()[0] => $offset])); |
|
122 | return $this->entity->create(isset($data[0]) ? $data[0] : null, $this->relations); |