code formatting
This commit is contained in:
parent
65c5981eb8
commit
6351668ec8
2 changed files with 11 additions and 7 deletions
|
@ -245,7 +245,7 @@ class CRM_TwingleCampaign_BAO_CustomField {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a custom field mapping (e.g. ['project_id' => 'custom_42'])
|
* Get a custom field mapping (e.g. ['twingle_project_id' => 'custom_42'])
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* Associative array with a mapping of all custom fields used by this extension
|
* Associative array with a mapping of all custom fields used by this extension
|
||||||
|
|
|
@ -25,7 +25,7 @@ class CRM_TwingleCampaign_BAO_TwingleApiCall {
|
||||||
*
|
*
|
||||||
* @throws API_Exception
|
* @throws API_Exception
|
||||||
*/
|
*/
|
||||||
public function __construct($apiKey, int $limit) {
|
public function __construct(string $apiKey, int $limit) {
|
||||||
$this->apiKey = $apiKey;
|
$this->apiKey = $apiKey;
|
||||||
$this->limit = $limit;
|
$this->limit = $limit;
|
||||||
|
|
||||||
|
@ -118,13 +118,14 @@ class CRM_TwingleCampaign_BAO_TwingleApiCall {
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getEvent($projectId, $eventId = NULL) {
|
public
|
||||||
|
function getEvent($projectId, $eventId = NULL) {
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
$url = empty($eventId)
|
$url = empty($eventId)
|
||||||
? $this->protocol . 'project' . $this->baseUrl . $projectId . '/event'
|
? $this->protocol . 'project' . $this->baseUrl . $projectId . '/event'
|
||||||
: $this->protocol . 'project' . $this->baseUrl . $projectId . '/event/'
|
: $this->protocol . 'project' . $this->baseUrl . $projectId . '/event/'
|
||||||
. $eventId;
|
. $eventId;
|
||||||
|
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
$finished = FALSE;
|
$finished = FALSE;
|
||||||
|
@ -157,7 +158,8 @@ class CRM_TwingleCampaign_BAO_TwingleApiCall {
|
||||||
*
|
*
|
||||||
* @return array|NULL
|
* @return array|NULL
|
||||||
*/
|
*/
|
||||||
public function getProjectEmbedData($projectId) {
|
public
|
||||||
|
function getProjectEmbedData($projectId) {
|
||||||
|
|
||||||
$result = $this->getProject($projectId);
|
$result = $this->getProject($projectId);
|
||||||
|
|
||||||
|
@ -186,7 +188,8 @@ class CRM_TwingleCampaign_BAO_TwingleApiCall {
|
||||||
* @return array|bool
|
* @return array|bool
|
||||||
* Returns the result array of the curl or FALSE, if the curl failed
|
* Returns the result array of the curl or FALSE, if the curl failed
|
||||||
*/
|
*/
|
||||||
private function curlGet($url, $params = NULL) {
|
private
|
||||||
|
function curlGet($url, $params = NULL) {
|
||||||
if (!empty($params)) {
|
if (!empty($params)) {
|
||||||
$url = $url . '?' . http_build_query($params);
|
$url = $url . '?' . http_build_query($params);
|
||||||
}
|
}
|
||||||
|
@ -216,7 +219,8 @@ class CRM_TwingleCampaign_BAO_TwingleApiCall {
|
||||||
* @return false|mixed
|
* @return false|mixed
|
||||||
* Returns the result array of the curl or FALSE, if the curl failed
|
* Returns the result array of the curl or FALSE, if the curl failed
|
||||||
*/
|
*/
|
||||||
private function curlPost($url, $data) {
|
private
|
||||||
|
function curlPost($url, $data) {
|
||||||
$curl = curl_init($url);
|
$curl = curl_init($url);
|
||||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
|
||||||
curl_setopt($curl, CURLOPT_POST, TRUE);
|
curl_setopt($curl, CURLOPT_POST, TRUE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue