Skip to content

Commit

Permalink
Merge pull request #34 from byng-systems/master_rawgateway_get_method
Browse files Browse the repository at this point in the history
Added a get method to RawGateway so a single document can be retrieve…
  • Loading branch information
asim-inviqa authored Nov 10, 2016
2 parents 0c8e14a + c692c60 commit 298dbda
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/Byng/Pimcore/Elasticsearch/Gateway/RawGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,27 @@ public function findByQueryBuilder($index, $type, QueryBuilder $query)
return $this->doFind($index, $type, $query->toArray());
}

/**
* Get a document by it's id
*
* @param string $index
* @param string $type
* @param int $id
*
* @return array
*/
public function get($index, $type, $id)
{
$params = [
"id" => $id,
"index" => $index,
"type" => $type
];

return $this->client->get($params);
}


/**
* Delete from index
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public function findByArray($index, $type, array $query);
*/
public function save(array $data);

/**
* @param string $index
* @param string $type
* @param int $id
*/
public function get($index, $type, $id);

/**
* @param string $index
* @param string $type
Expand Down

0 comments on commit 298dbda

Please sign in to comment.