format & comment code

This commit is contained in:
Marc Michalsky forumZFD 2020-09-29 08:58:53 +02:00
parent e923ba91dc
commit 12d31e300f
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 33 additions and 10 deletions

View file

@ -35,7 +35,9 @@ class TwingleProject {
*/
public function __construct(array $values) {
$this->timestamp = $values['last_update'];
$this->values = $values;
$this->project_id = $values['project_id'];
// Format data types of the values for import into CiviCRM
$this->formatForImport($values);
@ -46,7 +48,7 @@ class TwingleProject {
}
/**
* Get all related custom fields as CustomField objects in an static array.
* Get custom field mapping.
* This function will be fully executed only once, when the TwingleProject
* class gets instantiated for the first time.
*
@ -142,12 +144,12 @@ class TwingleProject {
// Change timestamp into DateTime string
if (!empty($values['last_update'])) {
$date = DateTime::createFromFormat('U', $values['last_update'] );
$date = DateTime::createFromFormat('U', $values['last_update']);
$values['last_update'] = $date->format('Y-m-d H:i:s');
}
// Change event type empty string into 'default'
if ($values['type'] == ''){
if ($values['type'] == '') {
$values['type'] = 'default';
}
}
@ -161,12 +163,12 @@ class TwingleProject {
// Change DateTime string into timestamp
if (!empty($values['last_update'])) {
$date = DateTime::createFromFormat('Y-m-d H:i:s', $values['last_update'] );
$date = DateTime::createFromFormat('Y-m-d H:i:s', $values['last_update']);
$values['last_update'] = $date->getTimestamp();
}
// Change event type 'default' into empty string
if ($values['type'] == 'default'){
if ($values['type'] == 'default') {
$values['type'] = '';
}
}