add project title to result array and change "update" to "fetched"

later it might become handy to distinguish the update direction (from Twingle to CiviCRM or to Twingle from CiciCRM )
This commit is contained in:
Marc Michalsky forumZFD 2020-09-29 14:13:55 +02:00
parent ef2cb029f6
commit cbca983d8b
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -84,6 +84,7 @@ class TwingleProject {
$this->id = $result['id']; $this->id = $result['id'];
$this->timestamp = $result['last_update']; $this->timestamp = $result['last_update'];
return [ return [
'title' => $this->values['title'],
'id' => $this->id, 'id' => $this->id,
'project_id' => $this->values['id'], 'project_id' => $this->values['id'],
'state' => 'created', 'state' => 'created',
@ -91,6 +92,7 @@ class TwingleProject {
} }
// Give information back if project already exists // Give information back if project already exists
return [ return [
'title' => $this->values['title'],
'id' => is_array($this->id) ? implode(', ', $this->id) : $this->id, 'id' => is_array($this->id) ? implode(', ', $this->id) : $this->id,
'project_id' => $this->values['id'], 'project_id' => $this->values['id'],
'state' => 'exists', 'state' => 'exists',
@ -112,7 +114,7 @@ class TwingleProject {
'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' => 'updated', 'state' => 'fetched',
]; ];
} }