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鹎鹎麸

本书共88小节:

评论 (写第一个评论)