You are here

public function WSCall::__construct in Web Service Data 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/WSCall.php \Drupal\wsdata\Entity\WSCall::__construct()

Constructs an Entity object.

Parameters

array $values: An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

string $entity_type: The type of the entity to create.

Overrides ConfigEntityBase::__construct

File

src/Entity/WSCall.php, line 75

Class

WSCall
Defines the Web Service Call entity.

Namespace

Drupal\wsdata\Entity

Code

public function __construct(array $values, $entity_type) {
  parent::__construct($values, $entity_type);
  if ($this->wsserver) {
    $this->wsserverInst = \Drupal::service('entity_type.manager')
      ->getStorage('wsserver')
      ->load($this->wsserver);
  }
  if ($this->wsdecoder) {

    // Set the decoder instance.
    $wsdecoderManager = \Drupal::service('plugin.manager.wsdecoder');
    $this->wsdecoderInst = $wsdecoderManager
      ->createInstance($this->wsdecoder);
  }
  if ($this->wsencoder) {

    // Set the enocder instance.
    $wsencoderManager = \Drupal::service('plugin.manager.wsencoder');
    $this->wsencoderInst = $wsencoderManager
      ->createInstance($this->wsencoder);
  }
  $this->status = [];
}