Simpletest Coverage - modules/field/field.autoload.inc

1 <?php
2 // $Id: field.autoload.inc,v 1.4 2009/02/10 16:09:00 webchick Exp $
3
4 /**
5 * DO NOT EDIT THIS FILE. It contains autoloading functions generated
6 * automatically by generate-autoload.pl. The function names,
7 * arguments, and PHPdoc are copied from the file that defines the
8 * underlying function. To edit them, edit the underlying file instead.
9 */
10
11 /**
12 * @ingroup field_attach
13 * @{
14 */
15
16 /**
17 * Add form elements for all fields for an object to a form structure.
18 *
19 * @param $obj_type
20 * The type of $object; e.g. 'node' or 'user'.
21 * @param $object
22 * The object for which to load form elements, used to initialize
23 * default form values.
24 * @param $form
25 * The form structure to fill in.
26 * @param $form_state
27 * An associative array containing the current state of the form.
28 *
29 * TODO : document the resulting $form structure, like we do for
30 * field_attach_view().
31 *
32 * This function is an autoloader for _field_attach_form() in modules/field/field.attach.inc.
33 */
34 function field_attach_form($obj_type, $object, &$form, $form_state) {
35 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
36 return _field_attach_form($obj_type, $object, $form, $form_state);
37 }
38
39 /**
40 * Load all fields for the most current version of each of a set of
41 * objects of a single object type.
42 *
43 * @param $obj_type
44 * The type of objects for which to load fields; e.g. 'node' or
45 * 'user'.
46 * @param $objects
47 * An array of objects for which to load fields. The keys for
48 * primary id and bundle name to load are identified by
49 * hook_fieldable_info for $obj_type.
50 * @param $age
51 * FIELD_LOAD_CURRENT to load the most recent revision for all
52 * fields, or FIELD_LOAD_REVISION to load the version indicated by
53 * each object. Defaults to FIELD_LOAD_CURRENT; use
54 * field_attach_load_revision() instead of passing FIELD_LOAD_REVISION.
55 * @returns
56 * On return, the objects in $objects are modified by having the
57 * appropriate set of fields added.
58 *
59 * This function is an autoloader for _field_attach_load() in modules/field/field.attach.inc.
60 */
61 function field_attach_load($obj_type, $objects, $age = FIELD_LOAD_CURRENT) {
62 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
63 return _field_attach_load($obj_type, $objects, $age);
64 }
65
66 /**
67 * Load all fields for a previous version of each of a set of
68 * objects of a single object type.
69 *
70 * @param $obj_type
71 * The type of objects for which to load fields; e.g. 'node' or
72 * 'user'.
73 * @param $objects
74 * An array of objects for which to load fields. The keys for
75 * primary id, revision id, and bundle name to load are identified by
76 * hook_fieldable_info for $obj_type.
77 * @returns
78 * On return, the objects in $objects are modified by having the
79 * appropriate set of fields added.
80 *
81 * This function is an autoloader for _field_attach_load_revision() in modules/field/field.attach.inc.
82 */
83 function field_attach_load_revision($obj_type, $objects) {
84 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
85 return _field_attach_load_revision($obj_type, $objects);
86 }
87
88 /**
89 * Perform field validation against the field data in an object.
90 * Field validation is distinct from widget validation; the latter
91 * occurs during the Form API validation phase.
92 *
93 * NOTE: This functionality does not yet exist in its final state.
94 * Eventually, field validation will occur during field_attach_insert
95 * or _update which will throw an exception on failure. For now,
96 * fieldable entities must call this during their Form API validation
97 * phase, and field validation will call form_set_error for any
98 * errors. See http://groups.drupal.org/node/18019.
99 *
100 * @param $obj_type
101 * The type of $object; e.g. 'node' or 'user'.
102 * @param $object
103 * The object with fields to validate.
104 *
105 * This function is an autoloader for _field_attach_validate() in modules/field/field.attach.inc.
106 */
107 function field_attach_validate($obj_type, &$object, $form = NULL) {
108 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
109 return _field_attach_validate($obj_type, $object, $form);
110 }
111
112 /**
113 * Perform necessary operations on field data submitted by a form.
114 *
115 * Currently, this accounts for drag-and-drop reordering of
116 * field values, and filtering of empty values.
117 *
118 * @param $obj_type
119 * The type of $object; e.g. 'node' or 'user'.
120 * @param $object
121 * The object being submitted. The 'bundle key', 'id key' and (if applicable)
122 * 'revision key' should be present. The actual field values will be read
123 * from $form_state['values'].
124 * @param $form
125 * The form structure to fill in.
126 * @param $form_state
127 * An associative array containing the current state of the form.
128 *
129 * This function is an autoloader for _field_attach_submit() in modules/field/field.attach.inc.
130 */
131 function field_attach_submit($obj_type, &$object, $form, &$form_state) {
132 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
133 return _field_attach_submit($obj_type, $object, $form, $form_state);
134 }
135
136 /**
137 * Perform necessary operations just before fields data get saved.
138 *
139 * We take no specific action here, we just give other
140 * modules the opportunity to act.
141 *
142 * @param $obj_type
143 * The type of $object; e.g. 'node' or 'user'.
144 * @param $object
145 * The object with fields to process.
146 *
147 * This function is an autoloader for _field_attach_presave() in modules/field/field.attach.inc.
148 */
149 function field_attach_presave($obj_type, &$object) {
150 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
151 return _field_attach_presave($obj_type, $object);
152 }
153
154 /**
155 * Save field data for a new object. The passed in object must
156 * already contain its id and (if applicable) revision id attributes.
157 *
158 * @param $obj_type
159 * The type of $object; e.g. 'node' or 'user'.
160 * @param $object
161 * The object with fields to save.
162 *
163 * This function is an autoloader for _field_attach_insert() in modules/field/field.attach.inc.
164 */
165 function field_attach_insert($obj_type, &$object) {
166 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
167 return _field_attach_insert($obj_type, $object);
168 }
169
170 /**
171 * Save field data for an existing object.
172 *
173 * @param $obj_type
174 * The type of $object; e.g. 'node' or 'user'.
175 * @param $object
176 * The object with fields to save.
177 *
178 * This function is an autoloader for _field_attach_update() in modules/field/field.attach.inc.
179 */
180 function field_attach_update($obj_type, &$object) {
181 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
182 return _field_attach_update($obj_type, $object);
183 }
184
185 /**
186 * Delete field data for an existing object. This deletes all
187 * revisions of field data for the object.
188 *
189 * @param $obj_type
190 * The type of $object; e.g. 'node' or 'user'.
191 * @param $object
192 * The object whose field data to delete.
193 *
194 * This function is an autoloader for _field_attach_delete() in modules/field/field.attach.inc.
195 */
196 function field_attach_delete($obj_type, &$object) {
197 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
198 return _field_attach_delete($obj_type, $object);
199 }
200
201 /**
202 * Delete field data for a single revision of an existing object. The
203 * passed object must have a revision id attribute.
204 *
205 * @param $obj_type
206 * The type of $object; e.g. 'node' or 'user'.
207 * @param $object
208 * The object with fields to save.
209 *
210 * This function is an autoloader for _field_attach_delete_revision() in modules/field/field.attach.inc.
211 */
212 function field_attach_delete_revision($obj_type, &$object) {
213 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
214 return _field_attach_delete_revision($obj_type, $object);
215 }
216
217 /**
218 * Generate and return a structured content array tree suitable for
219 * drupal_render() for all of the fields on an object. The format of
220 * each field's rendered content depends on the display formatter and
221 * its settings.
222 *
223 * @param $obj_type
224 * The type of $object; e.g. 'node' or 'user'.
225 * @param $object
226 * The object with fields to render.
227 * @param $teaser
228 * Whether to display the teaser only, as on the main page.
229 * @return
230 * A structured content array tree for drupal_render().
231 *
232 * This function is an autoloader for _field_attach_view() in modules/field/field.attach.inc.
233 */
234 function field_attach_view($obj_type, &$object, $teaser = FALSE) {
235 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
236 return _field_attach_view($obj_type, $object, $teaser);
237 }
238
239 /**
240 * To be called in entity preprocessor.
241 *
242 * - Adds $FIELD_NAME_rendered variables
243 * containing the themed output for the whole field.
244 * - Adds the formatted values in the 'view' key of the items.
245 *
246 * This function is an autoloader for _field_attach_preprocess() in modules/field/field.attach.inc.
247 */
248 function field_attach_preprocess($obj_type, &$object) {
249 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
250 return _field_attach_preprocess($obj_type, $object);
251 }
252
253 /**
254 * Implementation of hook_nodeapi_prepare_translation.
255 *
256 * TODO D7: We do not yet know if this really belongs in Field API.
257 *
258 * This function is an autoloader for _field_attach_prepare_translation() in modules/field/field.attach.inc.
259 */
260 function field_attach_prepare_translation(&$node) {
261 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
262 return _field_attach_prepare_translation($node);
263 }
264
265 /**
266 * Notify field.module that a new bundle was created.
267 *
268 * The default SQL-based storage doesn't need to do anytrhing about it, but
269 * others might.
270 *
271 * @param $bundle
272 * The name of the newly created bundle.
273 *
274 * This function is an autoloader for _field_attach_create_bundle() in modules/field/field.attach.inc.
275 */
276 function field_attach_create_bundle($bundle) {
277 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
278 return _field_attach_create_bundle($bundle);
279 }
280
281 /**
282 * Notify field.module that a bundle was renamed.
283 *
284 * @param $bundle_old
285 * The previous name of the bundle.
286 * @param $bundle_new
287 * The new name of the bundle.
288 *
289 * This function is an autoloader for _field_attach_rename_bundle() in modules/field/field.attach.inc.
290 */
291 function field_attach_rename_bundle($bundle_old, $bundle_new) {
292 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
293 return _field_attach_rename_bundle($bundle_old, $bundle_new);
294 }
295
296 /**
297 * Notify field.module the a bundle was deleted.
298 *
299 * This deletes the data for the field instances as well as the field instances
300 * themselves. This function actually just marks the data and field instances
301 * and deleted, leaving the garbage collection for a separate process, because
302 * it is not always possible to delete this much data in a single page request
303 * (particularly since for some field types, the deletion is more than just a
304 * simple DELETE query).
305 *
306 * @param $bundle
307 * The bundle to delete.
308 *
309 * This function is an autoloader for _field_attach_delete_bundle() in modules/field/field.attach.inc.
310 */
311 function field_attach_delete_bundle($bundle) {
312 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
313 return _field_attach_delete_bundle($bundle);
314 }
315
316 /**
317 * Helper function to extract id, vid, and bundle name from an object.
318 *
319 * @param $obj_type
320 * The type of $object; e.g. 'node' or 'user'.
321 * @param $object
322 * The object from which to extract values.
323 * @return
324 * A numerically indexed array (not a hash table) containing these
325 * elements:
326 *
327 * 0: primary id of the object
328 * 1: revision id of the object, or NULL if $obj_type is not versioned
329 * 2: bundle name of the object
330 * 3: whether $obj_type's fields should be cached (TRUE/FALSE)
331 *
332 * This function is an autoloader for _field_attach_extract_ids() in modules/field/field.attach.inc.
333 */
334 function field_attach_extract_ids($object_type, $object) {
335 require_once DRUPAL_ROOT . '/modules/field/field.attach.inc';
336 return _field_attach_extract_ids($object_type, $object);
337 }
338
339 /**
340 * @} End of "field_attach"
341 */
342
343 /**
344 * @ingroup field_info
345 * @{
346 */
347
348 /**
349 * Helper function for determining the behavior of a field
350 * with respect to a given operation.
351 *
352 * @param $op
353 * The name of the operation.
354 * Currently supported : none
355 * // TODO D7: no use cases (yet ?) - do we want to keep that function ?.
356 * @param $field
357 * The field array.
358 * @return
359 * FIELD_BEHAVIOR_NONE - do nothing for this operation.
360 * FIELD_BEHAVIOR_CUSTOM - use the field's callback function.
361 * FIELD_BEHAVIOR_DEFAULT - use field.module default behavior.
362 *
363 * This function is an autoloader for _field_behaviors_field() in modules/field/field.info.inc.
364 */
365 function field_behaviors_field($op, $field) {
366 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
367 return _field_behaviors_field($op, $field);
368 }
369
370 /**
371 * Helper function for determining the behavior of a widget
372 * with respect to a given operation.
373 *
374 * @param $op
375 * The name of the operation.
376 * Currently supported: 'default value', 'multiple values'.
377 * @param $instance
378 * The field instance array.
379 * @return
380 * FIELD_BEHAVIOR_NONE - do nothing for this operation.
381 * FIELD_BEHAVIOR_CUSTOM - use the widget's callback function.
382 * FIELD_BEHAVIOR_DEFAULT - use field.module default behavior.
383 *
384 * This function is an autoloader for _field_behaviors_widget() in modules/field/field.info.inc.
385 */
386 function field_behaviors_widget($op, $instance) {
387 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
388 return _field_behaviors_widget($op, $instance);
389 }
390
391 /**
392 * Helper function for determining the behavior of a formatter
393 * with respect to a given operation.
394 *
395 * @param $op
396 * The name of the operation.
397 * Currently supported: 'multiple values'
398 * @param $display
399 * The $instance['display'][$build_mode] array.
400 * @return
401 * FIELD_BEHAVIOR_NONE - do nothing for this operation.
402 * FIELD_BEHAVIOR_CUSTOM - use the formatter's callback function.
403 * FIELD_BEHAVIOR_DEFAULT - use field module default behavior.
404 *
405 * This function is an autoloader for _field_behaviors_formatter() in modules/field/field.info.inc.
406 */
407 function field_behaviors_formatter($op, $display) {
408 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
409 return _field_behaviors_formatter($op, $display);
410 }
411
412 /**
413 * Return hook_field_info() data.
414 *
415 * @param $field_type
416 * (optional) A field type name. If ommitted, all field types will be
417 * returned.
418 * @return
419 * Either a field type description, as provided by hook_field_info(), or an
420 * array of all existing field types, keyed by field type name.
421 *
422 * This function is an autoloader for _field_info_field_types() in modules/field/field.info.inc.
423 */
424 function field_info_field_types($field_type = NULL) {
425 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
426 return _field_info_field_types($field_type);
427 }
428
429 /**
430 * Return hook_field_widget_info() data.
431 *
432 * @param $widget_type
433 * (optional) A widget type name. If ommitted, all widget types will be
434 * returned.
435 * @return
436 * Either a widget type description, as provided by
437 * hook_field_widget_info(), or an array of all existing widget
438 * types, keyed by widget type name.
439 *
440 * This function is an autoloader for _field_info_widget_types() in modules/field/field.info.inc.
441 */
442 function field_info_widget_types($widget_type = NULL) {
443 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
444 return _field_info_widget_types($widget_type);
445 }
446
447 /**
448 * Return hook_field_formatter_info() data.
449 *
450 * @param $formatter_type
451 * (optional) A formatter type name. If ommitted, all formatter types will be
452 * returned.
453 * @return
454 * Either a formatter type description, as provided by hook_field_formatter_info(),
455 * or an array of all existing widget types, keyed by widget type name.
456 *
457 * This function is an autoloader for _field_info_formatter_types() in modules/field/field.info.inc.
458 */
459 function field_info_formatter_types($formatter_type = NULL) {
460 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
461 return _field_info_formatter_types($formatter_type);
462 }
463
464 /**
465 * Return hook_fieldable_info() data.
466 *
467 * @param $obj_type
468 * (optional) A fieldable type name. If ommitted, all fieldable types will be
469 * returned.
470 * @return
471 * Either a fieldable type description, as provided by hook_fieldable_info(),
472 * or an array of all existing fieldable types, keyed by fieldable type name.
473 *
474 * This function is an autoloader for _field_info_fieldable_types() in modules/field/field.info.inc.
475 */
476 function field_info_fieldable_types($obj_type = NULL) {
477 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
478 return _field_info_fieldable_types($obj_type);
479 }
480
481 /**
482 * Return an array of fieldable bundle names and labels, for an individual
483 * object type or for all object types.
484 *
485 * This function is an autoloader for _field_info_bundles() in modules/field/field.info.inc.
486 */
487 function field_info_bundles($obj_type = NULL) {
488 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
489 return _field_info_bundles($obj_type);
490 }
491
492 /**
493 * Identity the type of entity that created a bundle.
494 * // TODO : might not be needed depending on how we solve
495 * // the 'namespace bundle names' issue
496 *
497 * This function is an autoloader for _field_info_bundle_entity() in modules/field/field.info.inc.
498 */
499 function field_info_bundle_entity($bundle) {
500 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
501 return _field_info_bundle_entity($bundle);
502 }
503
504 /**
505 * Return array of all field data, keyed by field name.
506 *
507 * @return
508 * An array of Field objects. Each Field object has an additional
509 * property, bundles, which is an array of all the bundles to which
510 * this field belongs.
511 *
512 * This function is an autoloader for _field_info_fields() in modules/field/field.info.inc.
513 */
514 function field_info_fields() {
515 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
516 return _field_info_fields();
517 }
518
519 /**
520 * Return data about an individual field.
521 *
522 * @param $field_name
523 * The name of the field to retrieve.
524 * @return
525 * The named field object, or NULL. The Field object has an additional
526 * property, bundles, which is an array of all the bundles to which
527 * this field belongs.
528 *
529 * This function is an autoloader for _field_info_field() in modules/field/field.info.inc.
530 */
531 function field_info_field($field_name) {
532 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
533 return _field_info_field($field_name);
534 }
535
536 /**
537 * Return an array of instance data for a given bundle,
538 * or for all known bundles, keyed by bundle name and field name.
539 *
540 * @param $bundle_name
541 * If set, return information on just this bundle.
542 *
543 * This function is an autoloader for _field_info_instances() in modules/field/field.info.inc.
544 */
545 function field_info_instances($bundle_name = NULL) {
546 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
547 return _field_info_instances($bundle_name);
548 }
549
550 /**
551 * Return an array of instance data for a specific field and bundle.
552 *
553 * This function is an autoloader for _field_info_instance() in modules/field/field.info.inc.
554 */
555 function field_info_instance($field_name, $bundle_name) {
556 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
557 return _field_info_instance($field_name, $bundle_name);
558 }
559
560 /**
561 * Return a field type's default settings.
562 *
563 * @param $type
564 * A field type name.
565 * @return
566 * The field type's default settings, as provided by hook_field_info(), or an
567 * empty array.
568 *
569 * This function is an autoloader for _field_info_field_settings() in modules/field/field.info.inc.
570 */
571 function field_info_field_settings($type) {
572 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
573 return _field_info_field_settings($type);
574 }
575
576 /**
577 * Return a field type's default instance settings.
578 *
579 * @param $type
580 * A field type name.
581 * @return
582 * The field type's default instance settings, as provided by
583 * hook_field_info(), or an empty array.
584 *
585 * This function is an autoloader for _field_info_instance_settings() in modules/field/field.info.inc.
586 */
587 function field_info_instance_settings($type) {
588 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
589 return _field_info_instance_settings($type);
590 }
591
592 /**
593 * Return a field widget's default settings.
594 *
595 * @param $type
596 * A widget type name.
597 * @return
598 * The field type's default settings, as provided by hook_field_info(), or an
599 * empty array.
600 *
601 * This function is an autoloader for _field_info_widget_settings() in modules/field/field.info.inc.
602 */
603 function field_info_widget_settings($type) {
604 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
605 return _field_info_widget_settings($type);
606 }
607
608 /**
609 * Return a field formatter's default settings.
610 *
611 * @param $type
612 * A field formatter type name.
613 * @return
614 * The field formatter's default settings, as provided by
615 * hook_field_info(), or an empty array.
616 *
617 * This function is an autoloader for _field_info_formatter_settings() in modules/field/field.info.inc.
618 */
619 function field_info_formatter_settings($type) {
620 require_once DRUPAL_ROOT . '/modules/field/field.info.inc';
621 return _field_info_formatter_settings($type);
622 }
623
624 /**
625 * @} End of "field_info"
626 */
627

Legend

Missed
lines code that were not excersized during program execution.
Covered
lines code were excersized during program execution.
Comment/non executable
Comment or non-executable line of code.
Dead
lines of code that according to xdebug could not be executed. This is counted as coverage code because in almost all cases it is code that runnable.