public function Entity::__construct

cis7 entity.inc public Entity::__construct(array $values = array(), $entityType = NULL)
cle7 entity.inc public Entity::__construct(array $values = array(), $entityType = NULL)
elmsmedia7 entity.inc public Entity::__construct(array $values = array(), $entityType = NULL)
icor7 entity.inc public Entity::__construct(array $values = array(), $entityType = NULL)
meedjum_blog7 entity.inc public Entity::__construct(array $values = array(), $entityType = NULL)
mooc7 entity.inc public Entity::__construct(array $values = array(), $entityType = NULL)

Creates a new entity.

See also

entity_create()

3 methods override Entity::__construct()
EntityClass::__construct in sites/all/modules/ulmus/entity/tests/entity_test.module
Creates a new entity.
OgMembership::__construct in sites/all/modules/ulmus/og/includes/og.membership.inc
Creates a new entity.
OgMembershipType::__construct in sites/all/modules/ulmus/og/includes/og.membership_type.inc
Creates a new entity.

File

sites/all/modules/ulmus/entity/includes/entity.inc, line 40
Provides a base class for entities.

Class

Entity
A common class for entities.

Code

public function __construct(array $values = array(), $entityType = NULL) {
  if (empty($entityType)) {
    throw new Exception('Cannot create an instance of Entity without a specified entity type.');
  }
  $this->entityType = $entityType;
  $this->setUp();
  // Set initial values.
  foreach ($values as $key => $value) {
    $this->$key = $value;
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.