Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/Benhawker/Pipedrive/Library/Persons.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ public function __construct(\Benhawker\Pipedrive\Pipedrive $master)
//associate curl class
$this->curl = $master->curl();
}

/**
* Returns a the people
*
* @param array $paramters The paramters of start, filter_id, limit, and sort when finding all the contats
* @return array returns detials of a person
*/
public function getAll($parameters = array())
{
$default = array(
'filter_id' => '',
'start' => 0,
'limit' => 500,
'sort' => ''
);
return $this->curl->get('persons', $parameters);
}

/**
* Returns a person
Expand All @@ -42,11 +59,16 @@ public function getById($id)
* Returns a person / people
*
* @param string $name pipedrive persons name
* @param array $options Additionals search options such as email
* @return array returns detials of a person
*/
public function getByName($name)
public function getByName($name, $options = array())
{
return $this->curl->get('persons/find', array('term' => $name));
$data = array('term' => $name);

$data += $options;

return $this->curl->get('persons/find', $data );
}

/**
Expand Down