-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from simensen/item-search
Add ItemSearches endpoint, deprecate SearchResults
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Devio\Pipedrive\Resources; | ||
|
||
use Devio\Pipedrive\Http\Response; | ||
use Devio\Pipedrive\Resources\Basics\Resource; | ||
|
||
class ItemSearches extends Resource | ||
{ | ||
/** | ||
* Enabled abstract methods. | ||
* | ||
* @var array | ||
*/ | ||
protected $enabled = []; | ||
|
||
/** | ||
* Search. | ||
* | ||
* @param $term | ||
* @param array $options | ||
* @return Response | ||
*/ | ||
public function search($term, $options = []) | ||
{ | ||
array_set($options, 'term', $term); | ||
|
||
return $this->request->get('', $options); | ||
} | ||
|
||
/** | ||
* Search from a specific field. | ||
* | ||
* @param $term | ||
* @param $field_type | ||
* @param $field_key | ||
* @param array $options | ||
* @return Response | ||
*/ | ||
public function searchFromField($term, $field_type, $field_key, $options = []) | ||
{ | ||
$options = array_merge(compact('term', 'field_type', 'field_key'), $options); | ||
|
||
return $this->request->get('field', $options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters