You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.2 KiB
64 lines
1.2 KiB
<?php |
|
|
|
/** |
|
* @file |
|
* Very basic entity controller. |
|
*/ |
|
|
|
/** |
|
* Special loader for Islandora objects. |
|
*/ |
|
class IslandoraObjectEntityController implements DrupalEntityControllerInterface { |
|
|
|
/** |
|
* Constructor. |
|
* |
|
* @param string $entity_type |
|
* The type of entity. |
|
*/ |
|
public function __construct($entity_type) { |
|
// No-op... |
|
} |
|
|
|
/** |
|
* Load all the entities. |
|
* |
|
* @param mixed $ids |
|
* The ID's of the entities. |
|
* @param mixed $conditions |
|
* The conditions to apply. |
|
* |
|
* @return array |
|
* An array of loaded objects. |
|
* |
|
* @throws \Exception |
|
* If no conditions are provided. |
|
*/ |
|
public function load($ids = array(), $conditions = array()) { |
|
if (!empty($conditions)) { |
|
// TODO: Allow loading by specifying IDs in the condition. |
|
throw new Exception('Conditions not implemented.'); |
|
} |
|
|
|
$loaded = array(); |
|
foreach ($ids as $id) { |
|
$load = islandora_object_load($id); |
|
if ($load) { |
|
$loaded[] = $load; |
|
} |
|
} |
|
|
|
return $loaded; |
|
} |
|
|
|
/** |
|
* Reset the cache. |
|
* |
|
* @param array $ids |
|
* The ID's of the entities. |
|
*/ |
|
public function resetCache(array $ids = NULL) { |
|
// no-op. |
|
} |
|
|
|
}
|
|
|