diff --git a/api/v3/TwingleSync/models/TwingleProject.php b/api/v3/TwingleSync/models/TwingleProject.php index 7815368..571cffa 100644 --- a/api/v3/TwingleSync/models/TwingleProject.php +++ b/api/v3/TwingleSync/models/TwingleProject.php @@ -31,13 +31,18 @@ class TwingleProject { * * @param array $values * + * If values come from CiviCRM Campaign API, it is necessary to + * translate the custom field names back + * @param bool $translate + * * @throws \Exception */ - public function __construct(array $values) { + public function __construct(array $values, $translate = FALSE) { + // Import values $this->values = $values; - $this->project_id = $values['project_id']; + // Translate values if values come from CiviCRM Campaign API // Format data types of the values for import into CiviCRM $this->formatForImport($values); @@ -114,6 +119,8 @@ class TwingleProject { /** * Translate $value keys to custom field names * + * @param bool $rev + * * @return array */ private function translateValues() {