for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhraseanetSDK\Search;
use PhraseanetSDK\Exception\RuntimeException;
use PhraseanetSDK\AbstractRepository;
class SearchRepository extends AbstractRepository
{
/**
* Search for records
*
* @param array $parameters Query parameters
* @return \PhraseanetSDK\Entity\Query object
* @throws RuntimeException
*/
public function search(array $parameters = array())
$parameters = array_merge($parameters, [
'search_type' => SearchResult::TYPE_RECORD
]);
$response = $this->query('POST', 'v2/search/', array(), $parameters);
if ($response->isEmpty()) {
throw new RuntimeException('Response content is empty');
}
return SearchResults::fromValue($this->em, $parameters['search_type'], $response->getResult());