Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@
"keywords": ["crm", "api"],
"homepage": "",
"license": "MIT",
"authors": [{"name": "TTRide Group Devs", "email": "ben@tickettoridegroup.com", "homepage": "http://tickettoridegroup.com", "role": "Developer"}],
"authors": [
{
"name": "TTRide Group Devs",
"email": "ben@tickettoridegroup.com",
"homepage": "http://tickettoridegroup.com",
"role": "Developer"
},
{
"name": "Thomas Fauré",
"email": "thomas.faure@whaller.com",
"homepage": "https://whaller.com",
"role": "CEO"
}
],
"require": {
"php": ">=5.3.0"
},
Expand Down
48 changes: 48 additions & 0 deletions src/Benhawker/Pipedrive/Library/OrganizationFields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Benhawker\Pipedrive\Library;

use Benhawker\Pipedrive\Exceptions\PipedriveMissingFieldError;

/**
* Pipedrive OrganizationFields Methods
*
*/
class OrganizationFields
{
/**
* Hold the pipedrive cURL session
* @var \Benhawker\Pipedrive\Library\Curl Curl Object
*/
protected $curl;

/**
* Initialise the object load master class
*/
public function __construct(\Benhawker\Pipedrive\Pipedrive $master)
{
//associate curl class
$this->curl = $master->curl();
}

/**
* Returns all organization fields
*
* @return array returns all organizationFields
*/
public function getAll()
{
return $this->curl->get('organizationFields');
}

/**
* Returns a organization field
*
* @param int $id pipedrive organizationField id
* @return array returns details of a organizationField
*/
public function getById($id)
{
return $this->curl->get('organizationFields/' . $id);
}
}
48 changes: 48 additions & 0 deletions src/Benhawker/Pipedrive/Library/PersonFields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Benhawker\Pipedrive\Library;

use Benhawker\Pipedrive\Exceptions\PipedriveMissingFieldError;

/**
* Pipedrive PersonFields Methods
*
*/
class PersonFields
{
/**
* Hold the pipedrive cURL session
* @var \Benhawker\Pipedrive\Library\Curl Curl Object
*/
protected $curl;

/**
* Initialise the object load master class
*/
public function __construct(\Benhawker\Pipedrive\Pipedrive $master)
{
//associate curl class
$this->curl = $master->curl();
}

/**
* Returns all person fields
*
* @return array returns all personFields
*/
public function getAll()
{
return $this->curl->get('personFields');
}

/**
* Returns a person field
*
* @param int $id pipedrive personField id
* @return array returns details of a personField
*/
public function getById($id)
{
return $this->curl->get('personFields/' . $id);
}
}
49 changes: 41 additions & 8 deletions src/Benhawker/Pipedrive/Pipedrive.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php namespace Benhawker\Pipedrive;

/**
/**
* Pipedrive API wrapper class v0.1
*
* Author: Ben Hawker (ben@tickettoridegroup.com) 2014
* Author: Thomas Fauré — Whaller (thomas.faure@whaller.com) 2022
*/

/*
Expand Down Expand Up @@ -82,6 +83,16 @@ class Pipedrive
* @var \Benhawker\Pipedrive\Library\DealFields DealFields Object
*/
protected $dealFields;
/**
* Placeholder attritube for the pipedrive dealFields class
* @var \Benhawker\Pipedrive\Library\PersonFields DealFields Object
*/
protected $organizationFields;
/**
* Placeholder attritube for the pipedrive dealFields class
* @var \Benhawker\Pipedrive\Library\OrganizationFields DealFields Object
*/
protected $personFields;
/**
* Placeholder attritube for the pipedrive organizations class
* @var Organizations Object
Expand Down Expand Up @@ -116,13 +127,15 @@ public function __construct($apiKey = '', $protocol = 'https', $host = 'api.pipe
$this->curl = new Library\Curl($url, $apiKey);

//add pipedrive classes to the assoicated property
$this->persons = new Library\Persons($this);
$this->deals = new Library\Deals($this);
$this->activities = new Library\Activities($this);
$this->notes = new Library\Notes($this);
$this->dealFields = new Library\DealFields($this);
$this->organizations = new Library\Organizations($this);
$this->products = new Library\Products($this);
$this->persons = new Library\Persons($this);
$this->deals = new Library\Deals($this);
$this->activities = new Library\Activities($this);
$this->notes = new Library\Notes($this);
$this->dealFields = new Library\DealFields($this);
$this->personFields = new Library\PersonFields($this);
$this->organizationFields = new Library\OrganizationFields($this);
$this->organizations = new Library\Organizations($this);
$this->products = new Library\Products($this);
}

/**
Expand Down Expand Up @@ -185,6 +198,26 @@ public function dealFields()
return $this->dealFields;
}

/**
* Returns the Pipedrive PersonFields Object
*
* @return \Benhawker\Pipedrive\Library\PersonFields
*/
public function personFields()
{
return $this->personFields;
}

/**
* Returns the Pipedrive OrganizationFields Object
*
* @return \Benhawker\Pipedrive\Library\OrganizationFields
*/
public function organizationFields()
{
return $this->organizationFields;
}

/**
* Returns the Pipedrive Organizations Object
*
Expand Down