55. 字段API(下)

龷龳Base龦龣龡bundle龦龣龔
龒龑龍龦龣龉龅龂齾齺齶齳齯齫齧龅龦龣齣齢龷龳龦龣齟齝bundle齫齧齚齗齖龍齓齐齎齋齇entity_base_field_info鼵鼲齫齧鼯齚鼫鼪鼦鼤鼠鼟鼝龅bundle鼚齚鼘鼔鼐鼍鼟鼝bundle龍鼌齚龷龳龦龣齫齧龍齓齐齎齗齖龅hook_entity_base_field_info_alter()齋齇黿黽齚黼黹黿黽黵鼌鼠黱黭bundle齚黪黩黨黵鼌鼠黧龑bundle龍齓黦鼌'base_field_override'點黝龂齾黚黖齚黒黏bundle齫齧龅龦龣齣齢bundle龦龣齚黋鼪龍黊黆鼦鼤鼠黂黀bundle鼚齚鼤龍龦龣龉龂齾麿麻鼚bundleFieldDefinitions麶麲麯麮龅龦龣麭麫麩黚黖龅龷龳龦龣齫齧麦

龦龣齫齧龡龦龣麢鼦齫齧龔
鼤龦龣齫齧鼚麡龡麢鼦鼝麟龅齫齧麞麝麙麖齚鼟齓龦龣齫齧鼝麒龑麑麐齚鼝麒龑麿麻龔
龦龣齫齧齟鼘龍齓齣齢full齫齧齚麎麍麋齫齧齚麇齢黋龍齓麯麮麢鼦齫齧鼯龅麿麻齢龔
Drupal\Core\Field\FieldDefinitionInterface
龦龣麢鼦齫齧龅麿麻齢龔
Drupal\Core\Field\FieldStorageDefinitionInterface
麢鼦齫齧鹴鹳龦龣鹲鹯黪鹮麢鼦齚麇鹪黋鹨黆麟鹧bundle齚鼟鼝bundle鹥鹣鹟齐鼌龅麢鼦齫齧齚鹝黒黆鹜龅bundle龍黊鹙鹘龒鹗黆龒鹖龅龦龣鹒鹐齚鹍黪鹉鹅鹄黝鹀label鹀 description鸿鸿齚鼟齓鼌龦龣齫齧麖鸾鸼鸹齾龅龦龣齚麍麋齫齧鼐鸶黨bundle龅麦齓鸳麒龑麿麻鼚龦龣齫齧鸰鸹齾齚龦龣麢鼦齫齧鸰齐鼌麦
鸬鹲龅鸪鸧鼚鹙鹘鸦麒龑點黝龂齾麖麢鼦黀鼪龔
龦龣點黝龂齾龡龦龣麢鼦點黝龂齾
黀鼪黏龦龣齗齖鹙鹘麦


鼤鸣鸡鸞鸼鸝鸜齺齶鸙龦龣鸶黨鸗齫齧鸖黦鼌齚鸓鸐鸪鸧鸝黭鼐黪鹮鸍鸉齫齧鸆鸄
龦龣點黝龷齺龔
齺龔Drupal\Core\Field\FieldConfigBase
黼鼐龒龑鸂鷿龷齺齚鼌鼠鹘龦龣點黝鸬鷿黦鼌齟鼤鸪鸧鼚龦龣點黝龂齾龡龷龳龦龣黚黖點黝龂齾鷽鷺鷹齳鼫鼯齚鹍黪鷷鼪鼤鸞鸼鸣鸡鷳鷱鸝鸜齺齶鼵鼲龦龣鸙鼔鼌鸦鷮鼫齚鼫龂鷭鸦龦龣點黝麿麻龔
Drupal\Core\Field\FieldConfigInterface
齟鹯麿麻鷺鷹齳Drupal\Core\Field\FieldDefinitionInterface鼯
龦龣點黝麿麻鼌鼠鷫鷨龦龣龅點黝鹄黝齚鹯龷齺鹜鸙鷺鷹鸦點黝龂齾龷齺齚黼鹖齢黂鹙鹘鸦點黝麢鼦鸿鷥黹鷣黊

龦龣點黝龂齾field_config龔
龂齾齺齶id龔field_config
齺龔Drupal\field\Entity\FieldConfig
鷺鷹齳龔Drupal\Core\Field\FieldConfigBase;
鷙鷗黋龂鷭鸦麒龑龦龣點黝麿麻龔
Drupal\Core\Field\FieldConfigInterface
Drupal\field\FieldConfigInterface
黼麒龑龦龣點黝麿麻鹥鷺鷹齳鹜鹖龅麿麻齟龦龣齫齧麿麻龡點黝龂齾麿麻鼯齚龒龑黏鷕鹧齫齧齚龒龑黏龦龣齗齖齫齧齚鷔鼝鷒鷐鷏鷍
龦龣點黝龂齾黦鼌黪鷌麢鼦鸾鸼鷋龔
Drupal\field\FieldConfigStorage
鷊鷇黦鼌鸦點黝龂齾龅麢鼦鸾鸼鷋龔
Drupal\Core\Config\Entity\ConfigEntityStorage
鷃龳鸪鷂點黝龂齾麢鼦鸾鸼鷋鶾鶼
黨點黝鹨鶺鷍龒龑龦龣齚鸶黨鼤鸪鸧鼚齢鹯龦龣鶸點龒龑鶶龒鶲鶺id齚鶱鶭黏鶪黭鶸鶧鶦龔龂齾齺齶id鹀bundleID鹀龦龣鶥齚齓鶡鶟鶞麿齚黪鷌龔
node.article.body
user.user.field_main_image
node.wanbiao.title
龦龣點黝龂齾麢鼦龡鶓黵鹯id鼟鶐鹴龅龦龣龅鶎麟鹒鹐齚鼤鶊鶉鶆點黝鹴鼚鼐齓黪鷌鶱鶭麢鼦點黝鹒鹐龅龔
齗齖鶥.點黝鶃鶁.龦龣id
黪龔field.field.node.article.field_image

龦龣麢鼦點黝龂齾field_storage_config龔
龂齾齺齶id龔field_storage_config
齺龔Drupal\field\Entity\FieldStorageConfig
鷺鷹齳龔Drupal\Core\Config\Entity\ConfigEntityBase
龂鷭麿麻龔Drupal\field\FieldStorageConfigInterface
鹯麿麻鷺鷹鸦齓鷌麿麻龔
點黝龂齾麿麻龔Drupal\Core\Config\Entity\ConfigEntityInterface;
龦龣麢鼦齫齧麿麻龔Drupal\Core\Field\FieldStorageDefinitionInterface
鹯龂齾鸬鹲鼠龦龣麢鼦齫齧齚麇鹪黋黆麟鹧bundle齚龦龣id齢龔
(龂齾齺齶id.龦龣鶥)
黪龔node.body
龦龣麢鼦點黝鹒鹐麩麢鼦鼤鶊鶉鶆點黝鹴鼚齚麢鼦id齢龔
齗齖鶥(field).點黝鶃鶁(storage).龦龣id
黪龔field.storage.node.body
鹯龂齾龅麢鼦鸾鸼鷋齢龔
Drupal\field\FieldStorageConfigStorage
鵿麿鷺鷹點黝龂齾麢鼦龔Drupal\Core\Config\Entity\ConfigEntityStorage
鷃龳鸪鷂點黝龂齾麢鼦鸾鸼鷋鶾鶼


鵻鷷鼪鼤鷱麝bundle鸙齚龍黊鵺鸬龷龳龦龣鸍鸉黽鵹齚鹍黪鷱麝鸝鸜齺齶鸙鼔龍黊鸬鵵鶡龦龣鸍鸉黽鵹齚鷊鵴鷃龅鼔鼐鸬鶲鶼龦龣鸍鸉黚黖齚鸓鸐鼔鸶黨龦龣黚黖鸦齚鸪鸧黦鼌龷龳龦龣黚黖點黝龂齾麖麢鼦麩黚黖龅龷龳龦龣齫齧龔
龷龳龦龣黚黖點黝龂齾龔
龂齾id龔base_field_override
龂齾齺龔Drupal\Core\Field\Entity\BaseFieldOverride
鼫龡鶃鵰龅龦龣點黝龂齾龒鹖鷺鷹齳龦龣點黝龷齺齚鹯龷齺龂鷭鸦龦龣點黝麿麻龔
Drupal\Core\Field\FieldConfigInterface
鹯麿麻鵭鷺鷹鸦龦龣齫齧麿麻龡點黝龂齾麿麻龔
Drupal\Core\Field\FieldDefinitionInterface
Drupal\Core\Config\Entity\ConfigEntityInterface
鼫鵬鼐龦龣齫齧鸬鷿鼘鼐龒龑點黝龂齾齚麢鼦鵨麩bundle黚黖龅龷龳龦龣齫齧齚龡龦龣點黝龂齾龒鹖齚麩黚黖龦龣龅id黏鶪黭鶸鶧鶦齟龂齾齺齶id鹀bundleID鹀龦龣鶥齚齓鶡鶟鶞麿鼯齚點黝鶃鶁齢龔base_field_override齚鹙鹘齗齖齢鷕鹧core齚鼟齓鼤鶊鶉鶆點黝鹴鼚龅點黝鶥齢龔
core.base_field_override.龦龣id
黪龔core.base_field_override.node.article.path
黼龑龂齾鹍鵦鵢鵞齚龍齓鵝麙點黝鵜鼚鵚鷥鹥龍齓鸍鸉黚黖齚黂鼚黏鶐鸼齗鶭鹄鵘龅麶麲鵗鷮龅點黝鵜黆黊黚黖齚黪龔isDisplayConfigurable($context)鹀isReadOnly()鸿鸿


