Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function jsonSerialize()
 {
     return ['object' => KlaviyoApi::getModelType($this->objectType, TRUE), 'start' => $this->start, 'end' => $this->end, 'page_size' => $this->pageSize, 'total' => $this->total, 'page' => $this->page, 'data' => $this->data];
 }
Ejemplo n.º 2
0
 /**
  * Get the model type.
  *
  * @param array $configuration
  *   The key, value pair array to use for populating the data model.
  * @param string $type
  *   If set then we will check out data map and retrieve the model type.
  *
  * @return string
  *   The model data type.
  */
 public static function getModelType($configuration = [], $type = '')
 {
     if (empty($type) && !empty($configuration['object'])) {
         $type = $configuration['object'];
     }
     if (empty($type) && !empty($configuration)) {
         throw new MissingModelTypeException('Unable to determine the model type.');
     }
     return KlaviyoApi::getModelType($type);
 }