@@ 102-102 (lines=1) @@ | ||
99 | } |
|
100 | ||
101 | public function offsetExists($offset) { |
|
102 | if (count($this->dataSource->getPrimaryKey()) > 1) return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey()); |
|
103 | if (!empty($this->settings['filter'])) { |
|
104 | $data = $this->dataSource->findByField(array_merge($this->settings['filter'], [$this->dataSource->getPrimaryKey()[0] => $offset])); |
|
105 | return isset($data[0]); |
|
@@ 115-115 (lines=1) @@ | ||
112 | } |
|
113 | ||
114 | public function offsetGet($offset) { |
|
115 | if (count($this->dataSource->getPrimaryKey()) > 1) return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey()); |
|
116 | if (!empty($this->settings['filter'])) { |
|
117 | $data = $this->dataSource->findByField(array_merge($this->settings['filter'], [$this->dataSource->getPrimaryKey()[0] => $offset])); |
|
118 | return $this->wrap($this->createNew(isset($data[0]) ? $data[0] : null)); |