Skip to content

Commit bf8a6b7

Browse files
Merge pull request #18 from SlicingDice/update-exists-entity
Update existsEntity
2 parents 38c0ed4 + c019127 commit bf8a6b7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
### Updated
4+
- Update `existsEntity()` to receive `table` as parameter
45
- Update API errors code
56

67
## [1.0.0]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ print_r($client->insert($insertData));
257257
}
258258
```
259259

260-
### `existsEntity($ids)`
261-
Verify which entities exist in a database given a list of entity IDs. This method corresponds to a [POST request at /query/exists/entity](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-exists-entity).
260+
### `existsEntity($ids, $table)`
261+
Verify which entities exist in a table (uses `default` table if not provided) given a list of entity IDs. This method corresponds to a [POST request at /query/exists/entity](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-exists-entity).
262262

263263
#### Request example
264264

src/SlicingDice.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,15 @@ public function countEvent($query) {
263263
/**
264264
* Get if exists entities SlicingDice
265265
*
266-
* @param array $ids A list of ids
266+
* @param array $ids A list of ids
267+
* @param string $table In which table entities check be checked
267268
*/
268-
public function existsEntity($ids) {
269+
public function existsEntity($ids, $table=NULL) {
269270
$url = $this->testWrapper() . URLResources::QUERY_EXISTS_ENTITY;
270271
$query = array('ids' => $ids, );
272+
if ($table) {
273+
$query['table'] = $table;
274+
}
271275
return $this->makeRequest($url, "POST", 0, $query);
272276
}
273277

0 commit comments

Comments
 (0)