data_entity.entity.inc in Data 7
File
data_entity/data_entity.entity.inc
View source
<?php
class DataEntityController extends EntityAPIController implements EntityAPIControllerInterface {
protected $dataTable;
public function __construct($entityType) {
parent::__construct($entityType);
$this->dataTable = substr($entityType, 5);
}
function load($ids = array(), $conditions = array()) {
$entities = parent::load($ids, $conditions);
foreach ($entities as $id => $entity) {
$entity->data_table = $this->dataTable;
$entity->entity_type = $this->entityType;
}
return $entities;
}
}