security updates
have to check views and entityreference for custom patches
This commit is contained in:
@@ -31,6 +31,7 @@ class Entity {
|
||||
protected $entityInfo;
|
||||
protected $idKey, $nameKey, $statusKey;
|
||||
protected $defaultLabel = FALSE;
|
||||
protected $wrapper;
|
||||
|
||||
/**
|
||||
* Creates a new entity.
|
||||
@@ -56,7 +57,7 @@ class Entity {
|
||||
$this->entityInfo = entity_get_info($this->entityType);
|
||||
$this->idKey = $this->entityInfo['entity keys']['id'];
|
||||
$this->nameKey = isset($this->entityInfo['entity keys']['name']) ? $this->entityInfo['entity keys']['name'] : $this->idKey;
|
||||
$this->statusKey = empty($info['entity keys']['status']) ? 'status' : $info['entity keys']['status'];
|
||||
$this->statusKey = empty($this->entityInfo['entity keys']['status']) ? 'status' : $this->entityInfo['entity keys']['status'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,6 +112,23 @@ class Entity {
|
||||
return !empty($this->entityInfo['entity keys']['bundle']) ? $this->{$this->entityInfo['entity keys']['bundle']} : $this->entityType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the EntityMetadataWrapper of the entity.
|
||||
*
|
||||
* @return EntityDrupalWrapper
|
||||
* An EntityMetadataWrapper containing the entity.
|
||||
*/
|
||||
public function wrapper() {
|
||||
if (empty($this->wrapper)) {
|
||||
$this->wrapper = entity_metadata_wrapper($this->entityType, $this);
|
||||
}
|
||||
elseif ($this->wrapper->value() !== $this) {
|
||||
// Wrapper has been modified outside, so let's better create a new one.
|
||||
$this->wrapper = entity_metadata_wrapper($this->entityType, $this);
|
||||
}
|
||||
return $this->wrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label of the entity.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user