Skip to content

Commit

Permalink
Merge pull request #84 from iammichiel/master
Browse files Browse the repository at this point in the history
WIP - Adding a Search trait closes #82
  • Loading branch information
IsraelOrtuno authored Jul 3, 2020
2 parents 161e27d + f6e7dad commit 6d9fd15
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Resources/Deals.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

use Devio\Pipedrive\Http\Response;
use Devio\Pipedrive\Resources\Basics\Entity;
use Devio\Pipedrive\Resources\Traits\Searches;
use Devio\Pipedrive\Resources\Traits\ListsProducts;
use Devio\Pipedrive\Resources\Traits\ListsAttachedFiles;

class Deals extends Entity
{
use ListsProducts, ListsAttachedFiles;
use ListsProducts, ListsAttachedFiles, Searches;

/**
* Get the deals timeline.
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/Organizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
use Devio\Pipedrive\Resources\Basics\Entity;
use Devio\Pipedrive\Resources\Traits\ListsDeals;
use Devio\Pipedrive\Resources\Traits\ListsAttachedFiles;
use Devio\Pipedrive\Resources\Traits\Searches;

class Organizations extends Entity
{
use ListsDeals, ListsAttachedFiles;
use ListsDeals, ListsAttachedFiles, Searches;

/**
* List the persons of a resource.
Expand Down
4 changes: 3 additions & 1 deletion src/Resources/Persons.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
use Devio\Pipedrive\Resources\Traits\ListsDeals;
use Devio\Pipedrive\Resources\Traits\ListsProducts;
use Devio\Pipedrive\Resources\Traits\ListsAttachedFiles;
use Devio\Pipedrive\Resources\Traits\Searches;

class Persons extends Entity
{
use ListsDeals,
ListsProducts,
ListsAttachedFiles;
ListsAttachedFiles,
Searches;
}
2 changes: 2 additions & 0 deletions src/Resources/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
use Devio\Pipedrive\Resources\Traits\FindsByName;
use Devio\Pipedrive\Resources\Traits\ListsAttachedFiles;
use Devio\Pipedrive\Resources\Traits\ListsPermittedUsers;
use Devio\Pipedrive\Resources\Traits\Searches;

class Products extends Resource
{
use FindsByName,
Searches,
ListsAttachedFiles,
ListsDeals,
ListsPermittedUsers;
Expand Down
22 changes: 22 additions & 0 deletions src/Resources/Traits/Searches.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Devio\Pipedrive\Resources\Traits;

use Devio\Pipedrive\Http\Response;

trait Searches
{
/**
* @param $term
* @param array $fields
*
* @return Response
*/
public function search($term, $fields = [])
{
$options['term'] = $term;
$options['fields'] = $fields;

return $this->request->get('search', $options);
}
}

0 comments on commit 6d9fd15

Please sign in to comment.