鵋龦龣龔
鵈extra fields鵆麎鵂鵈pseudo-field鵆齚黼鼤龳鸪鷂龅龂齾龦龣鸞鸼鷋齟鸜鷋鴿鴽id龔entity_field.manager鼯鼚鴼鴺麦

龦龣鴸鴴龔
鴲鴰鴭drupal龅鴸鴴鴬鴫鴨鴦齚龍齓鴢鵝龳鸪鷂龅鵈鷕鹧鸾鸼鴡鴟HttpKernel鵆鶾鶼鸼鴙鴸鴗鴬鴫鷋麦鴓鴑麢鼦龍鴰鴭龳鸪鷂龅鵈鴐鴍鹒鹐state鴋鴓鴑麢鼦鸪鸧鵆鶾鶼
鴿鴽id龔鵈field_definition.listener鵆
Class龔Drupal\Core\Field\FieldDefinitionListener
鹯鴿鴽鴅鹲龦龣齫齧龅鴂鷱鹀鸰鷳鹀鴁鳿鶓黵齚鶐鸼鸦龂齾麢鼦鸾鸼鷋龅鶎鹲麶麲齚鹨鳾鳼鴓鴑麢鼦鸪鸧龡龂齾龦龣鸞鸼鷋鼚龅龦龣鳸鳵鶊鶉

鴿鴽id龔鵈field_storage_definition.listener鵆
Class龔Drupal\Core\Field\FieldStorageDefinitionListener
鹯鴿鴽鴅鹲龦龣麢鼦齫齧龅鴂鷱鹀鸰鷳鹀鴁鳿鶓黵

龦龣鳱鳮鳫鳪龔
黼麡鼤齗齖鳧鳥鳣鳱鳮鶾鶼鼚鴼鴙

龦龣鶧鴴鳟鶡鳜鳙龔
龒龑龦龣field鸬鷿鼐黏鶎鹜齺齶龅鳕鳔items鸬鷿鳒鶦龅鷂鹴鶊鶉鸬鷿齚鳕鳔items鸬鷿鼐龒龑鳑鳐鶊鶉鸬鷿齟鳑鳐鶊鶉鸬鷿鼌麲齺鳌php龅麟鳈鶊鶧齚鳇黆鹜鳅鸾鼐齫齧鶃鳂鳁鸗鲽鲼鶊鶉齫齧齚鼝鲺鹗鴓齚鲷龑鴓鼐鲶鸐鶊鶉齚黒php龅麟鳈鶊鶧黆鳂鲵鸗鲽鲼鼯齚鲷黹齺齶龅鳕鳔items鶐鹴鵨龒黹龦龣齺齶齚鸪鸧鼤鶊鶉鶆鼚鲱鶉龦龣齺齶鷱麝鸬鹲龅龒鲮鶊鶉鹴齚鲪鲦龦龣鹴齚鲷龑鳕鳔items鸬鷿鸬鹲鶊鶉鶆鹴鼚龅龒鸉鲢鲞齚鳕鳔items鸬鷿龍齓鼝龒龑麎鷥龑鲜鲚齚鼘鼔鼐鲷黹龦龣齺齶龍齓鼝龒龑麎鷥龑鲜鲚齚黪email 龦龣鷔鼝 'value'鲜鲚 齚link 龦龣鼝 'title' 鹀 'url' 鲜鲚齚 text龦龣鼝 'value', 'summary', 龡'format'鲜鲚齚鲷龑鲜鲚鸬鹲龦龣鹴鼚龅龒龑鷂齟黼鹗鷂鼤龦龣鳕鳔麿麻龅schema麶麲麎龦龣麢鼦齫齧龅getSchema()麶麲鼚鲔鶉SchemaAPI鲋齫鼯齚鳇鲈鳅鲅黆鹝齚龦龣鹴鸶黨黂黀鵚鷥鷂麖麢鼦鳂黨龅鶊鶉齚黪鲂龳鶟鹀鲁鱿鶐鱽鹀龂齾id鹀bundle鸿鸿麦

本书共63小节:

评论 (写第一个评论)