フィールドAPI

Events happening in the community are now at Drupal community events on www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

  

元記事URI Field API
編集リンク
ステータス 作業中
  どなたでも参加可能です
是非添削してください:|

Drupalのエンティティにカスタムデーターフィールドを結びつけます

フィールドAPIは、カスタムデーターフィールドを、Drupalのエンティに結びつけることを認め、フィールドデーターの読み込み、編集、表示を取り計らいます。フィールドAPIを利用することで、いかなるエンティティタイプ(ノード、ユーザー、その他)もフィールド化することが出来、尚且つフィールドを結びつけることが出来ます。他のモジュールは、汎用的なデータ・タイプ、フォーム要素およびディスプレイフォーマット機能と同様に、ウェブ・ブラウザ経由でカスタムフィールドを管理するためのユーザ・インターフェースを提供することができます。

  • フィールドタイプ API フィールド・タイプ、ウィジェット・タイプおよびディスプレイフォーマッタを定義します。Field modules use this API to provide field types like Text and Node Reference along with the associated form elements and display formatters.
  • フィールド CRUD API フィールド、バンドル(別名”コンテンツタイプ”)、インスタンスの作成、更新、削除。モジュールはカスタム・データ構造を作るためにしばしばhook_install()の中で、このAPIを使用します。
  • フィールド アタッチ API フィールドAPIにエンティティタイプを接続します。フィールド アタッチAPI関数は、読み込み、、格納、フォームAPI構造の生成、表示、また個々のエンティティに接続されたフィールド・データのための様々な他の関数を実行します。ノードやユーザのようなフィールド化することが出来るエンティティ種類タイプは、フィールド化出来るようになるためにこのAPIを使用します。
  • フィールド情報 API Exposes information about all fields, instances, widgets, and related information defined by or with the Field API.
  • フィールドストレージ API 実際のフィールド・データのために着脱可能なバックエンドストレージシステムを提供します。 初期の実装では(field_sql_storage.module)、ローカルのSQLデータベースにフィールド・データを格納します。

定数

名前 場所 詳細
FIELD_BEHAVIOR_CUSTOM modules/field/field.module TODO
FIELD_BEHAVIOR_DEFAULT modules/field/field.module TODO
FIELD_BEHAVIOR_NONE modules/field/field.module TODO
FIELD_CARDINALITY_UNLIMITED modules/field/field.module Value for $field['cardinality'] property to indicate it can hold an unlimited number of values.
FIELD_LOAD_CURRENT modules/field/field.module Age argument for loading the most recent version of an entity's field data with field_attach_load().
FIELD_LOAD_REVISION modules/field/field.module Age argument for loading the version of an entity's field data specified in the entity with field_attach_load().
FIELD_QUERY_COMPLETE modules/field/field.module Cursor return value for field_attach_query() to indicate that no more data is available.
FIELD_QUERY_NO_LIMIT modules/field/field.module Limit argument for field_attach_query() to request all available entities instead of a limited number.

Functions

名前 場所 詳細
field_access modules/field/field.module ユーザが与えられたフィールドへのアクセス権があるか判定します。
field_associate_fields modules/field/field.module モジュールがコントロールする、フィールドおよびカラムのためのデータベースを更新することを可能にします。
field_bundle_settings modules/field/field.module 管理上定義されたバンドルの設定の取得及び設定をします。
field_cache_clear modules/field/field.module フィールドの情報およびフィールド・データのキャッシュをクリアーします。
field_cron modules/field/field.module hook_cron()の実装
field_extract_bundle modules/field/field.module バンドルオブジェクトから、バンドル名を求めるヘルパー関数。
field_extra_fields modules/field/field.module Returns a list and settings of pseudo-field elements in a given bundle.
field_extra_fields_get_display modules/field/field.module Returns the display settings to use for pseudo-fields in a given view mode.
field_filter_xss modules/field/field.module Like filter_xss_admin(), but with a shorter list of allowed tags.
field_flush_caches modules/field/field.module Implements hook_flush_caches().
field_get_default_value modules/field/field.module Helper function to get the default value for a field on an entity.
field_get_display modules/field/field.module Returns the display settings to use for an instance in a given view mode.
field_get_items modules/field/field.module Returns the field items in the language they currently would be displayed.
field_has_data modules/field/field.module Determine whether a field has any data.
field_help modules/field/field.module Implements hook_help().
field_modules_disabled modules/field/field.module Implements hook_modules_disabled().
field_modules_enabled modules/field/field.module Implements hook_modules_enabled().
field_modules_installed modules/field/field.module Implements hook_modules_installed().
field_modules_uninstalled modules/field/field.module Implements hook_modules_uninstalled().
field_theme modules/field/field.module Implements hook_theme().
field_view_field modules/field/field.module Returns a renderable array for the value of a single field in an entity.
field_view_mode_settings modules/field/field.module Returns view mode settings in a given bundle.
field_view_value modules/field/field.module Returns a renderable array for a single field value.
template_preprocess_field modules/field/field.module Theme preprocess function for theme_field() and field.tpl.php.
template_process_field modules/field/field.module Theme process function for theme_field() and field.tpl.php.
_field_extra_fields_pre_render modules/field/field.module Pre-render callback to adjust weights and visibility of non-field elements.
_field_filter_items modules/field/field.module Helper function to filter out empty field values.
_field_filter_xss_allowed_tags modules/field/field.module List of tags allowed by field_filter_xss().
_field_filter_xss_display_allowed_tags modules/field/field.module Human-readable list of allowed tags, for display in help texts.
_field_sort_items modules/field/field.module Helper function to sort items in a field according to user drag-n-drop reordering.
_field_sort_items_helper modules/field/field.module Sort function for items order. (copied form element_sort(), which acts on #weight keys)
_field_sort_items_value_helper modules/field/field.module Same as above, using ['_weight']['#value']