|
@@ 141-147 (lines=7) @@
|
| 138 |
|
* @param array $filter [optional] |
| 139 |
|
* @return int |
| 140 |
|
*/ |
| 141 |
|
public function count($resource, array $filter = array()) { |
| 142 |
|
if (empty($this->data[$resource])) { |
| 143 |
|
return 0; |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
return count($this->filterer->filter($this->data[$resource], $filter)); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
/** |
| 150 |
|
* Create resource instances in the data store. |
|
@@ 208-214 (lines=7) @@
|
| 205 |
|
* @param int $limit [optional] |
| 206 |
|
* @return int|bool |
| 207 |
|
*/ |
| 208 |
|
public function delete($resource, array $filter = array(), $limit = null) { |
| 209 |
|
if (empty($this->data[$resource])) { |
| 210 |
|
return; |
| 211 |
|
} |
| 212 |
|
|
| 213 |
|
$this->data[$resource] = $this->filterer->reject($this->data[$resource], $filter); |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
/** |
| 217 |
|
* Search for resource data with fields that match the given query and |