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鸺鸺麺

本书共71小节:

评论 (写第一个评论)