1<?php
2
3/**
4 * @file
5 * Test module for the Entity CRUD API.
6 */
7
8/**
9 * Implements hook_entity_presave().
10 */
11function entity_crud_hook_test_entity_presave($entity, $type) {
12  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
13}
14
15/**
16 * Implements hook_comment_presave().
17 */
18function entity_crud_hook_test_comment_presave() {
19  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
20}
21
22/**
23 * Implements hook_file_presave().
24 */
25function entity_crud_hook_test_file_presave() {
26  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
27}
28
29/**
30 * Implements hook_node_presave().
31 */
32function entity_crud_hook_test_node_presave() {
33  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
34}
35
36/**
37 * Implements hook_taxonomy_term_presave().
38 */
39function entity_crud_hook_test_taxonomy_term_presave() {
40  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
41}
42
43/**
44 * Implements hook_taxonomy_vocabulary_presave().
45 */
46function entity_crud_hook_test_taxonomy_vocabulary_presave() {
47  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
48}
49
50/**
51 * Implements hook_user_presave().
52 */
53function entity_crud_hook_test_user_presave() {
54  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
55}
56
57/**
58 * Implements hook_entity_insert().
59 */
60function entity_crud_hook_test_entity_insert($entity, $type) {
61  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
62}
63
64/**
65 * Implements hook_comment_insert().
66 */
67function entity_crud_hook_test_comment_insert() {
68  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
69}
70
71/**
72 * Implements hook_file_insert().
73 */
74function entity_crud_hook_test_file_insert() {
75  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
76}
77
78/**
79 * Implements hook_node_insert().
80 */
81function entity_crud_hook_test_node_insert() {
82  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
83}
84
85/**
86 * Implements hook_taxonomy_term_insert().
87 */
88function entity_crud_hook_test_taxonomy_term_insert() {
89  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
90}
91
92/**
93 * Implements hook_taxonomy_vocabulary_insert().
94 */
95function entity_crud_hook_test_taxonomy_vocabulary_insert() {
96  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
97}
98
99/**
100 * Implements hook_user_insert().
101 */
102function entity_crud_hook_test_user_insert() {
103  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
104}
105
106/**
107 * Implements hook_entity_load().
108 */
109function entity_crud_hook_test_entity_load(array $entities, $type) {
110  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
111}
112
113/**
114 * Implements hook_comment_load().
115 */
116function entity_crud_hook_test_comment_load() {
117  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
118}
119
120/**
121 * Implements hook_file_load().
122 */
123function entity_crud_hook_test_file_load() {
124  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
125}
126
127/**
128 * Implements hook_node_load().
129 */
130function entity_crud_hook_test_node_load() {
131  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
132}
133
134/**
135 * Implements hook_taxonomy_term_load().
136 */
137function entity_crud_hook_test_taxonomy_term_load() {
138  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
139}
140
141/**
142 * Implements hook_taxonomy_vocabulary_load().
143 */
144function entity_crud_hook_test_taxonomy_vocabulary_load() {
145  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
146}
147
148/**
149 * Implements hook_user_load().
150 */
151function entity_crud_hook_test_user_load() {
152  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
153}
154
155/**
156 * Implements hook_entity_update().
157 */
158function entity_crud_hook_test_entity_update($entity, $type) {
159  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
160}
161
162/**
163 * Implements hook_comment_update().
164 */
165function entity_crud_hook_test_comment_update() {
166  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
167}
168
169/**
170 * Implements hook_file_update().
171 */
172function entity_crud_hook_test_file_update() {
173  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
174}
175
176/**
177 * Implements hook_node_update().
178 */
179function entity_crud_hook_test_node_update() {
180  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
181}
182
183/**
184 * Implements hook_taxonomy_term_update().
185 */
186function entity_crud_hook_test_taxonomy_term_update() {
187  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
188}
189
190/**
191 * Implements hook_taxonomy_vocabulary_update().
192 */
193function entity_crud_hook_test_taxonomy_vocabulary_update() {
194  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
195}
196
197/**
198 * Implements hook_user_update().
199 */
200function entity_crud_hook_test_user_update() {
201  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
202}
203
204/**
205 * Implements hook_entity_delete().
206 */
207function entity_crud_hook_test_entity_delete($entity, $type) {
208  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
209}
210
211/**
212 * Implements hook_comment_delete().
213 */
214function entity_crud_hook_test_comment_delete() {
215  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
216}
217
218/**
219 * Implements hook_file_delete().
220 */
221function entity_crud_hook_test_file_delete() {
222  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
223}
224
225/**
226 * Implements hook_node_delete().
227 */
228function entity_crud_hook_test_node_delete() {
229  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
230}
231
232/**
233 * Implements hook_taxonomy_term_delete().
234 */
235function entity_crud_hook_test_taxonomy_term_delete() {
236  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
237}
238
239/**
240 * Implements hook_taxonomy_vocabulary_delete().
241 */
242function entity_crud_hook_test_taxonomy_vocabulary_delete() {
243  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
244}
245
246/**
247 * Implements hook_user_delete().
248 */
249function entity_crud_hook_test_user_delete() {
250  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
251}
252