forked from relaxedws/drupal-relaxed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
relaxed.api.php
41 lines (34 loc) · 842 Bytes
/
relaxed.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @file
* Hooks provided by the RELAXed Web Services module.
*/
/**
* @addtogroup hooks
* @{
*/
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\taxonomy\TermStorageInterface;
/**
* Returns an array of values specific for an entity type.
*
* These values will be used when creating stub entities for entity reference
* fields.
*
* @param \Drupal\Core\Entity\EntityStorageInterface $target_storage
*
* @return array
*
* @ingroup relaxed_api
*/
function hook_entity_create_stub(EntityStorageInterface $target_storage) {
$target_entity_values = array();
if ($target_storage instanceof TermStorageInterface) {
$target_entity_values['vid'] = 'tags';
$target_entity_values['name'] = 'Stub name for taxonomy term';
}
return $target_entity_values;
}
/**
* @} End of "addtogroup hooks".
*/