You are here

function ClientsHandlerEntity::__construct in Web Service Clients 7.3

Constructor method.

Overrides Entity::__construct().

Overrides Entity::__construct

1 call to ClientsHandlerEntity::__construct()
clients_connection_drupal_services::__construct in connections/clients_drupal/clients_drupal.inc
Constructor method.
1 method overrides ClientsHandlerEntity::__construct()
clients_connection_drupal_services::__construct in connections/clients_drupal/clients_drupal.inc
Constructor method.

File

includes/clients.entity.inc, line 20
Provides base classes for clients handler entities.

Class

ClientsHandlerEntity
Base class for entities that function as handlers.

Code

function __construct(array $values = array(), $entityType = NULL) {

  // todo: refactor; use parent::()?
  $this->entityType = $entityType;
  $this
    ->setUp();

  // Lump all data unto the object...
  foreach ($values as $field => $value) {
    $this->{$field} = $value;
  }

  // Connections defined in code are already unserialized.
  // TODO: check if still needed???
  if (isset($object->configuration) && !is_array($object->configuration)) {
    $this->configuration = unserialize($object->configuration);
  }
  return $this;
}