rename "state" to "status" in response array

This commit is contained in:
Marc Michalsky forumZFD 2020-10-07 15:06:56 +02:00
parent 953adaf319
commit a9d9dd5ace
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 9 additions and 9 deletions

View file

@ -145,7 +145,7 @@ class TwingleApiCall {
// If the CiviCRM TwingleProject campaign was changed, update the project // If the CiviCRM TwingleProject campaign was changed, update the project
// on Twingle's side // on Twingle's side
elseif ( elseif (
$result['state'] == 'TwingleProject exists' && $result['status'] == 'TwingleProject exists' &&
$values['last_update'] < $project->lastUpdate() $values['last_update'] < $project->lastUpdate()
) { ) {
// If this is a test do not make database changes // If this is a test do not make database changes
@ -158,7 +158,7 @@ class TwingleApiCall {
$result = $this->updateProject($project); $result = $this->updateProject($project);
} }
} }
elseif ($result['state'] == 'TwingleProject exists') { elseif ($result['status'] == 'TwingleProject exists') {
$result = $project->getResponse('TwingleProject up to date'); $result = $project->getResponse('TwingleProject up to date');
} }

View file

@ -100,7 +100,7 @@ class TwingleProject {
* If true: don't do any changes * If true: don't do any changes
* *
* @return array * @return array
* Returns a response array that contains title, id, project_id and state * Returns a response array that contains title, id, project_id and status
* *
* @throws \CiviCRM_API3_Exception * @throws \CiviCRM_API3_Exception
*/ */
@ -518,20 +518,20 @@ class TwingleProject {
/** /**
* Get a response that describes the state of a TwingleProject * Get a response that describes the status of a TwingleProject
* *
* @param string $state * @param string $status
* State of the TwingleProject you want the response for * status of the TwingleProject you want the response for
* *
* @return array * @return array
* Returns a response array that contains title, id, project_id and state * Returns a response array that contains title, id, project_id and status
*/ */
public function getResponse(string $state) { public function getResponse(string $status) {
return [ return [
'title' => $this->values['title'], 'title' => $this->values['title'],
'id' => $this->id, 'id' => $this->id,
'project_id' => $this->values['id'], 'project_id' => $this->values['id'],
'state' => $state, 'status' => $status,
]; ];
} }