/**
  * @param \Searchperience\Api\Client\Domain\AbstractEntity $enrichment
  * @return array
  */
 protected function buildRequestArray(\Searchperience\Api\Client\Domain\AbstractEntity $enrichment)
 {
     $valueArray = array();
     if (!is_null($enrichment->getId())) {
         $valueArray['id'] = $enrichment->getId();
     }
     if (!is_null($enrichment->getDescription())) {
         $valueArray['description'] = $enrichment->getDescription();
     }
     if (!is_null($enrichment->getEnabled())) {
         $valueArray['status'] = $enrichment->getEnabled() ? 1 : 0;
     }
     if (!is_null($enrichment->getTitle())) {
         $valueArray['title'] = $enrichment->getTitle();
     }
     if (!is_null($enrichment->getAddBoost())) {
         $valueArray['addBoost'] = $enrichment->getAddBoost();
     }
     if (!is_null($enrichment->getMatchingRulesCombinationType())) {
         $valueArray['matchingRuleCombinationType'] = $enrichment->getMatchingRulesCombinationType();
     }
     if (!is_null($enrichment->getMatchingRulesExpectedResult())) {
         $valueArray['matchingRuleExpectedResult'] = $enrichment->getMatchingRulesExpectedResult() ? 1 : 0;
     }
     foreach ($enrichment->getFieldEnrichments() as $key => $fieldEnrichment) {
         /**
          * @var $fieldEnrichment FieldEnrichment
          */
         $data = array();
         $data['fieldName'] = $fieldEnrichment->getFieldName();
         $data['content'] = $fieldEnrichment->getContent();
         $valueArray['fieldEnrichments'][$key] = $data;
     }
     foreach ($enrichment->getMatchingRules() as $key => $matchingRule) {
         /**
          * @var $matchingRule MatchingRule
          */
         $data = array();
         $data['fieldName'] = $matchingRule->getFieldName();
         $data['operator'] = $matchingRule->getOperator();
         $data['operandValue'] = $matchingRule->getOperandValue();
         $valueArray['matchingRules'][$key] = $data;
     }
     $valueArray['contextsBoosting'] = [];
     /** @var ContextsBoostingCollection $enrichmentContextsBoostingCollection */
     $enrichmentContextsBoostingCollection = $enrichment->getContextsBoosting();
     if ($enrichmentContextsBoostingCollection->getCount() != 0) {
         foreach ($enrichmentContextsBoostingCollection as $key => $contextsBoosting) {
             /** @var ContextsBoosting $contextsBoosting */
             $data = [];
             $data['boostFieldName'] = $contextsBoosting->getBoostFieldName();
             $data['boostFieldValue'] = $contextsBoosting->getBoostFieldValue();
             $data['boostOptionName'] = $contextsBoosting->getBoostOptionName();
             $data['boostOptionValue'] = (bool) (int) $contextsBoosting->getBoostOptionValue() ? 1 : 0;
             $data['boostingValue'] = (double) $contextsBoosting->getBoostingValue();
             $valueArray['contextsBoosting'][$key] = $data;
         }
     }
     return $valueArray;
 }
 /**
  * Create an array containing only the available activity logs property values.
  *
  * @param \Searchperience\Api\Client\Domain\AbstractEntity $activityLogs
  * @return array
  */
 protected function buildRequestArray(\Searchperience\Api\Client\Domain\AbstractEntity $activityLogs)
 {
     $valueArray = array();
     if (!is_null($activityLogs->getId())) {
         $valueArray['id'] = $activityLogs->getId();
     }
     if ($activityLogs->getLogTime() instanceof \DateTime) {
         $valueArray['logTime'] = $this->dateTimeService->getDateStringFromDateTime($activityLogs->getLogTime());
     }
     if (!is_null($activityLogs->getProcessId())) {
         $valueArray['processId'] = $activityLogs->getProcessId();
     }
     if (!is_null($activityLogs->getSeverity())) {
         $valueArray['severity'] = $activityLogs->getSeverity();
     }
     if (!is_null($activityLogs->getMessage())) {
         $valueArray['message'] = $activityLogs->getMessage();
     }
     if (!is_null($activityLogs->getAdditionalData())) {
         $valueArray['additionalData'] = $activityLogs->getAdditionalData();
     }
     if (!is_null($activityLogs->getPackageKey())) {
         $valueArray['packageKey'] = $activityLogs->getPackageKey();
     }
     if (!is_null($activityLogs->getClassName())) {
         $valueArray['className'] = $activityLogs->getClassName();
     }
     if (!is_null($activityLogs->getMethodName())) {
         $valueArray['methodName'] = $activityLogs->getMethodName();
     }
     if (!is_null($activityLogs->getTag())) {
         $valueArray['tag'] = $activityLogs->getTag();
     }
     return $valueArray;
 }