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