Devel Load
Primary tabs
Secondary tabs
- ⧉⌕Drupal\node\Entity\Node (29)
- Properties (29)
- Available methods (146)
- Static class properties (10)
- protected entityTypeId -> string (4) "node"
- protected enforceIsNew -> null
- protected typedData -> null
- protected cacheContexts -> array (0)
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- ⧉protected values -> array (22)
- ⧉nid => array (1)
- x-default => string (3) "479"
- ⧉vid => array (1)
- x-default => string (3) "479"
- ⧉type => array (1)
- x-default => string (10) "staticpage"
- ⧉uuid => array (1)
- x-default => string (36) "17b89f0b-2982-4a17-9f9c-8da9768add41"
- ⧉langcode => array (1)
- x-default => string (2) "cs"
- ⧉revision_uid => array (1)
- x-default => string (3) "127"
- ⧉revision_timestamp => array (1)
- ⧉x-default => string (10) "1694333151"
2023-09-10 08:05:51 UTC
- ⧉revision_log => array (1)
- x-default => null
- ⧉revision_default => array (1)
- x-default => string (1) "1"
- ⧉isDefaultRevision => array (1)
- x-default => string (1) "1"
- ⧉status => array (1)
- x-default => string (1) "1"
- ⧉uid => array (1)
- x-default => string (3) "127"
- ⧉title => array (1)
- x-default => UTF-8 string (53) "Zadání soutěžní úlohy "Věž (Tower)" - finále"
- ⧉created => array (1)
- ⧉x-default => string (10) "1694333151"
2023-09-10 08:05:51 UTC
- ⧉changed => array (1)
- ⧉x-default => string (10) "1701679479"
2023-12-04 08:44:39 UTC
- ⧉promote => array (1)
- x-default => string (1) "0"
- ⧉sticky => array (1)
- x-default => string (1) "0"
- ⧉default_langcode => array (1)
- x-default => string (1) "1"
- ⧉revision_translation_affected => array (1)
- x-default => string (1) "1"
- ⧉content_translation_source => array (1)
- x-default => string (0) ""
- ⧉content_translation_outdated => array (1)
- x-default => string (1) "0"
- ⧉field_longtext => array (1)
- ⧉x-default => array (1)
- ⧉0 => array (2)
- ⧉value => UTF-8 string (35300) "<h3>Zadání úlohy – „Věž (Tower)“</h3><h3>Cíl projektu "Věž (Tower)"</h3><p c...
<h3>Zadání úlohy – „Věž (Tower)“</h3><h3>Cíl projektu "Věž (Tower)"</h3><p class="text-align-justify">Postavit a naprogramovat robota tak, aby samostatně, bez jakékoli další pomoci sebral co nejvíc barevných kostek ze soutěžní plochy (hřiště) a umístil je dovnitř žlutě vyznačeného obdélníku na hracím hřišti a současně postavil z těchto barevných kostek co nejvyšší věž. Pro snazší orientaci jsou na hřišti vyznačeny naváděcí černé čáry. O vítězství rozhoduje počet získaných bodů. Body robot získává za způsob umístění barevných kostek uvnitř žlutě vyznačeného obdélníku. Většina soutěže bude organizována jako vzájemný zápas dvou robotů na dvou samostatných hřištích (viz obr. 1).</p><drupal-media style="height:543px;width:800px;" alt="" data-entity-type="media" data-entity-uuid="fa2f2f66-af2a-44d7-9991-77b58195bd06" data-view-mode="default"> </drupal-media><p>Obr. 1 Ilustrační obrázek uspořádání soutěžní plochy (hracího hřiště)</p><h3>Vybavení pro řešení úlohy</h3><p>Každý tým může použít při řešení soutěžní úlohy pouze díly ze stanovených souprav a vyjmenovaných dílů. Jsou možné následující varianty sestav souprav a dílů (varianty nelze kombinovat):</p><ul><li><strong>Základní souprava LEGO® MINDSTORMS® Education 45544 EV3, souprava doplňkových dílů 45560 EV3 a síťový adaptér (8887). Tuto sestavu doporučujeme.</strong></li></ul><p> </p><p><a href="/sites/default/files/souboryredakce/45544_element_survey.pdf" target="_blank">Seznam technických dílů základní soupravy LEGO® MINDSTORMS® Education 45544 EV3</a></p><p><a href="/sites/default/files/souboryredakce/45560_element_survey_expansion_set.pdf" target="_blank">Seznam technických dílů soupravy doplňkových dílů 45560 EV3</a></p><drupal-media alt="" data-entity-type="media" data-entity-uuid="e99a9233-e2d8-43cb-b6f6-c179aef0ab83" data-view-mode="default" width="420" height="253" data-width="420"> </drupal-media><p> </p><drupal-media alt="" data-entity-type="media" data-entity-uuid="2d419187-3f23-45b0-adb6-2ba68b068a2b" data-view-mode="default" width="360" height="289" data-width="360"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="ec1597b0-1d09-40c8-a312-227ffa611e09" data-view-mode="default" width="218" height="136" data-width="218"> </drupal-media><p>nebo</p><ul><li>Základní souprava LEGO® MINDSTORMS® EV3 Home Edition 31313, souprava doplňkových dílů 45560 EV3 a síťový adaptér (8887). Místo infračerveného senzoru obsaženého v základní soupravě LEGO® MINDSTORMS® EV3 Home Edition 31313 je možné použít 45504 EV3 ultrazvukový senzor.</li></ul><p> </p><p><a href="/sites/default/files/souboryredakce/lmsuser_guide_lego_mindstorms_ev3_11_tablet_enus.pdf" target="_blank">Seznam technických dílů základní soupravy LEGO® MINDSTORMS® EV3 Home Edition 31313</a></p><p><a href="/sites/default/files/souboryredakce/45560_element_survey_expansion_set.pdf" target="_blank">Seznam technických dílů soupravy doplňkových dílů 45560 EV3</a></p><drupal-media alt="" data-entity-type="media" data-entity-uuid="dfce9423-9bea-4fe0-9a03-70d82d380d23" data-view-mode="default" width="334" height="306" data-width="334"> </drupal-media><p> </p><drupal-media alt="" data-entity-type="media" data-entity-uuid="2d419187-3f23-45b0-adb6-2ba68b068a2b" data-view-mode="default" width="360" height="289" data-width="360"> </drupal-media><p> </p><drupal-media alt="" data-entity-type="media" data-entity-uuid="ec1597b0-1d09-40c8-a312-227ffa611e09" data-view-mode="default" width="218" height="136" data-width="218"> </drupal-media><p>nebo</p><ul><li>Základní souprava LEGO® MINDSTORMS® Education (9797), souprava technických dílů (9648 nebo 9695) – doplňkové pasivní díly, síťový adaptéru (9833 nebo 8887) a jednoosý gyroskopický senzor (1044 NXT Gyroskop).</li></ul><p> </p><p><a href="/sites/default/files/souboryredakce/base-set_parts-list.pdf" target="_blank">Seznam technických dílů základní soupravy LEGO® MINDSTORMS® Education (9797)</a></p><p><a href="/sites/default/files/souboryredakce/9648_elements.pdf" target="_blank">Seznam technických dílů soupravy technických dílů 9648</a> NEBO <a href="/sites/default/files/souboryredakce/9695_elements.pdf" target="_blank">Seznam technických dílů soupravy technických dílů 9695</a></p><drupal-media alt="" data-entity-type="media" data-entity-uuid="21659e3a-2123-4663-a65a-07996a916a16" data-view-mode="default" width="400" height="260" data-width="400"> </drupal-media><p> </p><drupal-media alt="" data-entity-type="media" data-entity-uuid="f40a1cde-3879-420e-8585-55a422eb9360" data-view-mode="default" width="287" height="301" data-width="287"> </drupal-media><p> </p><drupal-media alt="" data-entity-type="media" data-entity-uuid="ec1597b0-1d09-40c8-a312-227ffa611e09" data-view-mode="default" width="218" height="136" data-width="218"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="2bc2e1cc-2fa7-419e-ae92-9c8bd9298311" data-view-mode="default" width="107" height="107" data-width="107"> </drupal-media><p>Každý tým může použít pouze jednu sestavu z výše uvedených (vztahuje se na celou soutěž).</p><h3>Konstrukce robota</h3><p class="text-align-justify">Ke konstrukci robota lze využít pouze dílů z výše uvedených sestav (pouze jedné z uvedených variant). Za díly z dané sestavy lze považovat pouze takové díly, které jsou uvedeny v seznamu dílů obsažených v příslušné soupravě (vyobrazeny na kartách příslušných setů), nebo jsou v rámci sestavy jmenovány. Lze použít jen maximálně takový počet jednotlivých dílů, jaký je uveden v přehledu dílů dané sestavy. Použití vázacích pásků a obalů, s nimiž jsou soupravy dodávány, není přípustné. Díly stavebnice mohou držet pohromadě pouze pomocí standardních spojovacích prvků LEGO.</p><p>Velikost robota není omezena.</p><p class="text-align-justify">Není povoleno používat kluzný podvozek. Za podvozek či jeho část je považována jakákoliv součást robota, která je při pohybu robota po rovině ve styku s pojezdovou plochou (i dočasně) a přenáší na pojezdovou plochu část váhy robota. Kluzný podvozek je takový, jehož libovolná část se po pojezdové ploše neodvaluje, ale klouže. Za porušení pravidel nebude považováno, pokud není kluzný podvozek součástí návrhu robota a vznikl pouze poškozením konstrukce v dané jízdě (např. nárazem do překážky). Porušením pravidla také není dotyk pevné části konstrukce s pojezdovou plochou, pokud se tak stává pouze nahodile (např. při prudkém zastavení), jen krátce (méně než 1s), nebo v době, kdy se robot po pojezdové ploše nepohybuje (např. stojí a zvedá se).</p><p>UPOZORNĚNÍ: Použití lepidel, šroubů a jiných spojovacích materiálů není povoleno.</p><h3>Programování robota</h3><p class="text-align-justify">V rámci řešených úkolů a soutěže je povoleno využít libovolného programovacího jazyka k naprogramování EV3 kostky, NXT kostky (řídicí jednotka LEGO® MINDSTORMS®). Řídicí jednotka při odevzdání (vrácení zapůjčené) musí obsahovat standardní firmware LEGO® MINDSTORMS®. Při programování EV3 kostky nebo NXT kostky a testování robota lze využít k napájení akumulátor, vlastní baterie nebo síťový adaptér. Při vlastní soutěži je možné použít pouze akumulátor nebo baterie!</p><p class="text-align-justify">Pravidla soutěže předpokládají samostatnou práci účastníků (žáků/ studentů). Je dovoleno užívat cizí knihovny a části kódu, které implementují zejména standardní algoritmy. Takové knihovny a části kódu však musí být veřejně dostupné (např. na internetu) a to již před soutěží (alespoň měsíc). Pokud je použit cizí kód v komentáři v programu musí být uvedena reference. Je možné také využít rady třetí strany, ale výsledný program musí být prací členů týmu. Není dovoleno používat programy kolegů (dalších účastníků), pokud se nejedná o případ veřejně dostupného kódu. Členové týmu jsou povinni v případě pochybnosti autorství obhájit tak, že předvedou a vysvětlí funkčnost dotčených částí programu.</p><h3>Soutěžní plocha a kostky</h3><p class="text-align-justify">Soutěžní plocha (hrací hřiště) je vodorovná deska. Celkové rozměry soutěžní plochy jsou 2560 mm (délka) x 1720 mm (šířka). Podkladem soutěžní plochy je šedá laminátová deska ohraněná bočními lištami (laminátová deska), které tvoří nad pojezdovou plochou stěny o výšce 75mm. Soutěžní plocha je pomyslně rozdělena na 9 x 6 (celkem 54 čtverců o velikosti 280mm x 280mm – viz ilustrační obr. 1 a obr. 2).</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="b575af05-b7ce-4dff-9e3f-35e14a27f04e" data-view-mode="default" width="781" height="585" data-width="781"> </drupal-media><p>Obr. 2 Fotografie uspořádání soutěžní plochy (hracího hřiště)</p><p class="text-align-justify">Na větší části šedé laminátové desky budou upevněny (průsvitnou lepící páskou) bílé papíry s vyznačenými černými čarami (dráha) a vyznačenými místy pro umístění barevných kostek (viz. obr. 2 a obr. 3). Na hřišti jsou nakresleny černé čáry pro navigaci robotů. Na bílých papírech bude navíc vyznačen žlutý obdélník, který bude určen k pokládání barevných kostek. Černé i žluté čáry mají konstantní tloušťku, která se dle tisku může pohybovat v rozmezí 18-25 mm.</p><drupal-media style="height:565px;width:800px;" alt="" data-entity-type="media" data-entity-uuid="4f9b9ee5-e0b4-41af-be01-f555bb4c63b6" data-view-mode="default"> </drupal-media><p>Obr. 3 Uspořádání soutěžní plochy (hracího hřiště) s kótami v mm</p><p>Ke stažení je k dispozici nákres hracího hřiště v <a href="/sites/default/files/souboryredakce/plan_ss_ver1_2023_01.pdf" target="_blank">pdf</a> formátu.</p><p class="text-align-justify">Na konci černých čar (viz obr. 3) budou vyznačena místa pro umístění barevných kostek (modrá, červená, žlutá a zelená) tak, že střed kostky bude na konci černé čáry uprostřed. Celkem bude takto rozmístěno na hracím hřišti 14 barevných kostek. Na hracím hřišti budou navíc umístěny dvě zelené kostky, ke kterým nepovedou černé čáry.</p><p>Při řešení úlohy je možné použít barevné kostky dřevěné o velikosti 4cm (viz obr. 4), které se dají zakoupit na <a href="https://www.drevenekostky.cz/drko-drevene-kostky-4-cm-4-barvy-20-k" target="_blank">www.drevenekostky.cz</a></p><drupal-media style="height:351px;width:800px;" alt="" data-entity-type="media" data-entity-uuid="9100a15a-df4e-4fb0-8877-6d80e81342f3" data-view-mode="default"> </drupal-media><p>Obr. 4 Dřevěné barevné kostky o velikosti 4 cm (váha 45g±5g)</p><p>Na obr. 5 je vidět váha jednotlivých dřevěných kostek o velikosti 4cm</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="f984f26d-8969-45af-84f5-033f7a0572f4" data-view-mode="default" width="1103" height="257" data-width="1103"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="1d2f1c07-8d20-40a6-a1f0-4d2ff70111d7" data-view-mode="default" width="1106" height="246" data-width="1106"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="14f4c95b-723a-4d08-b2df-da5b7313be23" data-view-mode="default" width="1109" height="264" data-width="1109"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="a71d9efc-60ec-4ec8-b5e2-5e1239021026" data-view-mode="default" width="1111" height="247" data-width="1111"> </drupal-media><p>Obr. 5 Váha jednotlivých dřevěných kostek o velikosti 4cm</p><p>Nebo je možné použít kostky vytisknuté na 3D tiskárně (viz obr. 6). <a href="/sites/default/files/souboryredakce/kostka_4cm.zip" target="_blank">Data k tisku</a> (v PrusaSlicer byl použit profil "0.30mm DRAFT" (výplň 20%) s tryskou 0,4 mm. Váha kostky je 25g±5g.</p><p>Soutěžní kostky budou vytisknuty z následujících filamentů od firmy Průša:</p><p><a href="https://www.prusa3d.com/cs/produkt/prusament-pla-lipstick-red-1kg/" target="_blank">Prusament PLA Lipstick Red 1kg</a></p><p><a href="https://www.prusa3d.com/cs/produkt/prusament-pla-pineapple-yellow-1kg/" target="_blank">Prusament PLA Pineapple Yellow 1kg</a></p><p><a href="https://www.prusa3d.com/cs/produkt/prusament-pla-royal-blue-blend-970g/" target="_blank">Prusament PLA Blend Royal Blue 970g</a></p><p><a href="https://www.prusa3d.com/cs/produkt/prusament-pla-simply-green-1kg/" target="_blank">Prusament PLA Simply Green 1kg</a></p><drupal-media alt="" data-entity-type="media" data-entity-uuid="59f61b79-5f0c-4e2f-8d15-98bc0baacebd" data-view-mode="default" width="540" height="398" data-width="540"> </drupal-media><p>Obr. 6 Plastové kostky o velikosti 4cm vytisknuté na 3D tiskárně (váha 25g±5g)</p><p>Na obr. 7 je pro porovnání fotografie dřevěných kostek a kostek z 3D tiskárny.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="a9a5624f-51d6-44a0-8637-a3d09cf9c765" data-view-mode="default" width="730" height="547" data-width="730"> </drupal-media><p>Obr. 7 Fotografie dřevěných kostek a kostek z 3D tiskárny</p><p>Na obr. 8 je vidět váha jednotlivých kostek o velikosti 4cm vytisknutých na 3D tiskárně</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="1c70c0a2-53c8-4a3c-adbd-27ea11533984" data-view-mode="default" width="1143" height="264" data-width="1143"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="14b3d1df-5ae1-4a21-8779-2ef737bcda11" data-view-mode="default" width="1144" height="264" data-width="1144"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="8633bc94-cbe4-4bff-807b-97464fee6250" data-view-mode="default" width="1144" height="263" data-width="1144"> </drupal-media><drupal-media alt="" data-entity-type="media" data-entity-uuid="f0a6972c-5e60-43df-8b63-4f454b41b591" data-view-mode="default" width="1143" height="268" data-width="1143"> </drupal-media><p>Obr. 8 Váha jednotlivých kostek o velikosti 4cm vytisknutých na 3D tiskárně</p><p>Není možné kombinovat dřevěné kostky a kostky vytisknuté na 3D tiskárně. Je možné použít buď všechny dřevěné barevné kostky nebo všechny barevné kostky vytisknuté na 3D tiskárně.</p><h3>Pravidla pro souboje robotů</h3><p class="text-align-justify">Před zahájením jízdy lze položit na hřiště robota na libovolné místo tak, aby se jeho podvozek dotýkal černé čáry (případně půdorys robota zasahoval do černé čáry). Na povel startéra spustí účastník (operátor) robota stiskem tlačítka na řídicí jednotce NXT nebo EV3 kostky, nebo pomocí např. dotykového nebo ultrazvukového senzoru. Není dovoleno spuštění programu v řídicí jednotce NXT nebo EV3 z notebooku či jiného obdobného zařízení. Jiný způsob spuštění konzultujte pro jistotu před vlastní soutěží s organizátorem soutěže. Robot se po zahájení soutěžní jízdy musí pohybovat samostatně, ovládání robota pomocí hlasu, bluetooth či jiných komunikačních kanálů není dovoleno. V případě porušení pravidel je tým okamžitě diskvalifikován v dané soutěžní jízdě.</p><p>Každý tým smí v soutěži použít pouze jednoho robota sestaveného ze stanovených souprav a vyjmenovaných dílů (viz odstavec Vybavení pro řešení úlohy).</p><p>Zároveň se spuštěním robotů je spuštěna časomíra. Robot má po startu 90 sekund na získání co největšího počtu bodů.</p><p class="text-align-justify">Před začátkem každé soutěžní jízdy mají hráči na požádání k dispozici přípravný čas pro kalibraci senzorů či výběr programu z řídicí jednotky (NXT nebo EV3 kostka). Přípravný čas je limitován maximální délkou jedné minuty. Během tohoto času není dovoleno nahrávat řídicí programy do řídicí jednotky (NXT nebo EV3 kostky).</p><p class="text-align-justify">Úkolem robota je sebrat co nejvíc barevných kostek na hracím hřišti a umístit je do žlutě vyznačeného obdélníku. Robotu není v žádném případě dovoleno úmyslné házení kostky (kostek) na hracím hřišti. Způsob umístění kostek bude navíc bodován následujícím způsobem:</p><ol><li>Za každou kostku umístěnou uvnitř žlutého obdélníku (nesmí se dotýkat žluté čáry = průmět kostky kolmo k bílému papírovému podkladu musí být celý uvnitř žlutého obdélníku) a položenou na bílém papírovém podkladu je 1 bod (pokud tedy robot přemístí všech 16 kostek do žlutého obdélníku, může získat celkem 16 bodů)</li><li>Za každou kostku položenou na kostce, která je položená na bílém papírovém podkladu získá robot 2 body (průmět této druhé kostky kolmo k bílému papírovému podkladu nemusí být celý uvnitř žlutého obdélníku)</li><li>Za každou další kostku položenou na předcházejících (stavba věže při splnění podmínky v bodě 2 týkající se průmětu kostek) je možné získat následující počet bodů:<ul><li>za třetí kostku v pořadí jsou 4 body (3 kostky na sobě = 1 + 2 + 4 = 7 bodů celkem)</li><li>za čtvrtou kostku v pořadí je 8 bodů (4 kostky na sobě = 1 + 2 + 4 + 8 = 15 bodů celkem)</li><li>za pátou kostku v pořadí je 15 bodů (5 kostek na sobě = 1 + 2 + 4 + 8 + 15 = 30 bodů)</li><li>za šestou kostku v pořadí je 20 bodů (6 kostek na sobě = 1 + 2 + 4 + 8 + 15 + 20 = 50 bodů celkem)</li><li>za sedmou a každou další kostku v pořadí je 25 bodů (tzn. například pro 7 kostek na sobě = 1 + 2 + 4 + 8 + 15 + 20 + 25 = 75 bodů a například pro 8 kostek na sobě = 1 + 2 + 4 + 8 + 15 + 20 + 25 + 25 = 100 bodů</li></ul></li><li>Navíc pokud by věž byla postavena ze 2 nebo 3 nebo 4 kostek stejné barvy, tým získá dvojnásobný počet bodů (tzn. např. 2 kostky stejné barvy na sobě = 2 * (1 + 2) = 6 bodů celkem, za 3 kostky stejné barvy na sobě = 2 * (1 + 2 + 4) = 14 bodů celkem a za 4 kostky stejné barvy na sobě = 2 * ( 1 + 2 + 4 + 8) = 30 bodů celkem). Podmínkou je, že v postavené věži jsou kostky pouze jedné barvy.</li><li>Navíc pokud by byla věž postavena z 5 a více kostek a ve věži byly na sobě 2 kostky stejné barvy v pořadí na sobě, získá robot navíc 3 body, pokud by tam byly 3 kostky stejné barvy v pořadí na sobě, získá robot navíc 7 bodů a pokud by tam byly 4 kostky stejné barvy v pořadí na sobě, získá robot navíc 15 bodů.</li><li>Navíc za každou věž postavenou ze 4 a více kostek získá robot 5 bodů.</li><li>Navíc za kkaždou věž postavenou z 8 a více kostek získá robot 10 bodů.</li><li>Navíc za každou věž postavenou z 12 a více kostek získá robot 15 bodů.</li><li>Navíc za každou věž postavenou z 16 kostek získá robot 20 bodů.</li><li>Podmínkou pro přiznání bodů robotu (soutěžícímu týmu) je, že robot se žádnou svojí částí nedotýká postavené věže (eventuálně postavených věží). Pokud nebude zřejmé, zda se robot některou svojí částí dotýká věže (věží), nebudou robotu (soutěžícímu týmu) body za tuto věž (věže) přiznány. Současně kostky nebo věž (věže) nesmí být uvnitř robota (a samozřejmě ani uvnitř zásobníku robota).</li><li>V případě, že dojde k situaci, že kostka nebude položena pouze na jedné kostce (věž o 2 kostkách), ale bude položena současně na dvou nebo více kostkách, bude se počítat pouze jedna věž o 2 kostkách na sobě s maximální hodnotou (viz příklady bodování g).</li></ol><p> </p><p>Na následujících obrázcích jsou příklady bodování:</p><p>a) Všechny kostky jsou uvnitř žlutého obdélníku a žádná se nedotýká žluté čáry = 16 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="8b6628c6-c5bd-44d4-87b4-88610f2634ef" data-view-mode="default" width="471" height="353" data-width="471"> </drupal-media><p>b) Za dvě modré kostky ve věži je 2 * (1 + 2) = 6 bodů, za modrou a zelenou kostku ve věži jsou 1 + 2 = 3 body a za zbývající kostky uvnitř žlutého obdélníku jsou 3 body. Celkem tedy 12 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="35e1da5d-8030-4c1d-80e4-e2e8456bbb75" data-view-mode="default" width="475" height="356" data-width="475"> </drupal-media><p>c) Za dvě zelené kostky ve věži je 2 * (1 + 2) = 6 bodů, za čtyři modré kostky ve věži je 2 * ( 1 + 2 + 4 + 8) + 5 (za věž postavenou ze 4 a více kostek) = 35 bodů a za zbývající kostky uvnitř žlutého obdélníku jsou 4 body. Celkem tedy 45 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="5478d3cc-3213-419d-afbf-98b8d1927423" data-view-mode="default" width="475" height="356" data-width="475"> </drupal-media><p>d) Za čtyři modré kostky ve věži je 2 * ( 1 + 2 + 4 + 8) + 5 (za věž postavenou ze 4 a více kostek) = 35 bodů, za tři zelené kostky ve věži je 2 * (1 + 2 + 4) = 14 bodů, za dvě věže postavené ze dvou kostek červené barvy je 2 * 2 * (1 + 2) = 12 bodů a za zbývající kostky uvnitř žlutého obdélníku jsou 2 body. Celkem tedy 63 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="b2f6e30e-a6e3-4838-bea6-a36132714fd5" data-view-mode="default" width="479" height="359" data-width="479"> </drupal-media><p>e) Za čtyři modré kostky ve věži je 2 * ( 1 + 2 + 4 + 8) + 5 (za věž postavenou ze 4 a více kostek) = 35 bodů, za čtyři zelené kostky ve věži je také 2 * ( 1 + 2 + 4 + 8) + 5 (za věž postavenou ze 4 a více kostek) = 35 bodů, za dvě věže postavené ze dvou kostek červené barvy je 2 * 2 * (1 + 2) = 12 bodů a za dvě věže postavené ze dvou kostek žluté barvy je 2 * 2 * (1 + 2) = 12 bodů. Celkem tedy 94 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="ca297c1f-81db-486f-95e1-90238753bc76" data-view-mode="default" width="483" height="362" data-width="483"> </drupal-media><p>f) Za čtyři věže postavené ze čtyř kostek stejné barvy je celkem 4 * (2 * ( 1 + 2 + 4 + 8) + 5) = 140 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="c76f48bc-7c3a-478d-87a6-6233d3141bbf" data-view-mode="default" width="487" height="365" data-width="487"> </drupal-media><p>g) Za tři modré kostky ve věži je 2 * (1 + 2 + 4) = 14 bodů, za dvě červené kostky ve věži je 2 * (1 + 2) = 6 bodů (jedná se o červenou kostku, která leží současně na žluté a červené kostce = počítá se pouze jedna věž s maximálním počtem bodů) a za zbývající kostky uvnitř žlutého obdélníku je 11 bodů. Celkem tedy 31 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="7015ed6d-8ab4-4e68-812f-db10f344b71e" data-view-mode="default" width="490" height="367" data-width="490"> </drupal-media><p>h) Za věž postavenou z 5 kostek je celkem 1 + 2 + 4 + 8 + 15 + 15 (4 kostky stejné barvy (zelená) v pořadí na sobě) + 5 (za věž postavenou ze 4 a více kostek) = 50 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="190b9996-aae2-4bfe-86e7-3a07b19437cd" data-view-mode="default" width="492" height="369" data-width="492"> </drupal-media><p>Za věž postavenou ze 6 kostek je celkem 1 + 2 + 4 + 8 + 15 + 20 + 15 (4 kostky stejné barvy (zelená) v pořadí na sobě) + 5 (za věž postavenou ze 4 a více kostek) = 70 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="6b814a84-bfc1-4213-af96-c0c2ca7096e2" data-view-mode="default" width="495" height="371" data-width="495"> </drupal-media><p>Za věž postavenou ze 7 kostek je celkem 1 + 2 + 4 + 8 + 15 + 20 + 25 + 15 (4 kostky stejné barvy (zelená) v pořadí na sobě) + 3 (2 kostky stejné barvy (červená) v pořadí na sobě) + 5 (za věž postavenou ze 4 a více kostek) = 98 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="b3c473c6-a9c5-4347-97bf-a0cc3092c094" data-view-mode="default" width="502" height="376" data-width="502"> </drupal-media><p>Za věž postavenou z 8 kostek je celkem 1 + 2 + 4 + 8 + 15 + 20 + 25 + 25 + 15 (4 kostky stejné barvy (zelená) v pořadí na sobě) + 3 (2 kostky stejné barvy (červená) v pořadí na sobě) + 10 (za věž postavenou z 8 a více kostek) = 128 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="bb5738c9-59bb-4cdc-8a44-9b59861fc0d8" data-view-mode="default" width="510" height="382" data-width="510"> </drupal-media><p>Za věž postavenou z 9 kostek je celkem 1 + 2 + 4 + 8 + 15 + 20 + 25 + 25 + 25 + 15 (4 kostky stejné barvy (zelená) v pořadí na sobě) + 3 (2 kostky stejné barvy (červená) v pořadí na sobě) + 10 (za věž postavenou z 8 a více kostek) = 153 bodů.</p><drupal-media alt="" data-entity-type="media" data-entity-uuid="064a0022-2327-4238-abc8-83fd696da8d5" data-view-mode="default" width="515" height="386" data-width="515"> </drupal-media><p>Jízda bude ukončena pokud:</p><ol><li>Robot opustí hrací hřiště</li><li>Robot se dotkne svojí částí předmětu mimo hrací hřiště (stůl apod.)</li><li>Robot není bez pomoci schopen pokračovat v jízdě</li><li>Při překročení maximálního času pro průjezd dráhou (90s).</li><li>Soutěžící se dotkne robota (například sám zvedne robota z hracího hřiště) poté, co je splněna některá z předchozích podmínek 1 až 4.</li></ol><p> </p><p>Pokud je soutěžní jízda ukončena dříve, robot je odstraněn z hrací plochy a bude zaznamenán do té doby počet dosažených bodů. Robot se může pohybovat libovolně po hracím hřišti.</p><p>Maximálně může tým za jednu postavenou věž ze všech 16 kostek získat v jednom souboji 380 bodů.</p><p>Pokud soutěžící robot v časovém limitu 90s ukončí svojí jízdu (zastaví se a nebude se hýbat) a zvukově (akustický signál) informuje o této skutečnosti, získá navíc 3 body. Akustický signál musí zaznít až po zastavení robota, musí trvat minimálně 5s a musí být dostatečně hlasitý. Po vydání akustického signálu o ukončení jízdy se robot již nesmí pohnout.</p><p>Pokud robot vyjede (nebude žádná část robota uvnitř žlutého obdélníku ani se nebude dotýkat žluté čáry vyznačující žlutý obdélník (tím je myšlen i průmět kolmo libovolné části robota k podkladovému papíru) ze žlutě označeného obdélníku a následně ukončí svojí jízdu, získá navíc 7 bodů.</p><p>V daném souboji vítězí ten robot, který získá větší počet bodů. V případě rovnosti bodů zvítězí ten tým, který:</p><ol><li>Postavil vyšší věž (více kostek na sobě)</li><li>Postavil více stejně vysokých věží</li><li>V případě rovnosti stejného počtu stejně vysokých věží (viz bod 2) rozhoduje o vítězství případně postavená nižší věž</li><li>V případě, že nedojde k rozhodnutí podle bodu 3, rozhoduje o vítězství postavených více stejných nižších věží</li><li>Pokud by o vítězi nerozhodli předcházející kritéria (body 1 až 4), zvítězí ten robot, který dosáhl daného počtu bodů rychleji. Za čas, kdy robot dosáhl daného počtu bodů, považujeme okamžik ukončení jízdy. </li></ol><p> </p><p>Body jsou robotu (soutěžícímu týmu) přiznány, pokud věže zůstanou stát minimálně 10s po ukončení jízdy.</p><p><strong>Celkem tak robot může získat v jedné jízdě (jednom souboji) maximálně 390 bodů.</strong></p><h3 style="height:351px margin-right:0cm;margin-left:0cm;width:800px;">Organizace soutěže</h3><p>1. kolo soutěže</p><p>V prvním kole bude mít každý ze soutěžících týmů postupně 3 pokusy na hracím hřišti s cílem získat co největší počet bodů.</p><p>Pořadí soubojů:</p><ul><li>Tým č.1 a Tým č.2</li><li>Tým č.3 a Tým č.4</li><li>Tým č.5 a Tým č.6</li><li>Tým č.7 a Tým č.8</li><li>Tým č.9 a Tým č.10</li><li>Tým č.11 a Tým č.12</li><li>Tým č.13 a Tým č.14</li><li>Tým č.15 a Tým č.16</li><li>Tým č.17 a Tým č.18</li><li>Tým č.19 a Tým č.20</li><li>Tým č.21 a Tým č.22</li><li>Tým č.23 a Tým č.24</li><li>Tým č.25 a Tým č.26</li><li>Tým č.27 a Tým č.28</li><li>Tým č.29 a Tým č.30</li><li>Tým č.31 a Tým č.32</li><li>Tým č.33 a Tým č.34</li><li>Tým č.35 a Tým č.36</li><li>atd.</li></ul><p>Stanovení pořadí týmů v prvním kole:</p><p>Na základě součtu bodů získaných ve třech soutěžních pokusech daným robotem je určeno pořadí po prvním kole. Stanovovat pořadí se bude takto:</p><ol><li>Celkovým počtem bodů (součet tří soutěžních pokusů).</li><li>Při rovnosti bodů dvou nebo více týmů rozhoduje větší počet bodů získaných v jednotlivých soutěžních pokusech.</li><li>Při rovnosti bodů dvou nebo více týmů rozhoduje větší počet bodů získaných v součtu ze dvou soutěžních pokusů.</li><li>Hod hrací kostkou (hozené vyšší číslo vyhrává, v případě rovnosti se hází opakovaně do rozhodnutí).</li></ol><p>Do 2. kola soutěže postupuje 16 týmů podle pořadí.</p><p>2. kolo soutěže</p><p>2. kolo soutěže bude probíhat ve formě vyřazovacího systému na dvě porážky. Vyřazovací systém na dvě porážky je méně obvyklá modifikace vyřazovacího systému, rozpisu utkání turnajů některých her a sportů (tzv. oboustranný pavouk). Turnajem nepostupují jen vítězové, ale i účastníci, kteří prohráli zatím jen jednou. Graf rozpisu utkání se skládá jak z části pro vítěze jako ve vyřazovacím systému, tak i části pro účastníky, kteří již jednou prohráli.</p><p>Páry účastníků do turnaje vstupují podobně jako ve vyřazovacím systému, tedy budou nasazeny tak, aby se dva „papírově“ nejsilnější (týmy s nejlepšími výsledky v 1. kole) mohly sejít jako neporažení až ke konci turnaje. Na začátku jsou všichni ve větvi vítězů. Ti, co vyhrají, postupují do druhého kola. Ti, kteří prohrají, přecházejí na začátek větve poražených.</p><p>Vítěz každého kola ve větvi vítězů se v následujícím kole setká s dalším jiným vítězem z této větve. Poražený z tohoto duelu přechází do větve poražených. Vítěz každého kola ve větvi poražených se v následujícím kole setká s některým poraženým z větve vítězů. Pro poražené ve větvi poražených turnaj končí, neboť prohráli již podruhé.</p><p>Na konci turnaje se vítěz větve vítězů utká v zápase o celkové vítězství s vítězem větve poražených. Pokud v tomto utkání vyhraje vítěz větve poražených, hraje se ještě jeden zápas mezi těmito dvěma účastníky. Tím je zaručeno, že vítěz turnaje jako jediný neokusí porážku více než jednou.</p><p>2. kolo soutěže bude organizováno jako vzájemné utkání dvou robotů v jedné jízdě. Vítězem utkání se stává tým, který získá v této jízdě více bodů. Pokud týmy dosáhnou stejného počtu bodů, zvítězí tým, který dosáhl tohoto počtu bodů prokazatelně dříve. Jestliže oba týmy získají stejný počet bodů za stejný čas (nebudeme schopni rozhodnout prokazatelně, který tým byl rychlejší), bude následovat druhá jízda a pokud ani ta nerozhodne o vítězi, bude následovat hod hrací kostkou (vyšší číslo vyhrává, v případě rovnosti se hází opakovaně do rozhodnutí).</p><h3 style="height:351px margin-right:0cm;margin-left:0cm margin:0cm;width:800px;">Obecná ustanovení</h3><p>Pokud není uvedeno jinak, vede porušení kteréhokoliv z uvedených pravidel k diskvalifikaci robota v dané jízdě (prohra v dané jízdě). O dodržení pravidel a diskvalifikaci rozhoduje hlavní rozhodčí (Martin Hlinovský nebo jím pověřený zástupce) dohlížející na průběh soutěže. Jeho rozhodnutí je konečné.</p><p>Kterýkoliv člen týmu může podat protest proti výsledku v dané jízdě ihned po jejím skončení (maximálně však do 30 s od jejího skončení). Na protesty podané po tomto časovém limitu nebude brán zřetel.</p><p>Pokud nebude po zahájení souboje (jízdy) spuštěna časomíra (chyba organizátorů) bude souboj (jízda) okamžitě po tomto zjištění přerušena a bude se opakovat. Souboj (jízda) se nemusí opakovat, pokud by byl zřejmý vítěz i bez spuštěné časomíry.</p><p>Organizátor soutěže má právo ověřit autorství programu v robotovi formou dotazů k jeho funkcionalitě. Pokud ani jeden člen týmu nebude schopný odpovědět na otázky týkající se funkce robota, bude tím zpochybněno autorství programu a bude to považováno za porušení pravidel soutěže. Účastníci na požádání musí umožnit organizátorům nahlédnout do kódu programu za účelem ověření, zda odpovídá pravidlům soutěže. V těchto případech porušení pravidel si organizátor vyhrazuje právo takový tým vyloučit ze soutěže, a to kdykoliv v průběhu soutěže až do chvíle vyhlášení celkových výsledků. Vyloučený tým pak bude v další části soutěže nahrazen týmem, který byl naposledy vyřazen vyloučeným týmem.</p><p>Žák/ student se může účastnit soutěže pouze jako člen jednoho týmu. Změna týmu, v němž se dotčený soutěže účastní, je možná pouze na základě souhlasu organizátora / hlavního rozhodčího (Martin Hlinovský či pověřený zástupce). Nový žák/student nemůže být zařazen do týmu (nahradit jiného žáka/ studenta), pokud se již tento žák/ student soutěže zúčastnil jako člen jiného týmu (robot tímto týmem připravený se dostavil ke startu v první jízdě).</p>
- format => string (10) "basic_html"
- protected fields -> array (0)
- ⧉protected fieldDefinitions -> array (29)
- ⧉nid => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (6)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "ID"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- read-only => boolean true
- provider => string (4) "node"
- field_name => string (3) "nid"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:integer"
- ⧉settings => array (6)
- unsigned => boolean true
- size => string (6) "normal"
- min => string (0) ""
- max => string (0) ""
- prefix => string (0) ""
- suffix => string (0) ""
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "integer"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉uuid => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (6)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (4) "UUID"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- read-only => boolean true
- provider => string (4) "node"
- field_name => string (4) "uuid"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (15) "field_item:uuid"
- ⧉settings => array (3)
- max_length => integer 128
- is_ascii => boolean true
- case_sensitive => boolean false
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (4) "uuid"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉vid => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (6)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (11) "Revision ID"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- read-only => boolean true
- provider => string (4) "node"
- field_name => string (3) "vid"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:integer"
- ⧉settings => array (6)
- unsigned => boolean true
- size => string (6) "normal"
- min => string (0) ""
- max => string (0) ""
- prefix => string (0) ""
- suffix => string (0) ""
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "integer"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉langcode => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (8)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (8) "Language"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉display => array (2)
- Table (2)
- Contents (2)
options configurable view array (1) true form array (2) true - ⧉view => array (2)
- ⧉options => array (1)
- region => string (6) "hidden"
- configurable => boolean true
- ⧉form => array (2)
- ⧉options => array (2)
- type => string (15) "language_select"
- weight => integer 2
- configurable => boolean true
- revisionable => boolean true
- translatable => boolean true
- provider => string (4) "node"
- field_name => string (8) "langcode"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (19) "field_item:language"
- settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (8) "language"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉type => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (7)
- label => string (10) "Typ obsahu"
- required => boolean true
- read-only => boolean true
- provider => string (4) "node"
- field_name => string (4) "type"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (27) "field_item:entity_reference"
- ⧉settings => array (3)
- target_type => string (9) "node_type"
- handler => string (7) "default"
- handler_settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (16) "entity_reference"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉revision_timestamp => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (7)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (20) "Revision create time"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (47) "The time that the current revision was created."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- provider => string (4) "node"
- field_name => string (18) "revision_timestamp"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:created"
- settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "created"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉revision_uid => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (7)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (13) "Revision user"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (50) "The user ID of the author of the current revision."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- provider => string (4) "node"
- field_name => string (12) "revision_uid"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (27) "field_item:entity_reference"
- ⧉settings => array (3)
- target_type => string (4) "user"
- handler => string (7) "default"
- handler_settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (16) "entity_reference"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉revision_log => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (20) "Revision log message"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (43) "Briefly describe the changes you have made."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- ⧉default_value => array (1)
- ⧉0 => array (1)
- value => string (0) ""
- ⧉display => array (1)
- ⧉form => array (1)
- ⧉options => array (3)
- type => string (15) "string_textarea"
- weight => integer 25
- ⧉settings => array (1) Depth Limit
- provider => string (4) "node"
- field_name => string (12) "revision_log"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (22) "field_item:string_long"
- ⧉settings => array (1)
- case_sensitive => boolean false
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (11) "string_long"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉status => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (9) "Published"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- translatable => boolean true
- ⧉default_value => array (1)
- ⧉0 => array (1)
- value => boolean true
- ⧉display => array (1)
- ⧉form => array (2)
- ⧉options => array (3)
- type => string (16) "boolean_checkbox"
- ⧉settings => array (1) Depth Limit
- weight => integer 120
- configurable => boolean true
- provider => string (4) "node"
- field_name => string (6) "status"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:boolean"
- ⧉settings => array (2)
- ⧉on_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "On"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉off_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (3) "Off"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "boolean"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉uid => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (10)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (11) "Authored by"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- translatable => boolean true
- default_value_callback => string (46) "Drupal\node\Entity\Node::getDefaultEntityOwner"
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (35) "The username of the content author."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- ⧉display => array (2)
- ⧉view => array (1)
- ⧉options => array (3)
- label => string (6) "hidden"
- type => string (6) "author"
- weight => integer 0
- ⧉form => array (2)
- ⧉options => array (3)
- type => string (29) "entity_reference_autocomplete"
- weight => integer 5
- ⧉settings => array (3) Depth Limit
- configurable => boolean true
- provider => string (4) "node"
- field_name => string (3) "uid"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (27) "field_item:entity_reference"
- ⧉settings => array (3)
- target_type => string (4) "user"
- handler => string (7) "default"
- handler_settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (16) "entity_reference"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉title => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (5) "Title"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- required => boolean true
- translatable => boolean true
- revisionable => boolean true
- ⧉display => array (2)
- ⧉view => array (1)
- ⧉options => array (3)
- label => string (6) "hidden"
- type => string (6) "string"
- weight => integer -5
- ⧉form => array (2)
- ⧉options => array (2)
- type => string (16) "string_textfield"
- weight => integer -5
- configurable => boolean true
- provider => string (4) "node"
- field_name => string (5) "title"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (17) "field_item:string"
- ⧉settings => array (3)
- max_length => integer 255
- is_ascii => boolean false
- case_sensitive => boolean false
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (6) "string"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉created => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (11) "Authored on"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (35) "The time that the node was created."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- translatable => boolean true
- ⧉display => array (2)
- ⧉view => array (1)
- ⧉options => array (3)
- label => string (6) "hidden"
- type => string (9) "timestamp"
- weight => integer 0
- ⧉form => array (2)
- ⧉options => array (2)
- type => string (18) "datetime_timestamp"
- weight => integer 10
- configurable => boolean true
- provider => string (4) "node"
- field_name => string (7) "created"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:created"
- settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "created"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉changed => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (8)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (7) "Changed"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (39) "The time that the node was last edited."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- translatable => boolean true
- provider => string (4) "node"
- field_name => string (7) "changed"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:changed"
- settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "changed"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉promote => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (22) "Promoted to front page"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- translatable => boolean true
- ⧉default_value => array (1)
- ⧉0 => array (1)
- value => boolean true
- ⧉display => array (1)
- ⧉form => array (2)
- ⧉options => array (3)
- type => string (16) "boolean_checkbox"
- ⧉settings => array (1) Depth Limit
- weight => integer 15
- configurable => boolean true
- provider => string (4) "node"
- field_name => string (7) "promote"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:boolean"
- ⧉settings => array (2)
- ⧉on_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "On"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉off_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (3) "Off"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "boolean"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉sticky => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (22) "Sticky at top of lists"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- translatable => boolean true
- ⧉default_value => array (1)
- ⧉0 => array (1)
- value => boolean false
- ⧉display => array (1)
- ⧉form => array (2)
- ⧉options => array (3)
- type => string (16) "boolean_checkbox"
- ⧉settings => array (1) Depth Limit
- weight => integer 16
- configurable => boolean true
- provider => string (4) "node"
- field_name => string (6) "sticky"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:boolean"
- ⧉settings => array (2)
- ⧉on_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "On"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉off_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (3) "Off"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "boolean"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉default_langcode => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (19) "Default translation"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (58) "A flag indicating whether this is the default translation."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- translatable => boolean true
- revisionable => boolean true
- ⧉default_value => array (1)
- ⧉0 => array (1)
- value => boolean true
- provider => string (4) "node"
- field_name => string (16) "default_langcode"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:boolean"
- ⧉settings => array (2)
- ⧉on_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "On"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉off_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (3) "Off"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "boolean"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉revision_default => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (10)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (16) "Default revision"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (72) "A flag indicating whether this was a default revision when it was saved."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- storage_required => boolean true
- internal => boolean true
- translatable => boolean false
- revisionable => boolean true
- provider => string (4) "node"
- field_name => string (16) "revision_default"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:boolean"
- ⧉settings => array (2)
- ⧉on_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "On"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉off_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (3) "Off"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "boolean"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉revision_translation_affected => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (9)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (29) "Revision translation affected"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (72) "Indicates if the last edit of a translation belongs to current revision."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- read-only => boolean true
- revisionable => boolean true
- translatable => boolean true
- provider => string (4) "node"
- field_name => string (29) "revision_translation_affected"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:boolean"
- ⧉settings => array (2)
- ⧉on_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "On"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉off_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (3) "Off"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "boolean"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉path => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (8)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (9) "URL alias"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- translatable => boolean true
- ⧉display => array (1)
- ⧉form => array (2)
- ⧉options => array (2)
- type => string (4) "path"
- weight => integer 30
- configurable => boolean true
- computed => boolean true
- provider => string (4) "path"
- field_name => string (4) "path"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (15) "field_item:path"
- settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (4) "path"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉menu_link => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (12)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (9) "Menu link"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (68) "Computed menu link for the node (only available during node saving)."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- revisionable => boolean true
- class => string (35) "\Drupal\token\MenuLinkFieldItemList"
- translatable => boolean true
- internal => boolean true
- ⧉display => array (2)
- ⧉view => array (1)
- ⧉options => array (2)
- label => string (6) "hidden"
- region => string (6) "hidden"
- ⧉form => array (1)
- ⧉options => array (1)
- region => string (6) "hidden"
- computed => boolean true
- provider => string (5) "token"
- field_name => string (9) "menu_link"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (27) "field_item:entity_reference"
- ⧉settings => array (3)
- target_type => string (17) "menu_link_content"
- handler => string (7) "default"
- handler_settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (16) "entity_reference"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉content_translation_source => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (10)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (18) "Translation source"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (60) "The source language from which this translation was created."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉default_value => array (1)
- ⧉0 => array (1)
- value => string (3) "und"
- ⧉initial_value => array (1)
- ⧉0 => array (1)
- value => string (3) "und"
- revisionable => boolean true
- translatable => boolean true
- provider => string (19) "content_translation"
- field_name => string (26) "content_translation_source"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (19) "field_item:language"
- settings => array (0)
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (8) "language"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉content_translation_outdated => Drupal\Core\Field\BaseFieldDefinition (7)
- Properties (7)
- Available methods (94)
- Static class properties
- ⧉protected definition -> array (10)
- ⧉label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (20) "Translation outdated"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉description => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (66) "A boolean indicating whether this translation needs to be updated."
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉default_value => array (1)
- ⧉0 => array (1)
- value => boolean false
- ⧉initial_value => array (1)
- ⧉0 => array (1)
- value => boolean false
- revisionable => boolean true
- translatable => boolean true
- provider => string (19) "content_translation"
- field_name => string (28) "content_translation_outdated"
- entity_type => string (4) "node"
- bundle => null
- protected typedDataManager -> null
- ⧉protected itemDefinition -> Drupal\Core\Field\TypedData\FieldItemDataDefinition (3)
- Properties (3)
- Available methods (41)
- ⧉protected definition -> array (2)
- type => string (18) "field_item:boolean"
- ⧉settings => array (2)
- ⧉on_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (2) "On"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- ⧉off_label => Drupal\Core\StringTranslation\TranslatableMarkup (5)
- Properties (5)
- Available methods (14)
- protected string -> string (3) "Off"
- protected arguments -> array (0)
- protected translatedMarkup -> null
- protected options -> array (0)
- protected stringTranslation -> null
- ⧉public __toString(): string Implements the magic __toString() method.
/** * Implements the magic __toString() method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
- ⧉public __construct($string, array $arguments = array(), array $options = array(), ?Drupal\Core\StringTranslation\TranslationInterface $string_translation = null) Constructs a new class instance.
/** * Constructs a new class instance. * * When possible, use the * \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise * create a new \Drupal\Core\StringTranslation\TranslatableMarkup object * directly. * * Calling the trait's t() method or instantiating a new TranslatableMarkup * object serves two purposes: * - At run-time it translates user-visible text into the appropriate * language. * - Static analyzers detect calls to t() and new TranslatableMarkup, and add * the first argument (the string to be translated) to the database of * strings that need translation. These strings are expected to be in * English, so the first argument should always be in English. * To allow the site to be localized, it is important that all human-readable * text that will be displayed on the site or sent to a user is made available * in one of the ways supported by the * @link https://www.drupal.org/node/322729 Localization API @endlink. * See the @link https://www.drupal.org/node/322729 Localization API @endlink * pages for more information, including recommendations on how to break up or * not break up strings for translation. * * @section sec_translating_vars Translating Variables * $string should always be an English literal string. * * $string should never contain a variable, such as: * @code * new TranslatableMarkup($text) * @endcode * There are several reasons for this: * - Using a variable for $string that is user input is a security risk. * - Using a variable for $string that has even guaranteed safe text (for * example, user interface text provided literally in code), will not be * picked up by the localization static text processor. (The parameter could * be a variable if the entire string in $text has been passed into t() or * new TranslatableMarkup() elsewhere as the first argument, but that * strategy is not recommended.) * * It is especially important never to call new TranslatableMarkup($user_text) * or t($user_text) where $user_text is some text that a user entered -- doing * that can lead to cross-site scripting and other security problems. However, * you can use variable substitution in your string, to put variable text such * as user names or link URLs into translated text. Variable substitution * looks like this: * @code * new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); * @endcode * Basically, you can put placeholders like @name into your string, and the * method will substitute the sanitized values at translation time. (See the * Localization API pages referenced above and the documentation of * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * for details about how to safely and correctly define variables in your * string.) Translators can then rearrange the string as necessary for the * language (e.g., in Spanish, it might be "blog de @name"). * * @param string $string * A string containing the English text to translate. * @param array $arguments * (optional) An associative array of replacements to make after * translation. Based on the first character of the key, the value is * escaped and/or themed. See * \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for * details. * @param array $options * (optional) An associative array of additional options, with the following * elements: * - 'langcode' (defaults to the current language): A language code, to * translate to a language other than what is used to display the page. * - 'context' (defaults to the empty context): The context the source * string belongs to. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * (optional) The string translation service. * * @throws \InvalidArgumentException * Exception thrown when $string is not a string. * * @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() * @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() * * @ingroup sanitization */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
- ⧉public getUntranslatedString(): string Gets the untranslated string value stored in this translated string.
/** * Gets the untranslated string value stored in this translated string. * * @return string * The string stored in this wrapper. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
- ⧉public getOption($name): mixed Gets a specific option from this translated string.
/** * Gets a specific option from this translated string. * * @param string $name * Option name. * * @return mixed * The value of this option or empty string of option is not set. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
- ⧉public getOptions(): mixed[] Gets all options from this translated string.
/** * Gets all options from this translated string. * * @return mixed[] * The array of options. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
- ⧉public getArguments(): mixed[] Gets all arguments from this translated string.
/** * Gets all arguments from this translated string. * * @return mixed[] * The array of arguments. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
- ⧉public render(): string Renders the object as a string.
/** * Renders the object as a string. * * @return string * The translated string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
- ⧉public __sleep() Magic __sleep() method to avoid serializing the string translator.
/** * Magic __sleep() method to avoid serializing the string translator. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
- ⧉public count(): int Returns the string length.
/** * Returns the string length. * * @return int * The length of the string. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:228
- ⧉public jsonSerialize(): string Returns a representation of the object for use in JSON serialization.
/** * Returns a representation of the object for use in JSON serialization. * * @return string * The safe string content. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:120
- ⧉protected _die() For test purposes, wrap die() in an overridable method.
/** * For test purposes, wrap die() in an overridable method. */ Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
- ⧉protected getStringTranslation(): \Drupal\Core\StringTranslation\TranslationInterface Gets the string translation service.
/** * Gets the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationInterface * The string translation service. */ Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
- ⧉protected static placeholderFormat($string, array $args): string Replaces placeholders in a string with values.
/** * Replaces placeholders in a string with values. * * @param string $string * A string containing placeholders. The string itself is expected to be * safe and correct HTML. Any unsafe content must be in $args and * inserted via placeholders. * @param array $args * An associative array of replacements. Each array key should be the same * as a placeholder in $string. The corresponding value should be a string * or an object that implements \Drupal\Component\Render\MarkupInterface. * Null args[] values are deprecated in Drupal 9.5 and will fail in * Drupal 11.0. The value replaces the placeholder in $string. Sanitization * and formatting will be done before replacement. The type of sanitization * and formatting depends on the first character of the key: * - @variable: When the placeholder replacement value is: * - A string, the replaced value in the returned string will be sanitized * using \Drupal\Component\Utility\Html::escape(). * - A MarkupInterface object, the replaced value in the returned string * will not be sanitized. * - A MarkupInterface object cast to a string, the replaced value in the * returned string be forcibly sanitized using * \Drupal\Component\Utility\Html::escape(). * @code * $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); * @endcode * Use this placeholder as the default choice for anything displayed on * the site, but not within HTML attributes, JavaScript, or CSS. Doing so * is a security risk. * - %variable: Use when the replacement value is to be wrapped in <em> * tags. * A call like: * @code * $string = "%output_text"; * $arguments = ['%output_text' => 'text output here.']; * $this->placeholderFormat($string, $arguments); * @endcode * makes the following HTML code: * @code * <em class="placeholder">text output here.</em> * @endcode * As with @variable, do not use this within HTML attributes, JavaScript, * or CSS. Doing so is a security risk. * - :variable: Return value is escaped with * \Drupal\Component\Utility\Html::escape() and filtered for dangerous * protocols using UrlHelper::stripDangerousProtocols(). Use this when * using the "href" attribute, ensuring the attribute value is always * wrapped in quotes: * @code * // Secure (with quotes): * $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): * $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output * could fail HTML validation). To guarantee a valid URL, use * Url::fromUri($user_input)->toString() (which either throws an exception * or returns a well-formed URL) before passing the result into a * ":variable" placeholder. * * @return string * A formatted HTML string with the placeholders replaced. * * @ingroup sanitization * * @see \Drupal\Core\StringTranslation\TranslatableMarkup * @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup * @see \Drupal\Component\Utility\Html::escape() * @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() * @see \Drupal\Core\Url::fromUri() */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:196
- ⧉protected static placeholderEscape($value): string Escapes a placeholder replacement value if needed.
/** * Escapes a placeholder replacement value if needed. * * @param string|\Drupal\Component\Render\MarkupInterface $value * A placeholder replacement value. * * @return string * The properly escaped replacement value. */ Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:269
- protected typedDataManager -> null
- ⧉protected fieldDefinition -> Drupal\Core\Field\BaseFieldDefinition (7) Recursion
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:57
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:64
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:71
- ⧉public getFieldDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:78
- ⧉public setFieldDefinition($field_definition) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:85
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public __construct(array $values = array()) Constructs a new data definition object.
/** * Constructs a new data definition object. * * @param array $values * (optional) If given, an array of initial values to set on the definition. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:46
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:53
- ⧉public setDataType($type): static Sets the data type.
/** * Sets the data type. * * @param string $type * The data type to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:66
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:190
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:217
- ⧉public setSettings(array $settings): static Sets the array of settings, as required by the used class.
/** * Sets the array of settings, as required by the used class. * * @param array $settings * The array of settings. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:230
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:238
- ⧉public setSetting($setting_name, $value): static Sets a definition setting.
/** * Sets a definition setting. * * @param string $setting_name * The definition setting to set. * @param mixed $value * The value to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:253
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:359
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:369
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static createFromDataType($data_type) {@inheritdoc}\Drupal\Core\Field\TypedData\FieldItemDataDefinition::createFromDataType($data_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:28
- ⇄⧉public static create($field_definition): static Creates a new field item definition.\Drupal\Core\Field\TypedData\FieldItemDataDefinition::create($field_definition)
/** * Creates a new field item definition. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition the item definition belongs to. * * @return static */ Defined in <ROOT>/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php:47
- protected type -> string (7) "boolean"
- protected propertyDefinitions -> null
- protected schema -> null
- protected indexes -> array (0)
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:15
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:22
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php:29
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:110
- ⧉public setName($name): static Sets the field name.
/** * Sets the field name. * * @param string $name * The field name to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:123
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:131
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:138
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} * * Note that the method does not unset existing settings not specified in the * incoming $settings array. * * For example: * @code * // Given these are the default settings. * $field_definition->getSettings() === [ * 'fruit' => 'apple', * 'season' => 'summer', * ]; * // Change only the 'fruit' setting. * $field_definition->setSettings(['fruit' => 'banana']); * // The 'season' setting persists unchanged. * $field_definition->getSettings() === [ * 'fruit' => 'banana', * 'season' => 'summer', * ]; * @endcode * * For clarity, it is preferred to use setSetting() if not all available * settings are supplied. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:167
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:179
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:186
- ⧉public getProvider() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:194
- ⧉public setProvider($provider): $this Sets the name of the provider of this field.
/** * Sets the name of the provider of this field. * * @param string $provider * The provider name to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:206
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:214
- ⧉public setTranslatable($translatable): $this Sets whether the field is translatable.
/** * Sets whether the field is translatable. * * @param bool $translatable * Whether the field is translatable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:227
- ⧉public isRevisionable() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:235
- ⧉public setRevisionable($revisionable): $this Sets whether the field is revisionable.
/** * Sets whether the field is revisionable. * * @param bool $revisionable * Whether the field is revisionable. * * @return $this * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:250
- ⧉public getCardinality() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:258
- ⧉public setCardinality($cardinality): $this Sets the maximum number of items allowed for the field.
/** * Sets the maximum number of items allowed for the field. * * Possible values are positive integers or * FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. * * Note that if the entity type that this base field is attached to is * revisionable and the field has a cardinality higher than 1, the field is * considered revisionable by default. * * @param int $cardinality * The field cardinality. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:278
- ⧉public isMultiple() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:286
- ⧉public setPropertyConstraints($name, array $constraints): static Sets constraints for a given field item property.
/** * Sets constraints for a given field item property. * * Note: this overwrites any existing property constraints. If you need to * add to the existing constraints, use * \Drupal\Core\Field\BaseFieldDefinition::addPropertyConstraints() * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:306
- ⧉public addPropertyConstraints($name, array $constraints): static Adds constraints for a given field item property.
/** * Adds constraints for a given field item property. * * Adds a constraint to a property of a base field item. e.g. * @code * // Limit the field item's value property to the range 0 through 10. * // e.g. $node->size->value. * $field->addPropertyConstraints('value', [ * 'Range' => [ * 'min' => 0, * 'max' => 10, * ] * ]); * @endcode * * If you want to add a validation constraint that applies to the * \Drupal\Core\Field\FieldItemList, use BaseFieldDefinition::addConstraint() * instead. * * Note: passing a new set of options for an existing property constraint will * overwrite with the new options. * * @param string $name * The name of the property to set constraints for. * @param array $constraints * The constraints to set. * * @return static * The object itself for chaining. * * @see \Drupal\Core\Field\BaseFieldDefinition::addConstraint() */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:345
- ⧉public setDisplayOptions($display_context, array $options): static Sets the display options for the field in forms or rendered entities.
/** * Sets the display options for the field in forms or rendered entities. * * This enables generic rendering of the field with widgets / formatters, * including automated support for "In place editing", and with optional * configurability in the "Manage display" / "Manage form display" UI screens. * * Unless this method is called, the field remains invisible (or requires * ad-hoc rendering logic). * * @param string $display_context * The display context. Either 'view' or 'form'. * @param array $options * An array of display options. Refer to * \Drupal\Core\Field\FieldDefinitionInterface::getDisplayOptions() for * a list of supported keys. The options should include at least a 'weight', * or specify 'region' = 'hidden'. The 'default_widget' / * 'default_formatter' for the field type will be used if no 'type' is * specified. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:381
- ⧉public setDisplayConfigurable($display_context, $configurable): static Sets whether the display for the field can be configured.
/** * Sets whether the display for the field can be configured. * * @param string $display_context * The display context. Either 'view' or 'form'. * @param bool $configurable * Whether the display options can be configured (e.g., via the "Manage * display" / "Manage form display" UI screens). If TRUE, the options * specified via getDisplayOptions() act as defaults. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:399
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:411
- ⧉public isDisplayConfigurable($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:418
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:425
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:432
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:439
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:456
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:476
- ⧉public getInitialValue(): array Returns the initial value for the field.
/** * Returns the initial value for the field. * * @return array * The initial value for the field, as a numerically indexed array of items, * each item being a property/value array (array() for no default value). */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:491
- ⧉public setInitialValue($value): $this Sets an initial value for the field.
/** * Sets an initial value for the field. * * @param mixed $value * The initial value for the field. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:510
- ⧉public getInitialValueFromField(): string|null Returns the name of the field that will be used for getting initial values.
/** * Returns the name of the field that will be used for getting initial values. * * @return string|null * The field name. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:527
- ⧉public setInitialValueFromField($field_name, $default_value = null): $this Sets a field that will be used for getting initial values.
/** * Sets a field that will be used for getting initial values. * * @param string $field_name * The name of the field that will be used for getting initial values. * @param mixed $default_value * (optional) The default value for the field, in case the inherited value * is NULL. This can be either: * - a literal, in which case it will be assigned to the first property of * the first item; * - a numerically indexed array of items, each item being a property/value * array; * - a non-numerically indexed array, in which case the array is assumed to * be a property/value array and used as the first item; * - an empty array for no initial value. * If the field being added is required or an entity key, it is recommended * to provide a default value. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:551
- ⧉public getOptionsProvider($property_name, Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:560
- ⧉public getPropertyDefinition($name) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:575
- ⧉public getPropertyDefinitions() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:587
- ⧉public getPropertyNames() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:598
- ⧉public getMainPropertyName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:605
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:613
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:623
- ⧉public setTargetEntityTypeId($entity_type_id): $this Sets the ID of the type of the entity this field is attached to.
/** * Sets the ID of the type of the entity this field is attached to. * * @param string $entity_type_id * The name of the target entity type to set. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:635
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:643
- ⧉public setTargetBundle($bundle): $this Sets the bundle this field is defined for.
/** * Sets the bundle this field is defined for. * * @param string|null $bundle * The bundle, or NULL if the field is not bundle-specific. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:655
- ⧉public getSchema() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:663
- ⧉public getColumns() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:690
- ⧉public hasCustomStorage() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:698
- ⧉public isBaseField() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:705
- ⧉public setCustomStorage($custom_storage): $this Sets the storage behavior for this field.
/** * Sets the storage behavior for this field. * * @param bool $custom_storage * Pass FALSE if the storage takes care of storing the field, * TRUE otherwise. * * @return $this * * @throws \LogicException * Thrown if custom storage is to be set to FALSE for a computed field. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:721
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:732
- ⧉public getUniqueStorageIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:739
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:746
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:759
- ⧉public setDeleted($deleted): $this Sets whether the field storage is deleted.
/** * Sets whether the field storage is deleted. * * @param bool $deleted * Whether the field storage is deleted. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:771
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:779
- ⧉public isStorageRequired() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:790
- ⧉public setStorageRequired($required): static Sets whether the field storage is required.
/** * Sets whether the field storage is required. * * @param bool $required * Whether the field storage is required. * * @return static * The object itself for chaining. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:808
- ⧉public __clone() Magic method: Implements a deep clone.
/** * Magic method: Implements a deep clone. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:816
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:833
- ⧉public __construct(array $values = array(), ?Drupal\Core\TypedData\DataDefinitionInterface $item_definition = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:50
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:58
- ⧉public setDataType($type) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:65
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:74
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:92
- ⧉public setItemDefinition(Drupal\Core\TypedData\DataDefinitionInterface $definition): $this Sets the item definition.
/** * Sets the item definition. * * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition * A list item's data definition. * * @return $this */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:104
- ⧉public setTypedDataManager(Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager): $this Sets the typed data manager.
/** * Sets the typed data manager. * * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager * The typed data manager. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:25
- ⧉public getTypedDataManager(): \Drupal\Core\TypedData\TypedDataManagerInterface Gets the typed data manager.
/** * Gets the typed data manager. * * @return \Drupal\Core\TypedData\TypedDataManagerInterface * The typed data manager. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/TypedDataTrait.php:36
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:74
- ⧉public setLabel($label): static Sets the human-readable label.
/** * Sets the human-readable label. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label * The label to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:87
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:95
- ⧉public setDescription($description): static Sets the human-readable description.
/** * Sets the human-readable description. * * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description * The description to set. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:108
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:116
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:123
- ⧉public setReadOnly($read_only): static Sets whether the data is read-only.
/** * Sets whether the data is read-only. * * @param bool $read_only * Whether the data is read-only. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:140
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:148
- ⧉public setComputed($computed): static Sets whether the data is computed.
/** * Sets whether the data is computed. * * @param bool $computed * Whether the data is computed. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:161
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:169
- ⧉public setRequired($required): static Sets whether the data is required.
/** * Sets whether the data is required. * * @param bool $required * Whether the data is required. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:182
- ⧉public setClass($class): static Sets the class used for creating the typed data object.
/** * Sets the class used for creating the typed data object. * * @param string|null $class * The class to use. * * @return static * The object itself for chaining. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:209
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:261
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:270
- ⧉public setConstraints(array $constraints): $this Sets an array of validation constraints.
/** * Sets an array of validation constraints. * * @param array $constraints * An array of validation constraint definitions, keyed by constraint name. * Each constraint definition can be used for instantiating * \Symfony\Component\Validator\Constraint objects. * * @return $this */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:285
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:293
- ⧉public offsetExists($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:305
- ⧉public & offsetGet($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:318
- ⧉public offsetSet($offset, $value) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:332
- ⧉public offsetUnset($offset) {@inheritdoc}
/** * {@inheritdoc} * * This is for BC support only. * @todo: Remove in https://www.drupal.org/node/1928868. */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:343
- ⧉public toArray(): array Returns all definition values as array.
/** * Returns all definition values as array. * * @return array */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:352
- ⧉public setInternal($internal): $this Sets the whether the data value should be internal.
/** * Sets the whether the data value should be internal. * * @param bool $internal * Whether the data value should be internal. * * @return $this * * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal */ Inherited from Drupal\Core\TypedData\DataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/DataDefinition.php:387
- ⇄⧉public static create($type): static Creates a new field definition.\Drupal\Core\Field\BaseFieldDefinition::create($type)
/** * Creates a new field definition. * * @param string $type * The type of the field. * * @return static * A new field definition object. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:57
- ⇄⧉public static createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition): $this Creates a new field definition based upon a field storage definition.\Drupal\Core\Field\BaseFieldDefinition::createFromFieldStorageDefinition(Drupal\Core\Field\FieldStorageDefinitionInterface $definition)
/** * Creates a new field definition based upon a field storage definition. * * In cases where one needs a field storage definitions to act like full * field definitions, this creates a new field definition based upon the * (limited) information available. That way it is possible to use the field * definition in places where a full field definition is required; e.g., with * widgets or formatters. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition * The field storage definition to base the new field definition upon. * * @return $this */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:83
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\BaseFieldDefinition::createFromItemType($item_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Field/BaseFieldDefinition.php:101
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\TypedData\ListDataDefinition::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\TypedData\ListDataDefinition Defined in <ROOT>/core/lib/Drupal/Core/TypedData/ListDataDefinition.php:33
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⇄const CARDINALITY_UNLIMITED :: integer -1\Drupal\Core\Field\BaseFieldDefinition::CARDINALITY_UNLIMITED
- ⇄const CARDINALITY_UNLIMITED :: integer -1
- ⧉field_album_media => Drupal\field\Entity\FieldConfig (35)
- Properties (35)
- Available methods (132)
- protected entityTypeId -> string (12) "field_config"
- protected enforceIsNew -> null
- protected typedData -> null
- ⧉protected cacheContexts -> array (1)
- 0 => string (28) "languages:language_interface"
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- protected originalId -> string (33) "node.staticpage.field_album_media"
- protected status -> boolean true
- protected uuid -> string (36) "d6d3a703-7495-48b0-be57-005e483f7ca5"
- private isUninstalling -> boolean false
- protected langcode -> string (2) "cs"
- protected third_party_settings -> array (0)
- protected _core -> array (0)
- protected trustedData -> boolean false
- ⧉protected dependencies -> array (1)
- ⧉config => array (3)
- 0 => string (36) "field.storage.node.field_album_media"
- 1 => string (16) "media.type.image"
- 2 => string (20) "node.type.staticpage"
- protected isSyncing -> boolean false
- protected id -> string (33) "node.staticpage.field_album_media"
- protected field_name -> string (17) "field_album_media"
- protected field_type -> string (16) "entity_reference"
- protected entity_type -> string (4) "node"
- protected bundle -> string (10) "staticpage"
- protected label -> string (11) "Fotogalerie"
- protected description -> string (0) ""
- ⧉protected settings -> array (2)
- handler => string (13) "default:media"
- ⧉handler_settings => array (4)
- ⧉target_bundles => array (1)
- image => string (5) "image"
- ⧉sort => array (2)
- field => string (5) "_none"
- direction => string (3) "ASC"
- auto_create => boolean true
- auto_create_bundle => string (0) ""
- protected required -> boolean false
- protected translatable -> boolean true
- protected default_value -> array (0)
- protected default_value_callback -> string (0) ""
- protected fieldStorage -> null
- protected itemDefinition -> null
- protected constraints -> array (0)
- protected propertyConstraints -> array (0)
- protected deleted -> boolean false
- ⧉public __construct(array $values, $entity_type = 'field_config') Constructs a FieldConfig object.
/** * Constructs a FieldConfig object. * * In most cases, Field entities are created via * FieldConfig::create($values), where $values is the same * parameter as in this constructor. * * @param array $values * An array of field properties, keyed by property name. The * storage associated with the field can be specified either with: * - field_storage: the FieldStorageConfigInterface object, * or by referring to an existing field storage in the current configuration * with: * - field_name: The field name. * - entity_type: The entity type. * Additionally, a 'bundle' property is required to indicate the entity * bundle to which the field is attached to. Other array elements will be * used to set the corresponding properties on the class; see the class * property documentation for details. * @param string $entity_type * (optional) The entity type on which the field should be created. * Defaults to "field_config". */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:97
- ⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:130
- ⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) Overrides \Drupal\Core\Entity\Entity::preSave().
/** * Overrides \Drupal\Core\Entity\Entity::preSave(). * * @throws \Drupal\Core\Field\FieldException * If the field definition is invalid. * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:152
- ⧉public calculateDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:188
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:288
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:295
- ⧉public isDisplayConfigurable($context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:329
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:336
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:344
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:351
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:358
- ⧉public id() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:199
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:206
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:213
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:220
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:227
- ⧉public onDependencyRemoval(array $dependencies) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:261
- ⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:287
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:301
- ⧉public setLabel($label) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:308
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:316
- ⧉public setDescription($description) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:323
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:331
- ⧉public setTranslatable($translatable) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:339
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:347
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:354
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:362
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:374
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:382
- ⧉public setRequired($required) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:389
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:397
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:414
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:421
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:429
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:436
- ⧉public __sleep() Implements the magic __sleep() method.
/** * Implements the magic __sleep() method. * * Using the Serialize interface and serialize() / unserialize() methods * breaks entity forms in PHP 5.4. * @todo Investigate in https://www.drupal.org/node/1977206. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:448
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:477
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:484
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:491
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:501
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:508
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:516
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:540
- ⧉public setConstraints(array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:547
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:555
- ⧉public setPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:563
- ⧉public addPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:576
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:591
- ⧉public setSyncing($syncing) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⧉public isSyncing() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⧉public getOriginalId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:122
- ⧉public setOriginalId($id) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:129
- ⧉public isNew() Overrides Entity::isNew().
/** * Overrides Entity::isNew(). * * EntityInterface::enforceIsNew() is only supported for newly created * configuration entities but has no effect after saving, since each * configuration entity is unique. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:146
- ⧉public get($property_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:153
- ⧉public set($property_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:160
- ⧉public enable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:177
- ⧉public disable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:184
- ⧉public setStatus($status) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:191
- ⧉public status() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:199
- ⧉public setUninstalling($uninstalling) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:206
- ⧉public isUninstalling() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:213
- ⧉public createDuplicate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:220
- ⧉public toArray() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:245
- ⧉public toUrl($rel = 'edit-form', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:397
- ⧉public getCacheTagsToInvalidate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:406
- ⧉public getDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:435
- ⧉public getConfigDependencyName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:449
- ⧉public getConfigTarget() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:456
- ⧉public setThirdPartySetting($module, $key, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:504
- ⧉public getThirdPartySetting($module, $key, $default = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:512
- ⧉public getThirdPartySettings($module) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:524
- ⧉public unsetThirdPartySetting($module, $key) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:531
- ⧉public getThirdPartyProviders() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:544
- ⧉public isInstallable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:585
- ⧉public trustData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:592
- ⧉public hasTrustedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:600
- ⧉public save() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:607
- ⧉public addCacheableDependency($other_object) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⧉public traitSleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⧉public addCacheTags(array $cache_tags) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⧉public mergeCacheMaxAge($max_age) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⧉public uuid() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:113
- ⧉public enforceIsNew($value = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⧉public getEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⧉public bundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:143
- ⧉public label() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:150
- ⧉public hasLinkTemplate($rel) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⧉public uriRelationships() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⧉public access($operation, ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:306
- ⧉public language() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:320
- ⧉public delete() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⧉public getEntityType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⧉public referencedEntities() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:429
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⧉public getTypedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⧉public getConfigDependencyKey() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⧉protected linkTemplates() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:260
- ⧉protected urlRouteParameters($rel) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:277
- ⧉protected addDependencyTrait($type, $name): $this Adds a dependency.
/** * Adds a dependency. * * @param string $type * Type of dependency being added: 'module', 'theme', 'config', 'content'. * @param string $name * If $type is 'module' or 'theme', the name of the module or theme. If * $type is 'config' or 'content', the result of * EntityInterface::getConfigDependencyName(). * * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() * * @return $this */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:31
- ⧉protected getPluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance): array Calculates and returns dependencies of a specific plugin instance.
/** * Calculates and returns dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. * * @return array * An array of dependencies keyed by the type of dependency. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:33
- ⧉protected addDependencies(array $dependencies) Adds multiple dependencies.
/** * Adds multiple dependencies. * * @param array $dependencies * An array of dependencies keyed by the type of dependency. One example: * @code * array( * 'module' => array( * 'node', * 'field', * 'image', * ), * ); * @endcode * * @see \Drupal\Core\Entity\DependencyTrait::addDependency */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:64
- ⧉protected calculatePluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance) Calculates and adds dependencies of a specific plugin instance.
/** * Calculates and adds dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:88
- ⧉protected moduleHandler(): \Drupal\Core\Extension\ModuleHandlerInterface Wraps the module handler.
/** * Wraps the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:98
- ⧉protected themeHandler(): \Drupal\Core\Extension\ThemeHandlerInterface Wraps the theme handler.
/** * Wraps the theme handler. * * @return \Drupal\Core\Extension\ThemeHandlerInterface * The theme handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:108
- ⧉protected getTypedConfig(): \Drupal\Core\Config\TypedConfigManagerInterface Gets the typed config manager.
/** * Gets the typed config manager. * * @return \Drupal\Core\Config\TypedConfigManagerInterface */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:280
- ⧉protected addDependency($type, $name) Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
/** * Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). * * Note that this function should only be called from implementations of * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * as dependencies are recalculated during every entity save. * * @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:421
- ⧉protected invalidateTagsOnSave($update) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the entity's cache tag; the config system * already invalidates it. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:483
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:198
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:224
- ⇄⧉public static loadByName($entity_type_id, $bundle, $field_name): Drupal\field\FieldConfigInterface|null Loads a field config entity based on the entity type and field name.\Drupal\field\Entity\FieldConfig::loadByName($entity_type_id, $bundle, $field_name)
/** * Loads a field config entity based on the entity type and field name. * * @param string $entity_type_id * ID of the entity type. * @param string $bundle * Bundle name. * @param string $field_name * Name of the field. * * @return Drupal\field\FieldConfigInterface|null * The field config entity if one exists for the provided field * name, otherwise NULL. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:376
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromItemType($item_type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:459
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:468
- ⇄⧉public static sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label.\Drupal\Core\Config\Entity\ConfigEntityBase::sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b)
/** * Helper callback for uasort() to sort configuration entities by weight and label. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:231
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\EntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:504
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the individual entities' cache tags; the * config system already invalidates them. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:493
- ⧉protected static getConfigManager(): \Drupal\Core\Config\ConfigManager Gets the configuration manager.
/** * Gets the configuration manager. * * @return \Drupal\Core\Config\ConfigManager * The configuration manager. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:578
- ⧉field_album_ref => Drupal\field\Entity\FieldConfig (35)
- Properties (35)
- Available methods (132)
- protected entityTypeId -> string (12) "field_config"
- protected enforceIsNew -> null
- protected typedData -> null
- ⧉protected cacheContexts -> array (1)
- 0 => string (28) "languages:language_interface"
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- protected originalId -> string (31) "node.staticpage.field_album_ref"
- protected status -> boolean true
- protected uuid -> string (36) "201441c5-d0a5-4475-b328-ddc6d9ffb89f"
- private isUninstalling -> boolean false
- protected langcode -> string (2) "cs"
- protected third_party_settings -> array (0)
- protected _core -> array (0)
- protected trustedData -> boolean false
- ⧉protected dependencies -> array (1)
- ⧉config => array (3)
- 0 => string (34) "field.storage.node.field_album_ref"
- 1 => string (15) "node.type.image"
- 2 => string (20) "node.type.staticpage"
- protected isSyncing -> boolean false
- protected id -> string (31) "node.staticpage.field_album_ref"
- protected field_name -> string (15) "field_album_ref"
- protected field_type -> string (16) "entity_reference"
- protected entity_type -> string (4) "node"
- protected bundle -> string (10) "staticpage"
- protected label -> UTF-8 string (29) "Obrázky (for migration only)"
- protected description -> string (0) ""
- ⧉protected settings -> array (2)
- handler => string (12) "default:node"
- ⧉handler_settings => array (4)
- ⧉target_bundles => array (1)
- image => string (5) "image"
- ⧉sort => array (2)
- field => string (5) "_none"
- direction => string (3) "ASC"
- auto_create => boolean false
- auto_create_bundle => string (0) ""
- protected required -> boolean false
- protected translatable -> boolean false
- protected default_value -> array (0)
- protected default_value_callback -> string (0) ""
- protected fieldStorage -> null
- protected itemDefinition -> null
- protected constraints -> array (0)
- protected propertyConstraints -> array (0)
- protected deleted -> boolean false
- ⧉public __construct(array $values, $entity_type = 'field_config') Constructs a FieldConfig object.
/** * Constructs a FieldConfig object. * * In most cases, Field entities are created via * FieldConfig::create($values), where $values is the same * parameter as in this constructor. * * @param array $values * An array of field properties, keyed by property name. The * storage associated with the field can be specified either with: * - field_storage: the FieldStorageConfigInterface object, * or by referring to an existing field storage in the current configuration * with: * - field_name: The field name. * - entity_type: The entity type. * Additionally, a 'bundle' property is required to indicate the entity * bundle to which the field is attached to. Other array elements will be * used to set the corresponding properties on the class; see the class * property documentation for details. * @param string $entity_type * (optional) The entity type on which the field should be created. * Defaults to "field_config". */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:97
- ⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:130
- ⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) Overrides \Drupal\Core\Entity\Entity::preSave().
/** * Overrides \Drupal\Core\Entity\Entity::preSave(). * * @throws \Drupal\Core\Field\FieldException * If the field definition is invalid. * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:152
- ⧉public calculateDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:188
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:288
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:295
- ⧉public isDisplayConfigurable($context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:329
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:336
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:344
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:351
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:358
- ⧉public id() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:199
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:206
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:213
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:220
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:227
- ⧉public onDependencyRemoval(array $dependencies) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:261
- ⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:287
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:301
- ⧉public setLabel($label) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:308
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:316
- ⧉public setDescription($description) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:323
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:331
- ⧉public setTranslatable($translatable) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:339
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:347
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:354
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:362
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:374
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:382
- ⧉public setRequired($required) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:389
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:397
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:414
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:421
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:429
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:436
- ⧉public __sleep() Implements the magic __sleep() method.
/** * Implements the magic __sleep() method. * * Using the Serialize interface and serialize() / unserialize() methods * breaks entity forms in PHP 5.4. * @todo Investigate in https://www.drupal.org/node/1977206. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:448
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:477
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:484
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:491
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:501
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:508
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:516
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:540
- ⧉public setConstraints(array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:547
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:555
- ⧉public setPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:563
- ⧉public addPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:576
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:591
- ⧉public setSyncing($syncing) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⧉public isSyncing() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⧉public getOriginalId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:122
- ⧉public setOriginalId($id) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:129
- ⧉public isNew() Overrides Entity::isNew().
/** * Overrides Entity::isNew(). * * EntityInterface::enforceIsNew() is only supported for newly created * configuration entities but has no effect after saving, since each * configuration entity is unique. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:146
- ⧉public get($property_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:153
- ⧉public set($property_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:160
- ⧉public enable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:177
- ⧉public disable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:184
- ⧉public setStatus($status) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:191
- ⧉public status() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:199
- ⧉public setUninstalling($uninstalling) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:206
- ⧉public isUninstalling() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:213
- ⧉public createDuplicate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:220
- ⧉public toArray() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:245
- ⧉public toUrl($rel = 'edit-form', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:397
- ⧉public getCacheTagsToInvalidate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:406
- ⧉public getDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:435
- ⧉public getConfigDependencyName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:449
- ⧉public getConfigTarget() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:456
- ⧉public setThirdPartySetting($module, $key, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:504
- ⧉public getThirdPartySetting($module, $key, $default = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:512
- ⧉public getThirdPartySettings($module) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:524
- ⧉public unsetThirdPartySetting($module, $key) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:531
- ⧉public getThirdPartyProviders() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:544
- ⧉public isInstallable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:585
- ⧉public trustData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:592
- ⧉public hasTrustedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:600
- ⧉public save() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:607
- ⧉public addCacheableDependency($other_object) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⧉public traitSleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⧉public addCacheTags(array $cache_tags) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⧉public mergeCacheMaxAge($max_age) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⧉public uuid() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:113
- ⧉public enforceIsNew($value = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⧉public getEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⧉public bundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:143
- ⧉public label() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:150
- ⧉public hasLinkTemplate($rel) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⧉public uriRelationships() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⧉public access($operation, ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:306
- ⧉public language() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:320
- ⧉public delete() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⧉public getEntityType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⧉public referencedEntities() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:429
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⧉public getTypedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⧉public getConfigDependencyKey() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⧉protected linkTemplates() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:260
- ⧉protected urlRouteParameters($rel) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:277
- ⧉protected addDependencyTrait($type, $name): $this Adds a dependency.
/** * Adds a dependency. * * @param string $type * Type of dependency being added: 'module', 'theme', 'config', 'content'. * @param string $name * If $type is 'module' or 'theme', the name of the module or theme. If * $type is 'config' or 'content', the result of * EntityInterface::getConfigDependencyName(). * * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() * * @return $this */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:31
- ⧉protected getPluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance): array Calculates and returns dependencies of a specific plugin instance.
/** * Calculates and returns dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. * * @return array * An array of dependencies keyed by the type of dependency. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:33
- ⧉protected addDependencies(array $dependencies) Adds multiple dependencies.
/** * Adds multiple dependencies. * * @param array $dependencies * An array of dependencies keyed by the type of dependency. One example: * @code * array( * 'module' => array( * 'node', * 'field', * 'image', * ), * ); * @endcode * * @see \Drupal\Core\Entity\DependencyTrait::addDependency */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:64
- ⧉protected calculatePluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance) Calculates and adds dependencies of a specific plugin instance.
/** * Calculates and adds dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:88
- ⧉protected moduleHandler(): \Drupal\Core\Extension\ModuleHandlerInterface Wraps the module handler.
/** * Wraps the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:98
- ⧉protected themeHandler(): \Drupal\Core\Extension\ThemeHandlerInterface Wraps the theme handler.
/** * Wraps the theme handler. * * @return \Drupal\Core\Extension\ThemeHandlerInterface * The theme handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:108
- ⧉protected getTypedConfig(): \Drupal\Core\Config\TypedConfigManagerInterface Gets the typed config manager.
/** * Gets the typed config manager. * * @return \Drupal\Core\Config\TypedConfigManagerInterface */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:280
- ⧉protected addDependency($type, $name) Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
/** * Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). * * Note that this function should only be called from implementations of * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * as dependencies are recalculated during every entity save. * * @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:421
- ⧉protected invalidateTagsOnSave($update) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the entity's cache tag; the config system * already invalidates it. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:483
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:198
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:224
- ⇄⧉public static loadByName($entity_type_id, $bundle, $field_name): Drupal\field\FieldConfigInterface|null Loads a field config entity based on the entity type and field name.\Drupal\field\Entity\FieldConfig::loadByName($entity_type_id, $bundle, $field_name)
/** * Loads a field config entity based on the entity type and field name. * * @param string $entity_type_id * ID of the entity type. * @param string $bundle * Bundle name. * @param string $field_name * Name of the field. * * @return Drupal\field\FieldConfigInterface|null * The field config entity if one exists for the provided field * name, otherwise NULL. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:376
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromItemType($item_type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:459
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:468
- ⇄⧉public static sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label.\Drupal\Core\Config\Entity\ConfigEntityBase::sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b)
/** * Helper callback for uasort() to sort configuration entities by weight and label. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:231
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\EntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:504
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the individual entities' cache tags; the * config system already invalidates them. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:493
- ⧉protected static getConfigManager(): \Drupal\Core\Config\ConfigManager Gets the configuration manager.
/** * Gets the configuration manager. * * @return \Drupal\Core\Config\ConfigManager * The configuration manager. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:578
- ⧉field_downloads => Drupal\field\Entity\FieldConfig (35)
- Properties (35)
- Available methods (132)
- protected entityTypeId -> string (12) "field_config"
- protected enforceIsNew -> null
- protected typedData -> null
- ⧉protected cacheContexts -> array (1)
- 0 => string (28) "languages:language_interface"
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- protected originalId -> string (31) "node.staticpage.field_downloads"
- protected status -> boolean true
- protected uuid -> string (36) "fc076622-0f75-4fe8-a0c3-c8996ec8bc36"
- private isUninstalling -> boolean false
- protected langcode -> string (2) "cs"
- protected third_party_settings -> array (0)
- protected _core -> array (0)
- protected trustedData -> boolean false
- ⧉protected dependencies -> array (1)
- ⧉config => array (7)
- 0 => string (34) "field.storage.node.field_downloads"
- 1 => string (16) "media.type.audio"
- 2 => string (19) "media.type.document"
- 3 => string (16) "media.type.image"
- 4 => string (23) "media.type.remote_video"
- 5 => string (16) "media.type.video"
- 6 => string (20) "node.type.staticpage"
- protected isSyncing -> boolean false
- protected id -> string (31) "node.staticpage.field_downloads"
- protected field_name -> string (15) "field_downloads"
- protected field_type -> string (16) "entity_reference"
- protected entity_type -> string (4) "node"
- protected bundle -> string (10) "staticpage"
- protected label -> UTF-8 string (12) "Ke stažení"
- protected description -> string (0) ""
- ⧉protected settings -> array (2)
- handler => string (13) "default:media"
- ⧉handler_settings => array (1)
- ⧉target_bundles => array (5)
- audio => string (5) "audio"
- document => string (8) "document"
- image => string (5) "image"
- remote_video => string (12) "remote_video"
- video => string (5) "video"
- protected required -> boolean false
- protected translatable -> boolean true
- protected default_value -> array (0)
- protected default_value_callback -> string (0) ""
- protected fieldStorage -> null
- protected itemDefinition -> null
- protected constraints -> array (0)
- protected propertyConstraints -> array (0)
- protected deleted -> boolean false
- ⧉public __construct(array $values, $entity_type = 'field_config') Constructs a FieldConfig object.
/** * Constructs a FieldConfig object. * * In most cases, Field entities are created via * FieldConfig::create($values), where $values is the same * parameter as in this constructor. * * @param array $values * An array of field properties, keyed by property name. The * storage associated with the field can be specified either with: * - field_storage: the FieldStorageConfigInterface object, * or by referring to an existing field storage in the current configuration * with: * - field_name: The field name. * - entity_type: The entity type. * Additionally, a 'bundle' property is required to indicate the entity * bundle to which the field is attached to. Other array elements will be * used to set the corresponding properties on the class; see the class * property documentation for details. * @param string $entity_type * (optional) The entity type on which the field should be created. * Defaults to "field_config". */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:97
- ⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:130
- ⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) Overrides \Drupal\Core\Entity\Entity::preSave().
/** * Overrides \Drupal\Core\Entity\Entity::preSave(). * * @throws \Drupal\Core\Field\FieldException * If the field definition is invalid. * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:152
- ⧉public calculateDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:188
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:288
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:295
- ⧉public isDisplayConfigurable($context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:329
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:336
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:344
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:351
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:358
- ⧉public id() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:199
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:206
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:213
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:220
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:227
- ⧉public onDependencyRemoval(array $dependencies) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:261
- ⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:287
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:301
- ⧉public setLabel($label) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:308
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:316
- ⧉public setDescription($description) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:323
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:331
- ⧉public setTranslatable($translatable) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:339
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:347
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:354
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:362
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:374
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:382
- ⧉public setRequired($required) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:389
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:397
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:414
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:421
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:429
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:436
- ⧉public __sleep() Implements the magic __sleep() method.
/** * Implements the magic __sleep() method. * * Using the Serialize interface and serialize() / unserialize() methods * breaks entity forms in PHP 5.4. * @todo Investigate in https://www.drupal.org/node/1977206. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:448
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:477
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:484
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:491
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:501
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:508
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:516
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:540
- ⧉public setConstraints(array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:547
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:555
- ⧉public setPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:563
- ⧉public addPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:576
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:591
- ⧉public setSyncing($syncing) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⧉public isSyncing() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⧉public getOriginalId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:122
- ⧉public setOriginalId($id) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:129
- ⧉public isNew() Overrides Entity::isNew().
/** * Overrides Entity::isNew(). * * EntityInterface::enforceIsNew() is only supported for newly created * configuration entities but has no effect after saving, since each * configuration entity is unique. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:146
- ⧉public get($property_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:153
- ⧉public set($property_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:160
- ⧉public enable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:177
- ⧉public disable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:184
- ⧉public setStatus($status) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:191
- ⧉public status() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:199
- ⧉public setUninstalling($uninstalling) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:206
- ⧉public isUninstalling() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:213
- ⧉public createDuplicate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:220
- ⧉public toArray() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:245
- ⧉public toUrl($rel = 'edit-form', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:397
- ⧉public getCacheTagsToInvalidate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:406
- ⧉public getDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:435
- ⧉public getConfigDependencyName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:449
- ⧉public getConfigTarget() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:456
- ⧉public setThirdPartySetting($module, $key, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:504
- ⧉public getThirdPartySetting($module, $key, $default = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:512
- ⧉public getThirdPartySettings($module) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:524
- ⧉public unsetThirdPartySetting($module, $key) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:531
- ⧉public getThirdPartyProviders() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:544
- ⧉public isInstallable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:585
- ⧉public trustData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:592
- ⧉public hasTrustedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:600
- ⧉public save() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:607
- ⧉public addCacheableDependency($other_object) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⧉public traitSleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⧉public addCacheTags(array $cache_tags) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⧉public mergeCacheMaxAge($max_age) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⧉public uuid() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:113
- ⧉public enforceIsNew($value = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⧉public getEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⧉public bundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:143
- ⧉public label() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:150
- ⧉public hasLinkTemplate($rel) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⧉public uriRelationships() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⧉public access($operation, ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:306
- ⧉public language() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:320
- ⧉public delete() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⧉public getEntityType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⧉public referencedEntities() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:429
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⧉public getTypedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⧉public getConfigDependencyKey() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⧉protected linkTemplates() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:260
- ⧉protected urlRouteParameters($rel) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:277
- ⧉protected addDependencyTrait($type, $name): $this Adds a dependency.
/** * Adds a dependency. * * @param string $type * Type of dependency being added: 'module', 'theme', 'config', 'content'. * @param string $name * If $type is 'module' or 'theme', the name of the module or theme. If * $type is 'config' or 'content', the result of * EntityInterface::getConfigDependencyName(). * * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() * * @return $this */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:31
- ⧉protected getPluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance): array Calculates and returns dependencies of a specific plugin instance.
/** * Calculates and returns dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. * * @return array * An array of dependencies keyed by the type of dependency. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:33
- ⧉protected addDependencies(array $dependencies) Adds multiple dependencies.
/** * Adds multiple dependencies. * * @param array $dependencies * An array of dependencies keyed by the type of dependency. One example: * @code * array( * 'module' => array( * 'node', * 'field', * 'image', * ), * ); * @endcode * * @see \Drupal\Core\Entity\DependencyTrait::addDependency */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:64
- ⧉protected calculatePluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance) Calculates and adds dependencies of a specific plugin instance.
/** * Calculates and adds dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:88
- ⧉protected moduleHandler(): \Drupal\Core\Extension\ModuleHandlerInterface Wraps the module handler.
/** * Wraps the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:98
- ⧉protected themeHandler(): \Drupal\Core\Extension\ThemeHandlerInterface Wraps the theme handler.
/** * Wraps the theme handler. * * @return \Drupal\Core\Extension\ThemeHandlerInterface * The theme handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:108
- ⧉protected getTypedConfig(): \Drupal\Core\Config\TypedConfigManagerInterface Gets the typed config manager.
/** * Gets the typed config manager. * * @return \Drupal\Core\Config\TypedConfigManagerInterface */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:280
- ⧉protected addDependency($type, $name) Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
/** * Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). * * Note that this function should only be called from implementations of * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * as dependencies are recalculated during every entity save. * * @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:421
- ⧉protected invalidateTagsOnSave($update) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the entity's cache tag; the config system * already invalidates it. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:483
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:198
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:224
- ⇄⧉public static loadByName($entity_type_id, $bundle, $field_name): Drupal\field\FieldConfigInterface|null Loads a field config entity based on the entity type and field name.\Drupal\field\Entity\FieldConfig::loadByName($entity_type_id, $bundle, $field_name)
/** * Loads a field config entity based on the entity type and field name. * * @param string $entity_type_id * ID of the entity type. * @param string $bundle * Bundle name. * @param string $field_name * Name of the field. * * @return Drupal\field\FieldConfigInterface|null * The field config entity if one exists for the provided field * name, otherwise NULL. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:376
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromItemType($item_type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:459
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:468
- ⇄⧉public static sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label.\Drupal\Core\Config\Entity\ConfigEntityBase::sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b)
/** * Helper callback for uasort() to sort configuration entities by weight and label. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:231
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\EntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:504
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the individual entities' cache tags; the * config system already invalidates them. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:493
- ⧉protected static getConfigManager(): \Drupal\Core\Config\ConfigManager Gets the configuration manager.
/** * Gets the configuration manager. * * @return \Drupal\Core\Config\ConfigManager * The configuration manager. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:578
- ⧉field_links => Drupal\field\Entity\FieldConfig (35)
- Properties (35)
- Available methods (132)
- protected entityTypeId -> string (12) "field_config"
- protected enforceIsNew -> null
- protected typedData -> null
- ⧉protected cacheContexts -> array (1)
- 0 => string (28) "languages:language_interface"
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- protected originalId -> string (27) "node.staticpage.field_links"
- protected status -> boolean true
- protected uuid -> string (36) "dddb65a0-ef48-4b09-8ecf-a307f37a2d23"
- private isUninstalling -> boolean false
- protected langcode -> string (2) "cs"
- protected third_party_settings -> array (0)
- protected _core -> array (0)
- protected trustedData -> boolean false
- ⧉protected dependencies -> array (2)
- ⧉config => array (2)
- 0 => string (30) "field.storage.node.field_links"
- 1 => string (20) "node.type.staticpage"
- ⧉module => array (1)
- 0 => string (4) "link"
- protected isSyncing -> boolean false
- protected id -> string (27) "node.staticpage.field_links"
- protected field_name -> string (11) "field_links"
- protected field_type -> string (4) "link"
- protected entity_type -> string (4) "node"
- protected bundle -> string (10) "staticpage"
- protected label -> UTF-8 string (20) "Související odkazy"
- protected description -> string (0) ""
- ⧉protected settings -> array (2)
- title => integer 1
- link_type => integer 17
- protected required -> boolean false
- protected translatable -> boolean true
- protected default_value -> array (0)
- protected default_value_callback -> string (0) ""
- protected fieldStorage -> null
- protected itemDefinition -> null
- protected constraints -> array (0)
- protected propertyConstraints -> array (0)
- protected deleted -> boolean false
- ⧉public __construct(array $values, $entity_type = 'field_config') Constructs a FieldConfig object.
/** * Constructs a FieldConfig object. * * In most cases, Field entities are created via * FieldConfig::create($values), where $values is the same * parameter as in this constructor. * * @param array $values * An array of field properties, keyed by property name. The * storage associated with the field can be specified either with: * - field_storage: the FieldStorageConfigInterface object, * or by referring to an existing field storage in the current configuration * with: * - field_name: The field name. * - entity_type: The entity type. * Additionally, a 'bundle' property is required to indicate the entity * bundle to which the field is attached to. Other array elements will be * used to set the corresponding properties on the class; see the class * property documentation for details. * @param string $entity_type * (optional) The entity type on which the field should be created. * Defaults to "field_config". */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:97
- ⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:130
- ⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) Overrides \Drupal\Core\Entity\Entity::preSave().
/** * Overrides \Drupal\Core\Entity\Entity::preSave(). * * @throws \Drupal\Core\Field\FieldException * If the field definition is invalid. * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:152
- ⧉public calculateDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:188
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:288
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:295
- ⧉public isDisplayConfigurable($context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:329
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:336
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:344
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:351
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:358
- ⧉public id() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:199
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:206
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:213
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:220
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:227
- ⧉public onDependencyRemoval(array $dependencies) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:261
- ⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:287
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:301
- ⧉public setLabel($label) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:308
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:316
- ⧉public setDescription($description) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:323
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:331
- ⧉public setTranslatable($translatable) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:339
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:347
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:354
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:362
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:374
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:382
- ⧉public setRequired($required) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:389
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:397
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:414
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:421
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:429
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:436
- ⧉public __sleep() Implements the magic __sleep() method.
/** * Implements the magic __sleep() method. * * Using the Serialize interface and serialize() / unserialize() methods * breaks entity forms in PHP 5.4. * @todo Investigate in https://www.drupal.org/node/1977206. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:448
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:477
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:484
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:491
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:501
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:508
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:516
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:540
- ⧉public setConstraints(array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:547
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:555
- ⧉public setPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:563
- ⧉public addPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:576
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:591
- ⧉public setSyncing($syncing) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⧉public isSyncing() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⧉public getOriginalId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:122
- ⧉public setOriginalId($id) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:129
- ⧉public isNew() Overrides Entity::isNew().
/** * Overrides Entity::isNew(). * * EntityInterface::enforceIsNew() is only supported for newly created * configuration entities but has no effect after saving, since each * configuration entity is unique. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:146
- ⧉public get($property_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:153
- ⧉public set($property_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:160
- ⧉public enable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:177
- ⧉public disable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:184
- ⧉public setStatus($status) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:191
- ⧉public status() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:199
- ⧉public setUninstalling($uninstalling) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:206
- ⧉public isUninstalling() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:213
- ⧉public createDuplicate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:220
- ⧉public toArray() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:245
- ⧉public toUrl($rel = 'edit-form', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:397
- ⧉public getCacheTagsToInvalidate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:406
- ⧉public getDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:435
- ⧉public getConfigDependencyName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:449
- ⧉public getConfigTarget() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:456
- ⧉public setThirdPartySetting($module, $key, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:504
- ⧉public getThirdPartySetting($module, $key, $default = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:512
- ⧉public getThirdPartySettings($module) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:524
- ⧉public unsetThirdPartySetting($module, $key) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:531
- ⧉public getThirdPartyProviders() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:544
- ⧉public isInstallable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:585
- ⧉public trustData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:592
- ⧉public hasTrustedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:600
- ⧉public save() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:607
- ⧉public addCacheableDependency($other_object) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⧉public traitSleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⧉public addCacheTags(array $cache_tags) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⧉public mergeCacheMaxAge($max_age) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⧉public uuid() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:113
- ⧉public enforceIsNew($value = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⧉public getEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⧉public bundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:143
- ⧉public label() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:150
- ⧉public hasLinkTemplate($rel) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⧉public uriRelationships() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⧉public access($operation, ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:306
- ⧉public language() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:320
- ⧉public delete() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⧉public getEntityType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⧉public referencedEntities() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:429
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⧉public getTypedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⧉public getConfigDependencyKey() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⧉protected linkTemplates() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:260
- ⧉protected urlRouteParameters($rel) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:277
- ⧉protected addDependencyTrait($type, $name): $this Adds a dependency.
/** * Adds a dependency. * * @param string $type * Type of dependency being added: 'module', 'theme', 'config', 'content'. * @param string $name * If $type is 'module' or 'theme', the name of the module or theme. If * $type is 'config' or 'content', the result of * EntityInterface::getConfigDependencyName(). * * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() * * @return $this */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:31
- ⧉protected getPluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance): array Calculates and returns dependencies of a specific plugin instance.
/** * Calculates and returns dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. * * @return array * An array of dependencies keyed by the type of dependency. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:33
- ⧉protected addDependencies(array $dependencies) Adds multiple dependencies.
/** * Adds multiple dependencies. * * @param array $dependencies * An array of dependencies keyed by the type of dependency. One example: * @code * array( * 'module' => array( * 'node', * 'field', * 'image', * ), * ); * @endcode * * @see \Drupal\Core\Entity\DependencyTrait::addDependency */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:64
- ⧉protected calculatePluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance) Calculates and adds dependencies of a specific plugin instance.
/** * Calculates and adds dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:88
- ⧉protected moduleHandler(): \Drupal\Core\Extension\ModuleHandlerInterface Wraps the module handler.
/** * Wraps the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:98
- ⧉protected themeHandler(): \Drupal\Core\Extension\ThemeHandlerInterface Wraps the theme handler.
/** * Wraps the theme handler. * * @return \Drupal\Core\Extension\ThemeHandlerInterface * The theme handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:108
- ⧉protected getTypedConfig(): \Drupal\Core\Config\TypedConfigManagerInterface Gets the typed config manager.
/** * Gets the typed config manager. * * @return \Drupal\Core\Config\TypedConfigManagerInterface */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:280
- ⧉protected addDependency($type, $name) Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
/** * Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). * * Note that this function should only be called from implementations of * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * as dependencies are recalculated during every entity save. * * @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:421
- ⧉protected invalidateTagsOnSave($update) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the entity's cache tag; the config system * already invalidates it. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:483
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:198
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:224
- ⇄⧉public static loadByName($entity_type_id, $bundle, $field_name): Drupal\field\FieldConfigInterface|null Loads a field config entity based on the entity type and field name.\Drupal\field\Entity\FieldConfig::loadByName($entity_type_id, $bundle, $field_name)
/** * Loads a field config entity based on the entity type and field name. * * @param string $entity_type_id * ID of the entity type. * @param string $bundle * Bundle name. * @param string $field_name * Name of the field. * * @return Drupal\field\FieldConfigInterface|null * The field config entity if one exists for the provided field * name, otherwise NULL. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:376
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromItemType($item_type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:459
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:468
- ⇄⧉public static sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label.\Drupal\Core\Config\Entity\ConfigEntityBase::sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b)
/** * Helper callback for uasort() to sort configuration entities by weight and label. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:231
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\EntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:504
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the individual entities' cache tags; the * config system already invalidates them. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:493
- ⧉protected static getConfigManager(): \Drupal\Core\Config\ConfigManager Gets the configuration manager.
/** * Gets the configuration manager. * * @return \Drupal\Core\Config\ConfigManager * The configuration manager. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:578
- ⧉field_longtext => Drupal\field\Entity\FieldConfig (35)
- Properties (35)
- Available methods (132)
- protected entityTypeId -> string (12) "field_config"
- protected enforceIsNew -> null
- protected typedData -> null
- ⧉protected cacheContexts -> array (1)
- 0 => string (28) "languages:language_interface"
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- protected originalId -> string (30) "node.staticpage.field_longtext"
- protected status -> boolean true
- protected uuid -> string (36) "55b15da5-36fe-452c-be64-7c436cd2b031"
- private isUninstalling -> boolean false
- protected langcode -> string (2) "cs"
- protected third_party_settings -> array (0)
- protected _core -> array (0)
- protected trustedData -> boolean false
- ⧉protected dependencies -> array (2)
- ⧉config => array (2)
- 0 => string (33) "field.storage.node.field_longtext"
- 1 => string (20) "node.type.staticpage"
- ⧉module => array (1)
- 0 => string (4) "text"
- protected isSyncing -> boolean false
- protected id -> string (30) "node.staticpage.field_longtext"
- protected field_name -> string (14) "field_longtext"
- protected field_type -> string (9) "text_long"
- protected entity_type -> string (4) "node"
- protected bundle -> string (10) "staticpage"
- protected label -> string (4) "Text"
- protected description -> string (0) ""
- protected settings -> array (0)
- protected required -> boolean false
- protected translatable -> boolean true
- protected default_value -> array (0)
- protected default_value_callback -> string (0) ""
- protected fieldStorage -> null
- protected itemDefinition -> null
- protected constraints -> array (0)
- protected propertyConstraints -> array (0)
- protected deleted -> boolean false
- ⧉public __construct(array $values, $entity_type = 'field_config') Constructs a FieldConfig object.
/** * Constructs a FieldConfig object. * * In most cases, Field entities are created via * FieldConfig::create($values), where $values is the same * parameter as in this constructor. * * @param array $values * An array of field properties, keyed by property name. The * storage associated with the field can be specified either with: * - field_storage: the FieldStorageConfigInterface object, * or by referring to an existing field storage in the current configuration * with: * - field_name: The field name. * - entity_type: The entity type. * Additionally, a 'bundle' property is required to indicate the entity * bundle to which the field is attached to. Other array elements will be * used to set the corresponding properties on the class; see the class * property documentation for details. * @param string $entity_type * (optional) The entity type on which the field should be created. * Defaults to "field_config". */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:97
- ⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:130
- ⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) Overrides \Drupal\Core\Entity\Entity::preSave().
/** * Overrides \Drupal\Core\Entity\Entity::preSave(). * * @throws \Drupal\Core\Field\FieldException * If the field definition is invalid. * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:152
- ⧉public calculateDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:188
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:288
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:295
- ⧉public isDisplayConfigurable($context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:329
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:336
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:344
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:351
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:358
- ⧉public id() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:199
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:206
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:213
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:220
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:227
- ⧉public onDependencyRemoval(array $dependencies) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:261
- ⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:287
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:301
- ⧉public setLabel($label) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:308
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:316
- ⧉public setDescription($description) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:323
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:331
- ⧉public setTranslatable($translatable) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:339
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:347
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:354
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:362
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:374
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:382
- ⧉public setRequired($required) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:389
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:397
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:414
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:421
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:429
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:436
- ⧉public __sleep() Implements the magic __sleep() method.
/** * Implements the magic __sleep() method. * * Using the Serialize interface and serialize() / unserialize() methods * breaks entity forms in PHP 5.4. * @todo Investigate in https://www.drupal.org/node/1977206. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:448
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:477
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:484
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:491
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:501
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:508
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:516
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:540
- ⧉public setConstraints(array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:547
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:555
- ⧉public setPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:563
- ⧉public addPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:576
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:591
- ⧉public setSyncing($syncing) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⧉public isSyncing() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⧉public getOriginalId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:122
- ⧉public setOriginalId($id) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:129
- ⧉public isNew() Overrides Entity::isNew().
/** * Overrides Entity::isNew(). * * EntityInterface::enforceIsNew() is only supported for newly created * configuration entities but has no effect after saving, since each * configuration entity is unique. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:146
- ⧉public get($property_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:153
- ⧉public set($property_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:160
- ⧉public enable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:177
- ⧉public disable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:184
- ⧉public setStatus($status) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:191
- ⧉public status() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:199
- ⧉public setUninstalling($uninstalling) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:206
- ⧉public isUninstalling() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:213
- ⧉public createDuplicate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:220
- ⧉public toArray() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:245
- ⧉public toUrl($rel = 'edit-form', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:397
- ⧉public getCacheTagsToInvalidate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:406
- ⧉public getDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:435
- ⧉public getConfigDependencyName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:449
- ⧉public getConfigTarget() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:456
- ⧉public setThirdPartySetting($module, $key, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:504
- ⧉public getThirdPartySetting($module, $key, $default = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:512
- ⧉public getThirdPartySettings($module) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:524
- ⧉public unsetThirdPartySetting($module, $key) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:531
- ⧉public getThirdPartyProviders() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:544
- ⧉public isInstallable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:585
- ⧉public trustData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:592
- ⧉public hasTrustedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:600
- ⧉public save() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:607
- ⧉public addCacheableDependency($other_object) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⧉public traitSleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⧉public addCacheTags(array $cache_tags) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⧉public mergeCacheMaxAge($max_age) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⧉public uuid() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:113
- ⧉public enforceIsNew($value = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⧉public getEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⧉public bundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:143
- ⧉public label() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:150
- ⧉public hasLinkTemplate($rel) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⧉public uriRelationships() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⧉public access($operation, ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:306
- ⧉public language() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:320
- ⧉public delete() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⧉public getEntityType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⧉public referencedEntities() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:429
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⧉public getTypedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⧉public getConfigDependencyKey() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⧉protected linkTemplates() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:260
- ⧉protected urlRouteParameters($rel) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:277
- ⧉protected addDependencyTrait($type, $name): $this Adds a dependency.
/** * Adds a dependency. * * @param string $type * Type of dependency being added: 'module', 'theme', 'config', 'content'. * @param string $name * If $type is 'module' or 'theme', the name of the module or theme. If * $type is 'config' or 'content', the result of * EntityInterface::getConfigDependencyName(). * * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() * * @return $this */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:31
- ⧉protected getPluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance): array Calculates and returns dependencies of a specific plugin instance.
/** * Calculates and returns dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. * * @return array * An array of dependencies keyed by the type of dependency. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:33
- ⧉protected addDependencies(array $dependencies) Adds multiple dependencies.
/** * Adds multiple dependencies. * * @param array $dependencies * An array of dependencies keyed by the type of dependency. One example: * @code * array( * 'module' => array( * 'node', * 'field', * 'image', * ), * ); * @endcode * * @see \Drupal\Core\Entity\DependencyTrait::addDependency */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:64
- ⧉protected calculatePluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance) Calculates and adds dependencies of a specific plugin instance.
/** * Calculates and adds dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:88
- ⧉protected moduleHandler(): \Drupal\Core\Extension\ModuleHandlerInterface Wraps the module handler.
/** * Wraps the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:98
- ⧉protected themeHandler(): \Drupal\Core\Extension\ThemeHandlerInterface Wraps the theme handler.
/** * Wraps the theme handler. * * @return \Drupal\Core\Extension\ThemeHandlerInterface * The theme handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:108
- ⧉protected getTypedConfig(): \Drupal\Core\Config\TypedConfigManagerInterface Gets the typed config manager.
/** * Gets the typed config manager. * * @return \Drupal\Core\Config\TypedConfigManagerInterface */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:280
- ⧉protected addDependency($type, $name) Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
/** * Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). * * Note that this function should only be called from implementations of * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * as dependencies are recalculated during every entity save. * * @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:421
- ⧉protected invalidateTagsOnSave($update) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the entity's cache tag; the config system * already invalidates it. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:483
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:198
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:224
- ⇄⧉public static loadByName($entity_type_id, $bundle, $field_name): Drupal\field\FieldConfigInterface|null Loads a field config entity based on the entity type and field name.\Drupal\field\Entity\FieldConfig::loadByName($entity_type_id, $bundle, $field_name)
/** * Loads a field config entity based on the entity type and field name. * * @param string $entity_type_id * ID of the entity type. * @param string $bundle * Bundle name. * @param string $field_name * Name of the field. * * @return Drupal\field\FieldConfigInterface|null * The field config entity if one exists for the provided field * name, otherwise NULL. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:376
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromItemType($item_type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:459
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:468
- ⇄⧉public static sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label.\Drupal\Core\Config\Entity\ConfigEntityBase::sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b)
/** * Helper callback for uasort() to sort configuration entities by weight and label. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:231
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\EntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:504
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the individual entities' cache tags; the * config system already invalidates them. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:493
- ⧉protected static getConfigManager(): \Drupal\Core\Config\ConfigManager Gets the configuration manager.
/** * Gets the configuration manager. * * @return \Drupal\Core\Config\ConfigManager * The configuration manager. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:578
- ⧉field_perex => Drupal\field\Entity\FieldConfig (35)
- Properties (35)
- Available methods (132)
- protected entityTypeId -> string (12) "field_config"
- protected enforceIsNew -> null
- protected typedData -> null
- ⧉protected cacheContexts -> array (1)
- 0 => string (28) "languages:language_interface"
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- protected originalId -> string (27) "node.staticpage.field_perex"
- protected status -> boolean true
- protected uuid -> string (36) "f5141fda-aedf-46f8-84da-52ca2bbc4a5d"
- private isUninstalling -> boolean false
- protected langcode -> string (2) "cs"
- protected third_party_settings -> array (0)
- protected _core -> array (0)
- protected trustedData -> boolean false
- ⧉protected dependencies -> array (1)
- ⧉config => array (2)
- 0 => string (30) "field.storage.node.field_perex"
- 1 => string (20) "node.type.staticpage"
- protected isSyncing -> boolean false
- protected id -> string (27) "node.staticpage.field_perex"
- protected field_name -> string (11) "field_perex"
- protected field_type -> string (11) "string_long"
- protected entity_type -> string (4) "node"
- protected bundle -> string (10) "staticpage"
- protected label -> string (18) "Perex pod nadpisem"
- protected description -> string (0) ""
- protected settings -> array (0)
- protected required -> boolean false
- protected translatable -> boolean true
- protected default_value -> array (0)
- protected default_value_callback -> string (0) ""
- protected fieldStorage -> null
- protected itemDefinition -> null
- protected constraints -> array (0)
- protected propertyConstraints -> array (0)
- protected deleted -> boolean false
- ⧉public __construct(array $values, $entity_type = 'field_config') Constructs a FieldConfig object.
/** * Constructs a FieldConfig object. * * In most cases, Field entities are created via * FieldConfig::create($values), where $values is the same * parameter as in this constructor. * * @param array $values * An array of field properties, keyed by property name. The * storage associated with the field can be specified either with: * - field_storage: the FieldStorageConfigInterface object, * or by referring to an existing field storage in the current configuration * with: * - field_name: The field name. * - entity_type: The entity type. * Additionally, a 'bundle' property is required to indicate the entity * bundle to which the field is attached to. Other array elements will be * used to set the corresponding properties on the class; see the class * property documentation for details. * @param string $entity_type * (optional) The entity type on which the field should be created. * Defaults to "field_config". */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:97
- ⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:130
- ⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) Overrides \Drupal\Core\Entity\Entity::preSave().
/** * Overrides \Drupal\Core\Entity\Entity::preSave(). * * @throws \Drupal\Core\Field\FieldException * If the field definition is invalid. * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:152
- ⧉public calculateDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:188
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:288
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:295
- ⧉public isDisplayConfigurable($context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:329
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:336
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:344
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:351
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:358
- ⧉public id() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:199
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:206
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:213
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:220
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:227
- ⧉public onDependencyRemoval(array $dependencies) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:261
- ⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:287
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:301
- ⧉public setLabel($label) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:308
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:316
- ⧉public setDescription($description) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:323
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:331
- ⧉public setTranslatable($translatable) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:339
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:347
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:354
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:362
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:374
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:382
- ⧉public setRequired($required) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:389
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:397
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:414
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:421
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:429
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:436
- ⧉public __sleep() Implements the magic __sleep() method.
/** * Implements the magic __sleep() method. * * Using the Serialize interface and serialize() / unserialize() methods * breaks entity forms in PHP 5.4. * @todo Investigate in https://www.drupal.org/node/1977206. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:448
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:477
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:484
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:491
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:501
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:508
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:516
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:540
- ⧉public setConstraints(array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:547
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:555
- ⧉public setPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:563
- ⧉public addPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:576
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:591
- ⧉public setSyncing($syncing) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⧉public isSyncing() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⧉public getOriginalId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:122
- ⧉public setOriginalId($id) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:129
- ⧉public isNew() Overrides Entity::isNew().
/** * Overrides Entity::isNew(). * * EntityInterface::enforceIsNew() is only supported for newly created * configuration entities but has no effect after saving, since each * configuration entity is unique. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:146
- ⧉public get($property_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:153
- ⧉public set($property_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:160
- ⧉public enable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:177
- ⧉public disable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:184
- ⧉public setStatus($status) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:191
- ⧉public status() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:199
- ⧉public setUninstalling($uninstalling) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:206
- ⧉public isUninstalling() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:213
- ⧉public createDuplicate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:220
- ⧉public toArray() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:245
- ⧉public toUrl($rel = 'edit-form', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:397
- ⧉public getCacheTagsToInvalidate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:406
- ⧉public getDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:435
- ⧉public getConfigDependencyName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:449
- ⧉public getConfigTarget() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:456
- ⧉public setThirdPartySetting($module, $key, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:504
- ⧉public getThirdPartySetting($module, $key, $default = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:512
- ⧉public getThirdPartySettings($module) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:524
- ⧉public unsetThirdPartySetting($module, $key) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:531
- ⧉public getThirdPartyProviders() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:544
- ⧉public isInstallable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:585
- ⧉public trustData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:592
- ⧉public hasTrustedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:600
- ⧉public save() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:607
- ⧉public addCacheableDependency($other_object) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⧉public traitSleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⧉public addCacheTags(array $cache_tags) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⧉public mergeCacheMaxAge($max_age) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⧉public uuid() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:113
- ⧉public enforceIsNew($value = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⧉public getEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⧉public bundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:143
- ⧉public label() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:150
- ⧉public hasLinkTemplate($rel) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⧉public uriRelationships() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⧉public access($operation, ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:306
- ⧉public language() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:320
- ⧉public delete() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⧉public getEntityType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⧉public referencedEntities() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:429
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⧉public getTypedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⧉public getConfigDependencyKey() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⧉protected linkTemplates() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:260
- ⧉protected urlRouteParameters($rel) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:277
- ⧉protected addDependencyTrait($type, $name): $this Adds a dependency.
/** * Adds a dependency. * * @param string $type * Type of dependency being added: 'module', 'theme', 'config', 'content'. * @param string $name * If $type is 'module' or 'theme', the name of the module or theme. If * $type is 'config' or 'content', the result of * EntityInterface::getConfigDependencyName(). * * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() * * @return $this */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:31
- ⧉protected getPluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance): array Calculates and returns dependencies of a specific plugin instance.
/** * Calculates and returns dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. * * @return array * An array of dependencies keyed by the type of dependency. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:33
- ⧉protected addDependencies(array $dependencies) Adds multiple dependencies.
/** * Adds multiple dependencies. * * @param array $dependencies * An array of dependencies keyed by the type of dependency. One example: * @code * array( * 'module' => array( * 'node', * 'field', * 'image', * ), * ); * @endcode * * @see \Drupal\Core\Entity\DependencyTrait::addDependency */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:64
- ⧉protected calculatePluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance) Calculates and adds dependencies of a specific plugin instance.
/** * Calculates and adds dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:88
- ⧉protected moduleHandler(): \Drupal\Core\Extension\ModuleHandlerInterface Wraps the module handler.
/** * Wraps the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:98
- ⧉protected themeHandler(): \Drupal\Core\Extension\ThemeHandlerInterface Wraps the theme handler.
/** * Wraps the theme handler. * * @return \Drupal\Core\Extension\ThemeHandlerInterface * The theme handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:108
- ⧉protected getTypedConfig(): \Drupal\Core\Config\TypedConfigManagerInterface Gets the typed config manager.
/** * Gets the typed config manager. * * @return \Drupal\Core\Config\TypedConfigManagerInterface */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:280
- ⧉protected addDependency($type, $name) Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
/** * Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). * * Note that this function should only be called from implementations of * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * as dependencies are recalculated during every entity save. * * @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:421
- ⧉protected invalidateTagsOnSave($update) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the entity's cache tag; the config system * already invalidates it. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:483
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:198
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:224
- ⇄⧉public static loadByName($entity_type_id, $bundle, $field_name): Drupal\field\FieldConfigInterface|null Loads a field config entity based on the entity type and field name.\Drupal\field\Entity\FieldConfig::loadByName($entity_type_id, $bundle, $field_name)
/** * Loads a field config entity based on the entity type and field name. * * @param string $entity_type_id * ID of the entity type. * @param string $bundle * Bundle name. * @param string $field_name * Name of the field. * * @return Drupal\field\FieldConfigInterface|null * The field config entity if one exists for the provided field * name, otherwise NULL. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:376
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromItemType($item_type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:459
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:468
- ⇄⧉public static sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label.\Drupal\Core\Config\Entity\ConfigEntityBase::sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b)
/** * Helper callback for uasort() to sort configuration entities by weight and label. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:231
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\EntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:504
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the individual entities' cache tags; the * config system already invalidates them. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:493
- ⧉protected static getConfigManager(): \Drupal\Core\Config\ConfigManager Gets the configuration manager.
/** * Gets the configuration manager. * * @return \Drupal\Core\Config\ConfigManager * The configuration manager. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:578
- ⧉field_teaser_image => Drupal\field\Entity\FieldConfig (35)
- Properties (35)
- Available methods (132)
- protected entityTypeId -> string (12) "field_config"
- protected enforceIsNew -> null
- protected typedData -> null
- ⧉protected cacheContexts -> array (1)
- 0 => string (28) "languages:language_interface"
- protected cacheTags -> array (0)
- protected cacheMaxAge -> integer -1
- protected _serviceIds -> array (0)
- protected _entityStorages -> array (0)
- protected originalId -> string (34) "node.staticpage.field_teaser_image"
- protected status -> boolean true
- protected uuid -> string (36) "84c2caeb-2dd3-4c2a-80a5-3400e54ee306"
- private isUninstalling -> boolean false
- protected langcode -> string (2) "cs"
- protected third_party_settings -> array (0)
- protected _core -> array (0)
- protected trustedData -> boolean false
- ⧉protected dependencies -> array (1)
- ⧉config => array (3)
- 0 => string (37) "field.storage.node.field_teaser_image"
- 1 => string (16) "media.type.image"
- 2 => string (20) "node.type.staticpage"
- protected isSyncing -> boolean false
- protected id -> string (34) "node.staticpage.field_teaser_image"
- protected field_name -> string (18) "field_teaser_image"
- protected field_type -> string (16) "entity_reference"
- protected entity_type -> string (4) "node"
- protected bundle -> string (10) "staticpage"
- protected label -> UTF-8 string (17) "Úvodní obrázek"
- protected description -> string (0) ""
- ⧉protected settings -> array (2)
- handler => string (13) "default:media"
- ⧉handler_settings => array (1)
- ⧉target_bundles => array (1)
- image => string (5) "image"
- protected required -> boolean false
- protected translatable -> boolean true
- protected default_value -> array (0)
- protected default_value_callback -> string (0) ""
- protected fieldStorage -> null
- protected itemDefinition -> null
- protected constraints -> array (0)
- protected propertyConstraints -> array (0)
- protected deleted -> boolean false
- ⧉public __construct(array $values, $entity_type = 'field_config') Constructs a FieldConfig object.
/** * Constructs a FieldConfig object. * * In most cases, Field entities are created via * FieldConfig::create($values), where $values is the same * parameter as in this constructor. * * @param array $values * An array of field properties, keyed by property name. The * storage associated with the field can be specified either with: * - field_storage: the FieldStorageConfigInterface object, * or by referring to an existing field storage in the current configuration * with: * - field_name: The field name. * - entity_type: The entity type. * Additionally, a 'bundle' property is required to indicate the entity * bundle to which the field is attached to. Other array elements will be * used to set the corresponding properties on the class; see the class * property documentation for details. * @param string $entity_type * (optional) The entity type on which the field should be created. * Defaults to "field_config". */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:97
- ⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:130
- ⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) Overrides \Drupal\Core\Entity\Entity::preSave().
/** * Overrides \Drupal\Core\Entity\Entity::preSave(). * * @throws \Drupal\Core\Field\FieldException * If the field definition is invalid. * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:152
- ⧉public calculateDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:188
- ⧉public isDeleted() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:288
- ⧉public getFieldStorageDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:295
- ⧉public isDisplayConfigurable($context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:329
- ⧉public getDisplayOptions($display_context) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:336
- ⧉public isReadOnly() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:344
- ⧉public isComputed() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:351
- ⧉public getUniqueIdentifier() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:358
- ⧉public id() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:199
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:206
- ⧉public getType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:213
- ⧉public getTargetEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:220
- ⧉public getTargetBundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:227
- ⧉public onDependencyRemoval(array $dependencies) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:261
- ⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:287
- ⧉public getLabel() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:301
- ⧉public setLabel($label) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:308
- ⧉public getDescription() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:316
- ⧉public setDescription($description) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:323
- ⧉public isTranslatable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:331
- ⧉public setTranslatable($translatable) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:339
- ⧉public getSettings() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:347
- ⧉public setSettings(array $settings) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:354
- ⧉public getSetting($setting_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:362
- ⧉public setSetting($setting_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:374
- ⧉public isRequired() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:382
- ⧉public setRequired($required) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:389
- ⧉public getDefaultValue(Drupal\Core\Entity\FieldableEntityInterface $entity) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:397
- ⧉public getDefaultValueLiteral() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:414
- ⧉public setDefaultValue($value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:421
- ⧉public getDefaultValueCallback() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:429
- ⧉public setDefaultValueCallback($callback) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:436
- ⧉public __sleep() Implements the magic __sleep() method.
/** * Implements the magic __sleep() method. * * Using the Serialize interface and serialize() / unserialize() methods * breaks entity forms in PHP 5.4. * @todo Investigate in https://www.drupal.org/node/1977206. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:448
- ⧉public getDataType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:477
- ⧉public isList() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:484
- ⧉public getClass() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:491
- ⧉public getConstraints() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:501
- ⧉public getConstraint($constraint_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:508
- ⧉public getItemDefinition() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:516
- ⧉public getConfig($bundle) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:540
- ⧉public setConstraints(array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:547
- ⧉public addConstraint($constraint_name, $options = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:555
- ⧉public setPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:563
- ⧉public addPropertyConstraints($name, array $constraints) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:576
- ⧉public isInternal() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:591
- ⧉public setSyncing($syncing) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⧉public isSyncing() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⧉public getOriginalId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:122
- ⧉public setOriginalId($id) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:129
- ⧉public isNew() Overrides Entity::isNew().
/** * Overrides Entity::isNew(). * * EntityInterface::enforceIsNew() is only supported for newly created * configuration entities but has no effect after saving, since each * configuration entity is unique. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:146
- ⧉public get($property_name) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:153
- ⧉public set($property_name, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:160
- ⧉public enable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:177
- ⧉public disable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:184
- ⧉public setStatus($status) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:191
- ⧉public status() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:199
- ⧉public setUninstalling($uninstalling) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:206
- ⧉public isUninstalling() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:213
- ⧉public createDuplicate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:220
- ⧉public toArray() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:245
- ⧉public toUrl($rel = 'edit-form', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:397
- ⧉public getCacheTagsToInvalidate() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:406
- ⧉public getDependencies() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:435
- ⧉public getConfigDependencyName() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:449
- ⧉public getConfigTarget() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:456
- ⧉public setThirdPartySetting($module, $key, $value) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:504
- ⧉public getThirdPartySetting($module, $key, $default = null) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:512
- ⧉public getThirdPartySettings($module) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:524
- ⧉public unsetThirdPartySetting($module, $key) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:531
- ⧉public getThirdPartyProviders() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:544
- ⧉public isInstallable() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:585
- ⧉public trustData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:592
- ⧉public hasTrustedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:600
- ⧉public save() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:607
- ⧉public addCacheableDependency($other_object) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⧉public traitSleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⧉public addCacheTags(array $cache_tags) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⧉public mergeCacheMaxAge($max_age) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⧉public uuid() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:113
- ⧉public enforceIsNew($value = true) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⧉public getEntityTypeId() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⧉public bundle() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:143
- ⧉public label() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:150
- ⧉public hasLinkTemplate($rel) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⧉public uriRelationships() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⧉public access($operation, ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:306
- ⧉public language() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:320
- ⧉public delete() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⧉public getEntityType() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⧉public referencedEntities() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:429
- ⧉public getCacheContexts() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⧉public getCacheTags() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⧉public getCacheMaxAge() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⧉public getTypedData() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⧉public getConfigDependencyKey() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⧉protected linkTemplates() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:260
- ⧉protected urlRouteParameters($rel) {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:277
- ⧉protected addDependencyTrait($type, $name): $this Adds a dependency.
/** * Adds a dependency. * * @param string $type * Type of dependency being added: 'module', 'theme', 'config', 'content'. * @param string $name * If $type is 'module' or 'theme', the name of the module or theme. If * $type is 'config' or 'content', the result of * EntityInterface::getConfigDependencyName(). * * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() * * @return $this */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:31
- ⧉protected getPluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance): array Calculates and returns dependencies of a specific plugin instance.
/** * Calculates and returns dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. * * @return array * An array of dependencies keyed by the type of dependency. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:33
- ⧉protected addDependencies(array $dependencies) Adds multiple dependencies.
/** * Adds multiple dependencies. * * @param array $dependencies * An array of dependencies keyed by the type of dependency. One example: * @code * array( * 'module' => array( * 'node', * 'field', * 'image', * ), * ); * @endcode * * @see \Drupal\Core\Entity\DependencyTrait::addDependency */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/DependencyTrait.php:64
- ⧉protected calculatePluginDependencies(Drupal\Component\Plugin\PluginInspectionInterface $instance) Calculates and adds dependencies of a specific plugin instance.
/** * Calculates and adds dependencies of a specific plugin instance. * * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:88
- ⧉protected moduleHandler(): \Drupal\Core\Extension\ModuleHandlerInterface Wraps the module handler.
/** * Wraps the module handler. * * @return \Drupal\Core\Extension\ModuleHandlerInterface * The module handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:98
- ⧉protected themeHandler(): \Drupal\Core\Extension\ThemeHandlerInterface Wraps the theme handler.
/** * Wraps the theme handler. * * @return \Drupal\Core\Extension\ThemeHandlerInterface * The theme handler. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php:108
- ⧉protected getTypedConfig(): \Drupal\Core\Config\TypedConfigManagerInterface Gets the typed config manager.
/** * Gets the typed config manager. * * @return \Drupal\Core\Config\TypedConfigManagerInterface */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:280
- ⧉protected addDependency($type, $name) Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
/** * Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). * * Note that this function should only be called from implementations of * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), * as dependencies are recalculated during every entity save. * * @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:421
- ⧉protected invalidateTagsOnSave($update) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the entity's cache tag; the config system * already invalidates it. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:483
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:198
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields) {@inheritdoc}\Drupal\field\Entity\FieldConfig::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $fields)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:224
- ⇄⧉public static loadByName($entity_type_id, $bundle, $field_name): Drupal\field\FieldConfigInterface|null Loads a field config entity based on the entity type and field name.\Drupal\field\Entity\FieldConfig::loadByName($entity_type_id, $bundle, $field_name)
/** * Loads a field config entity based on the entity type and field name. * * @param string $entity_type_id * ID of the entity type. * @param string $bundle * Bundle name. * @param string $field_name * Name of the field. * * @return Drupal\field\FieldConfigInterface|null * The field config entity if one exists for the provided field * name, otherwise NULL. */ Defined in <ROOT>/core/modules/field/src/Entity/FieldConfig.php:376
- ⇄⧉public static createFromItemType($item_type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromItemType($item_type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:459
- ⇄⧉public static createFromDataType($type) {@inheritdoc}\Drupal\Core\Field\FieldConfigBase::createFromDataType($type)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldConfigBase.php:468
- ⇄⧉public static sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label.\Drupal\Core\Config\Entity\ConfigEntityBase::sort(Drupal\Core\Config\Entity\ConfigEntityInterface $a, Drupal\Core\Config\Entity\ConfigEntityInterface $b)
/** * Helper callback for uasort() to sort configuration entities by weight and label. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:231
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\EntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:504
- ⧉protected static normalizeValue(&$value, $main_property_name): array Ensure a field value is transformed into a format keyed by delta.
/** * Ensure a field value is transformed into a format keyed by delta. * * @param mixed $value * The raw field value to normalize. * @param string $main_property_name * The main field property name. * * @return array * A field value normalized into a format keyed by delta. */ Inherited from Drupal\Core\Field\FieldConfigBase Defined in <ROOT>/core/lib/Drupal/Core/Field/FieldInputValueNormalizerTrait.php:26
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) {@inheritdoc}
/** * {@inheritdoc} * * Override to never invalidate the individual entities' cache tags; the * config system already invalidates them. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:493
- ⧉protected static getConfigManager(): \Drupal\Core\Config\ConfigManager Gets the configuration manager.
/** * Gets the configuration manager. * * @return \Drupal\Core\Config\ConfigManager * The configuration manager. */ Inherited from Drupal\Core\Config\Entity\ConfigEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:578
- ⧉protected languages -> array (4)
- ⧉cs => Drupal\Core\Language\Language (5)
- Properties (5)
- Available methods (9)
- Static class properties (16)
- protected name -> string (5) "Czech"
- protected id -> string (2) "cs"
- protected direction -> string (3) "ltr"
- protected weight -> integer 0
- protected locked -> boolean false
- ⧉public __construct(array $values = array()) Constructs a new class instance.
/** * Constructs a new class instance. * * @param array $values * An array of property values, keyed by property name, used to construct * the language. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:77
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:101
- ⧉public getId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:108
- ⧉public getDirection() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:115
- ⧉public getWeight() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:122
- ⧉public isDefault() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:129
- ⧉public isLocked() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:136
- ⇄⧉public static sort(&$languages) Sort language objects.\Drupal\Core\Language\Language::sort(&$languages)
/** * Sort language objects. * * @param \Drupal\Core\Language\LanguageInterface[] $languages * The array of language objects keyed by langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:146
- ⧉protected static getDefaultLangcode(): string Gets the default langcode.
/** * Gets the default langcode. * * @return string * The current default langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:173
- ⇄⧉public static $defaultValues :: array (5)\Drupal\Core\Language\Language::$defaultValues
- ⇄id => string (2) "en"\Drupal\Core\Language\Language::$defaultValues['id']
- ⇄name => string (7) "English"\Drupal\Core\Language\Language::$defaultValues['name']
- ⇄direction => string (3) "ltr"\Drupal\Core\Language\Language::$defaultValues['direction']
- ⇄weight => integer 0\Drupal\Core\Language\Language::$defaultValues['weight']
- ⇄locked => boolean false\Drupal\Core\Language\Language::$defaultValues['locked']
- ⇄id => string (2) "en"
- ⇄const LANGCODE_SYSTEM :: string (6) "system"\Drupal\Core\Language\Language::LANGCODE_SYSTEM
- ⇄const LANGCODE_NOT_SPECIFIED :: string (3) "und"\Drupal\Core\Language\Language::LANGCODE_NOT_SPECIFIED
- ⇄const LANGCODE_NOT_APPLICABLE :: string (3) "zxx"\Drupal\Core\Language\Language::LANGCODE_NOT_APPLICABLE
- ⇄const LANGCODE_DEFAULT :: string (9) "x-default"\Drupal\Core\Language\Language::LANGCODE_DEFAULT
- ⇄const LANGCODE_SITE_DEFAULT :: string (12) "site_default"\Drupal\Core\Language\Language::LANGCODE_SITE_DEFAULT
- ⇄const VALID_LANGCODE_REGEX :: string (33) "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"\Drupal\Core\Language\Language::VALID_LANGCODE_REGEX
- ⇄const STATE_CONFIGURABLE :: integer 1\Drupal\Core\Language\Language::STATE_CONFIGURABLE
- ⇄const STATE_LOCKED :: integer 2\Drupal\Core\Language\Language::STATE_LOCKED
- ⇄const STATE_ALL :: integer 3\Drupal\Core\Language\Language::STATE_ALL
- ⇄const STATE_SITE_DEFAULT :: integer 4\Drupal\Core\Language\Language::STATE_SITE_DEFAULT
- ⇄const TYPE_CONTENT :: string (16) "language_content"\Drupal\Core\Language\Language::TYPE_CONTENT
- ⇄const TYPE_INTERFACE :: string (18) "language_interface"\Drupal\Core\Language\Language::TYPE_INTERFACE
- ⇄const TYPE_URL :: string (12) "language_url"\Drupal\Core\Language\Language::TYPE_URL
- ⇄const DIRECTION_LTR :: string (3) "ltr"\Drupal\Core\Language\Language::DIRECTION_LTR
- ⇄const DIRECTION_RTL :: string (3) "rtl"\Drupal\Core\Language\Language::DIRECTION_RTL
- ⇄⧉public static $defaultValues :: array (5)
- ⧉en => Drupal\Core\Language\Language (5)
- Properties (5)
- Available methods (9)
- Static class properties (16)
- protected name -> string (7) "English"
- protected id -> string (2) "en"
- protected direction -> string (3) "ltr"
- protected weight -> integer 0
- protected locked -> boolean false
- ⧉public __construct(array $values = array()) Constructs a new class instance.
/** * Constructs a new class instance. * * @param array $values * An array of property values, keyed by property name, used to construct * the language. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:77
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:101
- ⧉public getId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:108
- ⧉public getDirection() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:115
- ⧉public getWeight() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:122
- ⧉public isDefault() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:129
- ⧉public isLocked() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:136
- ⇄⧉public static sort(&$languages) Sort language objects.\Drupal\Core\Language\Language::sort(&$languages)
/** * Sort language objects. * * @param \Drupal\Core\Language\LanguageInterface[] $languages * The array of language objects keyed by langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:146
- ⧉protected static getDefaultLangcode(): string Gets the default langcode.
/** * Gets the default langcode. * * @return string * The current default langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:173
- ⇄⧉public static $defaultValues :: array (5)\Drupal\Core\Language\Language::$defaultValues
- ⇄id => string (2) "en"\Drupal\Core\Language\Language::$defaultValues['id']
- ⇄name => string (7) "English"\Drupal\Core\Language\Language::$defaultValues['name']
- ⇄direction => string (3) "ltr"\Drupal\Core\Language\Language::$defaultValues['direction']
- ⇄weight => integer 0\Drupal\Core\Language\Language::$defaultValues['weight']
- ⇄locked => boolean false\Drupal\Core\Language\Language::$defaultValues['locked']
- ⇄id => string (2) "en"
- ⇄const LANGCODE_SYSTEM :: string (6) "system"\Drupal\Core\Language\Language::LANGCODE_SYSTEM
- ⇄const LANGCODE_NOT_SPECIFIED :: string (3) "und"\Drupal\Core\Language\Language::LANGCODE_NOT_SPECIFIED
- ⇄const LANGCODE_NOT_APPLICABLE :: string (3) "zxx"\Drupal\Core\Language\Language::LANGCODE_NOT_APPLICABLE
- ⇄const LANGCODE_DEFAULT :: string (9) "x-default"\Drupal\Core\Language\Language::LANGCODE_DEFAULT
- ⇄const LANGCODE_SITE_DEFAULT :: string (12) "site_default"\Drupal\Core\Language\Language::LANGCODE_SITE_DEFAULT
- ⇄const VALID_LANGCODE_REGEX :: string (33) "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"\Drupal\Core\Language\Language::VALID_LANGCODE_REGEX
- ⇄const STATE_CONFIGURABLE :: integer 1\Drupal\Core\Language\Language::STATE_CONFIGURABLE
- ⇄const STATE_LOCKED :: integer 2\Drupal\Core\Language\Language::STATE_LOCKED
- ⇄const STATE_ALL :: integer 3\Drupal\Core\Language\Language::STATE_ALL
- ⇄const STATE_SITE_DEFAULT :: integer 4\Drupal\Core\Language\Language::STATE_SITE_DEFAULT
- ⇄const TYPE_CONTENT :: string (16) "language_content"\Drupal\Core\Language\Language::TYPE_CONTENT
- ⇄const TYPE_INTERFACE :: string (18) "language_interface"\Drupal\Core\Language\Language::TYPE_INTERFACE
- ⇄const TYPE_URL :: string (12) "language_url"\Drupal\Core\Language\Language::TYPE_URL
- ⇄const DIRECTION_LTR :: string (3) "ltr"\Drupal\Core\Language\Language::DIRECTION_LTR
- ⇄const DIRECTION_RTL :: string (3) "rtl"\Drupal\Core\Language\Language::DIRECTION_RTL
- ⇄⧉public static $defaultValues :: array (5)
- ⧉und => Drupal\Core\Language\Language (5)
- Properties (5)
- Available methods (9)
- Static class properties (16)
- protected name -> UTF-8 string (16) "Nespecifikováno"
- protected id -> string (3) "und"
- protected direction -> string (3) "ltr"
- protected weight -> integer 2
- protected locked -> boolean true
- ⧉public __construct(array $values = array()) Constructs a new class instance.
/** * Constructs a new class instance. * * @param array $values * An array of property values, keyed by property name, used to construct * the language. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:77
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:101
- ⧉public getId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:108
- ⧉public getDirection() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:115
- ⧉public getWeight() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:122
- ⧉public isDefault() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:129
- ⧉public isLocked() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:136
- ⇄⧉public static sort(&$languages) Sort language objects.\Drupal\Core\Language\Language::sort(&$languages)
/** * Sort language objects. * * @param \Drupal\Core\Language\LanguageInterface[] $languages * The array of language objects keyed by langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:146
- ⧉protected static getDefaultLangcode(): string Gets the default langcode.
/** * Gets the default langcode. * * @return string * The current default langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:173
- ⇄⧉public static $defaultValues :: array (5)\Drupal\Core\Language\Language::$defaultValues
- ⇄id => string (2) "en"\Drupal\Core\Language\Language::$defaultValues['id']
- ⇄name => string (7) "English"\Drupal\Core\Language\Language::$defaultValues['name']
- ⇄direction => string (3) "ltr"\Drupal\Core\Language\Language::$defaultValues['direction']
- ⇄weight => integer 0\Drupal\Core\Language\Language::$defaultValues['weight']
- ⇄locked => boolean false\Drupal\Core\Language\Language::$defaultValues['locked']
- ⇄id => string (2) "en"
- ⇄const LANGCODE_SYSTEM :: string (6) "system"\Drupal\Core\Language\Language::LANGCODE_SYSTEM
- ⇄const LANGCODE_NOT_SPECIFIED :: string (3) "und"\Drupal\Core\Language\Language::LANGCODE_NOT_SPECIFIED
- ⇄const LANGCODE_NOT_APPLICABLE :: string (3) "zxx"\Drupal\Core\Language\Language::LANGCODE_NOT_APPLICABLE
- ⇄const LANGCODE_DEFAULT :: string (9) "x-default"\Drupal\Core\Language\Language::LANGCODE_DEFAULT
- ⇄const LANGCODE_SITE_DEFAULT :: string (12) "site_default"\Drupal\Core\Language\Language::LANGCODE_SITE_DEFAULT
- ⇄const VALID_LANGCODE_REGEX :: string (33) "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"\Drupal\Core\Language\Language::VALID_LANGCODE_REGEX
- ⇄const STATE_CONFIGURABLE :: integer 1\Drupal\Core\Language\Language::STATE_CONFIGURABLE
- ⇄const STATE_LOCKED :: integer 2\Drupal\Core\Language\Language::STATE_LOCKED
- ⇄const STATE_ALL :: integer 3\Drupal\Core\Language\Language::STATE_ALL
- ⇄const STATE_SITE_DEFAULT :: integer 4\Drupal\Core\Language\Language::STATE_SITE_DEFAULT
- ⇄const TYPE_CONTENT :: string (16) "language_content"\Drupal\Core\Language\Language::TYPE_CONTENT
- ⇄const TYPE_INTERFACE :: string (18) "language_interface"\Drupal\Core\Language\Language::TYPE_INTERFACE
- ⇄const TYPE_URL :: string (12) "language_url"\Drupal\Core\Language\Language::TYPE_URL
- ⇄const DIRECTION_LTR :: string (3) "ltr"\Drupal\Core\Language\Language::DIRECTION_LTR
- ⇄const DIRECTION_RTL :: string (3) "rtl"\Drupal\Core\Language\Language::DIRECTION_RTL
- ⇄⧉public static $defaultValues :: array (5)
- ⧉zxx => Drupal\Core\Language\Language (5)
- Properties (5)
- Available methods (9)
- Static class properties (16)
- protected name -> UTF-8 string (14) "Nelze použít"
- protected id -> string (3) "zxx"
- protected direction -> string (3) "ltr"
- protected weight -> integer 3
- protected locked -> boolean true
- ⧉public __construct(array $values = array()) Constructs a new class instance.
/** * Constructs a new class instance. * * @param array $values * An array of property values, keyed by property name, used to construct * the language. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:77
- ⧉public getName() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:101
- ⧉public getId() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:108
- ⧉public getDirection() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:115
- ⧉public getWeight() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:122
- ⧉public isDefault() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:129
- ⧉public isLocked() {@inheritdoc}
/** * {@inheritdoc} */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:136
- ⇄⧉public static sort(&$languages) Sort language objects.\Drupal\Core\Language\Language::sort(&$languages)
/** * Sort language objects. * * @param \Drupal\Core\Language\LanguageInterface[] $languages * The array of language objects keyed by langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:146
- ⧉protected static getDefaultLangcode(): string Gets the default langcode.
/** * Gets the default langcode. * * @return string * The current default langcode. */ Defined in <ROOT>/core/lib/Drupal/Core/Language/Language.php:173
- ⇄⧉public static $defaultValues :: array (5)\Drupal\Core\Language\Language::$defaultValues
- ⇄id => string (2) "en"\Drupal\Core\Language\Language::$defaultValues['id']
- ⇄name => string (7) "English"\Drupal\Core\Language\Language::$defaultValues['name']
- ⇄direction => string (3) "ltr"\Drupal\Core\Language\Language::$defaultValues['direction']
- ⇄weight => integer 0\Drupal\Core\Language\Language::$defaultValues['weight']
- ⇄locked => boolean false\Drupal\Core\Language\Language::$defaultValues['locked']
- ⇄id => string (2) "en"
- ⇄const LANGCODE_SYSTEM :: string (6) "system"\Drupal\Core\Language\Language::LANGCODE_SYSTEM
- ⇄const LANGCODE_NOT_SPECIFIED :: string (3) "und"\Drupal\Core\Language\Language::LANGCODE_NOT_SPECIFIED
- ⇄const LANGCODE_NOT_APPLICABLE :: string (3) "zxx"\Drupal\Core\Language\Language::LANGCODE_NOT_APPLICABLE
- ⇄const LANGCODE_DEFAULT :: string (9) "x-default"\Drupal\Core\Language\Language::LANGCODE_DEFAULT
- ⇄const LANGCODE_SITE_DEFAULT :: string (12) "site_default"\Drupal\Core\Language\Language::LANGCODE_SITE_DEFAULT
- ⇄const VALID_LANGCODE_REGEX :: string (33) "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"\Drupal\Core\Language\Language::VALID_LANGCODE_REGEX
- ⇄const STATE_CONFIGURABLE :: integer 1\Drupal\Core\Language\Language::STATE_CONFIGURABLE
- ⇄const STATE_LOCKED :: integer 2\Drupal\Core\Language\Language::STATE_LOCKED
- ⇄const STATE_ALL :: integer 3\Drupal\Core\Language\Language::STATE_ALL
- ⇄const STATE_SITE_DEFAULT :: integer 4\Drupal\Core\Language\Language::STATE_SITE_DEFAULT
- ⇄const TYPE_CONTENT :: string (16) "language_content"\Drupal\Core\Language\Language::TYPE_CONTENT
- ⇄const TYPE_INTERFACE :: string (18) "language_interface"\Drupal\Core\Language\Language::TYPE_INTERFACE
- ⇄const TYPE_URL :: string (12) "language_url"\Drupal\Core\Language\Language::TYPE_URL
- ⇄const DIRECTION_LTR :: string (3) "ltr"\Drupal\Core\Language\Language::DIRECTION_LTR
- ⇄const DIRECTION_RTL :: string (3) "rtl"\Drupal\Core\Language\Language::DIRECTION_RTL
- ⇄⧉public static $defaultValues :: array (5)
- protected langcodeKey -> string (8) "langcode"
- protected defaultLangcodeKey -> string (16) "default_langcode"
- protected activeLangcode -> string (9) "x-default"
- protected defaultLangcode -> string (2) "cs"
- ⧉protected translations -> array (1)
- ⧉x-default => array (1)
- status => integer 1
- protected translationInitialize -> boolean false
- protected newRevision -> boolean false
- protected isDefaultRevision -> string (1) "1"
- ⧉protected entityKeys -> array (4)
- bundle => string (10) "staticpage"
- id => string (3) "479"
- revision => string (3) "479"
- uuid => string (36) "17b89f0b-2982-4a17-9f9c-8da9768add41"
- ⧉protected translatableEntityKeys -> array (8)
- ⧉label => array (1)
- x-default => UTF-8 string (53) "Zadání soutěžní úlohy "Věž (Tower)" - finále"
- ⧉langcode => array (1)
- x-default => string (2) "cs"
- ⧉status => array (1)
- x-default => string (1) "1"
- ⧉published => array (1)
- x-default => string (1) "1"
- ⧉uid => array (1)
- x-default => string (3) "127"
- ⧉owner => array (1)
- x-default => string (3) "127"
- ⧉default_langcode => array (1)
- x-default => string (1) "1"
- ⧉revision_translation_affected => array (1)
- x-default => string (1) "1"
- protected validated -> boolean false
- protected validationRequired -> boolean false
- protected loadedRevisionId -> string (3) "479"
- protected revisionTranslationAffectedKey -> string (29) "revision_translation_affected"
- protected enforceRevisionTranslationAffected -> array (0)
- protected isSyncing -> boolean false
- ⇄public in_preview -> null$0->in_preview
- ⇄⧉public getOwnerId() {@inheritdoc}$0->getOwnerId()
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/user/src/EntityOwnerTrait.php:48
- ⇄⧉public setOwnerId($uid) {@inheritdoc}$0->setOwnerId($uid)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/user/src/EntityOwnerTrait.php:55
- ⇄⧉public getOwner() {@inheritdoc}$0->getOwner()
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/user/src/EntityOwnerTrait.php:65
- ⇄⧉public setOwner(Drupal\user\UserInterface $account) {@inheritdoc}$0->setOwner(Drupal\user\UserInterface $account)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/user/src/EntityOwnerTrait.php:73
- ⇄⧉public preSave(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}$0->preSave(Drupal\Core\Entity\EntityStorageInterface $storage)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:102
- ⇄⧉public preSaveRevision(Drupal\Core\Entity\EntityStorageInterface $storage, stdClass $record) {@inheritdoc}$0->preSaveRevision(Drupal\Core\Entity\EntityStorageInterface $storage, stdClass $record)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:124
- ⇄⧉public postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true) {@inheritdoc}$0->postSave(Drupal\Core\Entity\EntityStorageInterface $storage, $update = true)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:139
- ⇄⧉public getType() {@inheritdoc}$0->getType()
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:186
- ⇄⧉public access($operation = 'view', ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false) {@inheritdoc}$0->access($operation = 'view', ?Drupal\Core\Session\AccountInterface $account = null, $return_as_object = false)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:193
- ⇄⧉public getTitle() {@inheritdoc}$0->getTitle()
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:201
- ⇄⧉public setTitle($title) {@inheritdoc}$0->setTitle($title)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:208
- ⇄⧉public getCreatedTime() {@inheritdoc}$0->getCreatedTime()
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:216
- ⇄⧉public setCreatedTime($timestamp) {@inheritdoc}$0->setCreatedTime($timestamp)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:223
- ⇄⧉public isPromoted() {@inheritdoc}$0->isPromoted()
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:231
- ⇄⧉public setPromoted($promoted) {@inheritdoc}$0->setPromoted($promoted)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:238
- ⇄⧉public isSticky() {@inheritdoc}$0->isSticky()
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:246
- ⇄⧉public setSticky($sticky) {@inheritdoc}$0->setSticky($sticky)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:253
- ⇄⧉public getChangedTimeAcrossTranslations(): int Returns the timestamp of the last entity change across all translations.$0->getChangedTimeAcrossTranslations()
/** * Returns the timestamp of the last entity change across all translations. * * @return int * The timestamp of the last entity save operation across all * translations. */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityChangedTrait.php:17
- ⇄⧉public getChangedTime(): int Gets the timestamp of the last entity change for the current translation.$0->getChangedTime()
/** * Gets the timestamp of the last entity change for the current translation. * * @return int * The timestamp of the last entity save operation. */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityChangedTrait.php:32
- ⇄⧉public setChangedTime($timestamp): $this Sets the timestamp of the last entity change for the current translation.$0->setChangedTime($timestamp)
/** * Sets the timestamp of the last entity change for the current translation. * * @param int $timestamp * The timestamp of the last entity save operation. * * @return $this */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityChangedTrait.php:44
- ⇄⧉public isPublished() {@inheritdoc}$0->isPublished()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php:47
- ⇄⧉public setPublished() {@inheritdoc}$0->setPublished()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php:54
- ⇄⧉public setUnpublished() {@inheritdoc}$0->setUnpublished()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php:64
- ⇄⧉public getRevisionCreationTime() Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionCreationTime().$0->getRevisionCreationTime()
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionCreationTime(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:69
- ⇄⧉public setRevisionCreationTime($timestamp) Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionCreationTime().$0->setRevisionCreationTime($timestamp)
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionCreationTime(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:76
- ⇄⧉public getRevisionUser() Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser().$0->getRevisionUser()
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:84
- ⇄⧉public setRevisionUser(Drupal\user\UserInterface $account) Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUser().$0->setRevisionUser(Drupal\user\UserInterface $account)
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUser(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:91
- ⇄⧉public getRevisionUserId() Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUserId().$0->getRevisionUserId()
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUserId(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:99
- ⇄⧉public setRevisionUserId($user_id) Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId().$0->setRevisionUserId($user_id)
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:106
- ⇄⧉public getRevisionLogMessage() Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionLogMessage().$0->getRevisionLogMessage()
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionLogMessage(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:114
- ⇄⧉public setRevisionLogMessage($revision_log_message) Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionLogMessage().$0->setRevisionLogMessage($revision_log_message)
/** * Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionLogMessage(). */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:121
- ⇄⧉public setSyncing($syncing) {@inheritdoc}$0->setSyncing($syncing)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:22
- ⇄⧉public isSyncing() {@inheritdoc}$0->isSyncing()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php:31
- ⇄⧉public __construct(array $values, $entity_type, $bundle = false, $translations = array()) {@inheritdoc}new \Drupal\node\Entity\Node(array $values, $entity_type, $bundle = false, $translations = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:189
- ⇄⧉public postCreate(Drupal\Core\Entity\EntityStorageInterface $storage) {@inheritdoc}$0->postCreate(Drupal\Core\Entity\EntityStorageInterface $storage)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:284
- ⇄⧉public setNewRevision($value = true) {@inheritdoc}$0->setNewRevision($value = true)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:291
- ⇄⧉public getLoadedRevisionId() {@inheritdoc}$0->getLoadedRevisionId()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:313
- ⇄⧉public updateLoadedRevisionId() {@inheritdoc}$0->updateLoadedRevisionId()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:320
- ⇄⧉public isNewRevision() {@inheritdoc}$0->isNewRevision()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:328
- ⇄⧉public isDefaultRevision($new_value = null) {@inheritdoc}$0->isDefaultRevision($new_value = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:335
- ⇄⧉public wasDefaultRevision() {@inheritdoc}$0->wasDefaultRevision()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:348
- ⇄⧉public isLatestRevision() {@inheritdoc}$0->isLatestRevision()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:363
- ⇄⧉public isLatestTranslationAffectedRevision() {@inheritdoc}$0->isLatestTranslationAffectedRevision()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:373
- ⇄⧉public isRevisionTranslationAffected() {@inheritdoc}$0->isRevisionTranslationAffected()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:383
- ⇄⧉public setRevisionTranslationAffected($affected) {@inheritdoc}$0->setRevisionTranslationAffected($affected)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:390
- ⇄⧉public isRevisionTranslationAffectedEnforced() {@inheritdoc}$0->isRevisionTranslationAffectedEnforced()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:400
- ⇄⧉public setRevisionTranslationAffectedEnforced($enforced) {@inheritdoc}$0->setRevisionTranslationAffectedEnforced($enforced)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:407
- ⇄⧉public isDefaultTranslation() {@inheritdoc}$0->isDefaultTranslation()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:415
- ⇄⧉public getRevisionId() {@inheritdoc}$0->getRevisionId()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:422
- ⇄⧉public isTranslatable() {@inheritdoc}$0->isTranslatable()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:429
- ⇄⧉public validate() {@inheritdoc}$0->validate()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:487
- ⇄⧉public isValidationRequired() {@inheritdoc}$0->isValidationRequired()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:496
- ⇄⧉public setValidationRequired($required) {@inheritdoc}$0->setValidationRequired($required)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:503
- ⧉public __sleep() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:520
- ⇄⧉public id() {@inheritdoc}$0->id()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:538
- ⇄⧉public bundle() {@inheritdoc}$0->bundle()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:545
- ⇄⧉public uuid() {@inheritdoc}$0->uuid()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:552
- ⇄⧉public hasField($field_name) {@inheritdoc}$0->hasField($field_name)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:559
- ⇄⧉public get($field_name) {@inheritdoc}$0->get($field_name)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:566
- ⇄⧉public set($name, $value, $notify = true) {@inheritdoc}$0->set($name, $value, $notify = true)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:624
- ⇄⧉public getFields($include_computed = true) {@inheritdoc}$0->getFields($include_computed = true)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:635
- ⇄⧉public getTranslatableFields($include_computed = true) {@inheritdoc}$0->getTranslatableFields($include_computed = true)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:648
- ⇄⧉public getIterator() {@inheritdoc}$0->getIterator()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:662
- ⇄⧉public getFieldDefinition($name) {@inheritdoc}$0->getFieldDefinition($name)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:669
- ⇄⧉public getFieldDefinitions() {@inheritdoc}$0->getFieldDefinitions()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:681
- ⇄⧉public toArray() {@inheritdoc}$0->toArray()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:691
- ⇄⧉public language() {@inheritdoc}$0->language()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:716
- ⇄⧉public onChange($name) {@inheritdoc}$0->onChange($name)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:782
- ⇄⧉public getTranslation($langcode) {@inheritdoc}$0->getTranslation($langcode)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:848
- ⇄⧉public getUntranslated() {@inheritdoc}$0->getUntranslated()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:883
- ⇄⧉public hasTranslation($langcode) {@inheritdoc}$0->hasTranslation($langcode)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:934
- ⇄⧉public isNewTranslation() {@inheritdoc}$0->isNewTranslation()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:944
- ⇄⧉public addTranslation($langcode, array $values = array()) {@inheritdoc}$0->addTranslation($langcode, array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:951
- ⇄⧉public removeTranslation($langcode) {@inheritdoc}$0->removeTranslation($langcode)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:972
- ⇄⧉public getTranslationStatus($langcode) {@inheritdoc}$0->getTranslationStatus($langcode)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1001
- ⇄⧉public getTranslationLanguages($include_default = true) {@inheritdoc}$0->getTranslationLanguages($include_default = true)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1011
- ⇄⧉public updateOriginalValues() Updates the original values with the interim changes.$0->updateOriginalValues()
/** * Updates the original values with the interim changes. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1028
- ⧉public & __get($name) Implements the magic method for getting object properties.
/** * Implements the magic method for getting object properties. * * @todo: A lot of code still uses non-fields (e.g. $entity->content in view * builders) by reference. Clean that up. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1048
- ⧉public __set($name, $value) Implements the magic method for setting object properties.
/** * Implements the magic method for setting object properties. * * Uses default language always. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1075
- ⧉public __isset($name) Implements the magic method for isset().
/** * Implements the magic method for isset(). */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1109
- ⧉public __unset($name) Implements the magic method for unset().
/** * Implements the magic method for unset(). */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1118
- ⇄⧉public createDuplicate() {@inheritdoc}$0->createDuplicate()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1149
- ⇄⧉public __clone() Magic method: Implements a deep clone.clone $0
/** * Magic method: Implements a deep clone. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1178
- ⇄⧉public label() {@inheritdoc}$0->label()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1264
- ⇄⧉public referencedEntities() {@inheritdoc}$0->referencedEntities()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1273
- ⇄⧉public hasTranslationChanges() {@inheritdoc}$0->hasTranslationChanges()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1413
- ⇄⧉public isDefaultTranslationAffectedOnly() {@inheritdoc}$0->isDefaultTranslationAffectedOnly()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1472
- ⇄⧉public addCacheableDependency($other_object) {@inheritdoc}$0->addCacheableDependency($other_object)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:15
- ⇄⧉public addCacheContexts(array $cache_contexts) {@inheritdoc}$0->addCacheContexts(array $cache_contexts)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:31
- ⇄⧉public traitSleep() {@inheritdoc}$0->traitSleep()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:33
- ⇄⧉public addCacheTags(array $cache_tags) {@inheritdoc}$0->addCacheTags(array $cache_tags)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:41
- ⇄⧉public mergeCacheMaxAge($max_age) {@inheritdoc}$0->mergeCacheMaxAge($max_age)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php:51
- ⧉public __wakeup() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:74
- ⇄⧉public isNew() {@inheritdoc}$0->isNew()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:120
- ⇄⧉public enforceIsNew($value = true) {@inheritdoc}$0->enforceIsNew($value = true)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:127
- ⇄⧉public getEntityTypeId() {@inheritdoc}$0->getEntityTypeId()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:136
- ⇄⧉public toUrl($rel = 'canonical', array $options = array()) {@inheritdoc}$0->toUrl($rel = 'canonical', array $options = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:159
- ⇄⧉public hasLinkTemplate($rel) {@inheritdoc}$0->hasLinkTemplate($rel)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:222
- ⇄⧉public toLink($text = null, $rel = 'canonical', array $options = array()) {@inheritdoc}$0->toLink($text = null, $rel = 'canonical', array $options = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:240
- ⇄⧉public uriRelationships() {@inheritdoc}$0->uriRelationships()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:284
- ⇄⧉public save() {@inheritdoc}$0->save()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:337
- ⇄⧉public delete() {@inheritdoc}$0->delete()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:345
- ⇄⧉public getEntityType() {@inheritdoc}$0->getEntityType()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:371
- ⇄⧉public getCacheContexts() {@inheritdoc}$0->getCacheContexts()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:436
- ⇄⧉public getCacheTagsToInvalidate() {@inheritdoc}$0->getCacheTagsToInvalidate()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:457
- ⇄⧉public getCacheTags() {@inheritdoc}$0->getCacheTags()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:467
- ⇄⧉public getCacheMaxAge() {@inheritdoc}$0->getCacheMaxAge()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:477
- ⇄⧉public getOriginalId() {@inheritdoc}$0->getOriginalId()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:559
- ⇄⧉public setOriginalId($id) {@inheritdoc}$0->setOriginalId($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:567
- ⇄⧉public getTypedData() {@inheritdoc}$0->getTypedData()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:588
- ⇄⧉public getConfigDependencyKey() {@inheritdoc}$0->getConfigDependencyKey()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:633
- ⇄⧉public getConfigDependencyName() {@inheritdoc}$0->getConfigDependencyName()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:640
- ⇄⧉public getConfigTarget() {@inheritdoc}$0->getConfigTarget()
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:647
- ⧉protected traitGetFieldsToSkipFromTranslationChangesCheck(Drupal\Core\Entity\ContentEntityInterface $entity): string[] Returns an array of field names to skip when checking for changes.
/** * Returns an array of field names to skip when checking for changes. * * @param \Drupal\Core\Entity\ContentEntityInterface $entity * A content entity object. * * @return string[] * An array of field names. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityChangesDetectionTrait.php:21
- ⧉protected getLanguages() {@inheritdoc}
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:268
- ⧉protected clearTranslationCache() Clear entity translation object cache to remove stale references.
/** * Clear entity translation object cache to remove stale references. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:511
- ⧉protected getTranslatedField($name, $langcode): \Drupal\Core\Field\FieldItemListInterface Gets a translated field.
/** * Gets a translated field. * * @return \Drupal\Core\Field\FieldItemListInterface */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:578
- ⧉protected setDefaultLangcode() Populates the local cache for the default language code.
/** * Populates the local cache for the default language code. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:738
- ⧉protected updateFieldLangcodes($langcode) Updates language for already instantiated fields.
/** * Updates language for already instantiated fields. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:771
- ⧉protected initializeTranslation($langcode): \Drupal\Core\Entity\EntityInterface Instantiates a translation object for an existing translation.
/** * Instantiates a translation object for an existing translation. * * The translated entity will be a clone of the current entity with the * specified $langcode. All translations share the same field data structures * to ensure that all of them deal with fresh data. * * @param string $langcode * The language code for the requested translation. * * @return \Drupal\Core\Entity\EntityInterface * The translation object. The content properties of the translation object * are stored as references to the main entity. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:901
- ⧉protected getEntityKey($key): mixed Gets the value of the given entity key, if defined.
/** * Gets the value of the given entity key, if defined. * * @param string $key * Name of the entity key, for example id, revision or bundle. * * @return mixed * The value of the entity key, NULL if not defined. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1300
- ⧉protected getFieldsToSkipFromTranslationChangesCheck(): array Returns an array of field names to skip in ::hasTranslationChanges.
/** * Returns an array of field names to skip in ::hasTranslationChanges. * * @return array * An array of field names. */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1402
- ⧉protected setCacheability(Drupal\Core\Cache\CacheableDependencyInterface $cacheability): $this Sets cacheability; useful for value object constructors.
/** * Sets cacheability; useful for value object constructors. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability to set. * * @return $this */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Cache/CacheableDependencyTrait.php:39
- ⧉protected entityTypeManager(): \Drupal\Core\Entity\EntityTypeManagerInterface Gets the entity type manager.
/** * Gets the entity type manager. * * @return \Drupal\Core\Entity\EntityTypeManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:72
- ⧉protected entityTypeBundleInfo(): \Drupal\Core\Entity\EntityTypeBundleInfoInterface Gets the entity type bundle info service.
/** * Gets the entity type bundle info service. * * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:81
- ⧉protected languageManager(): \Drupal\Core\Language\LanguageManagerInterface Gets the language manager.
/** * Gets the language manager. * * @return \Drupal\Core\Language\LanguageManagerInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:90
- ⧉protected uuidGenerator(): \Drupal\Component\Uuid\UuidInterface Gets the UUID generator.
/** * Gets the UUID generator. * * @return \Drupal\Component\Uuid\UuidInterface */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:99
- ⧉protected linkTemplates(): array Gets an array link templates.
/** * Gets an array link templates. * * @return array * An array of link templates containing paths. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:233
- ⧉protected urlRouteParameters($rel): array Gets an array of placeholders for this entity.
/** * Gets an array of placeholders for this entity. * * Individual entity classes may override this method to add additional * placeholders if desired. If so, they should be sure to replicate the * property caching logic. * * @param string $rel * The link relationship type, for example: canonical or edit-form. * * @return array * An array of URI placeholders. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:263
- ⧉protected getListCacheTagsToInvalidate(): string[] The list cache tags to invalidate for this entity.
/** * The list cache tags to invalidate for this entity. * * @return string[] * Set of list cache tags. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:446
- ⧉protected invalidateTagsOnSave($update) Invalidates an entity's cache tags upon save.
/** * Invalidates an entity's cache tags upon save. * * @param bool $update * TRUE if the entity has been updated, or FALSE if it has been inserted. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:517
- ⇄⧉public static ownerBaseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type): \Drupal\Core\Field\BaseFieldDefinition[] Returns an array of base field definitions for entity owners.\Drupal\node\Entity\Node::ownerBaseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type)
/** * Returns an array of base field definitions for entity owners. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type to add the owner field to. * * @return \Drupal\Core\Field\BaseFieldDefinition[] * An array of base field definitions. * * @throws \Drupal\Core\Entity\Exception\UnsupportedEntityTypeDefinitionException * Thrown when the entity type does not implement EntityOwnerInterface or * if it does not have an "owner" entity key. */ Defined in <ROOT>/core/modules/user/src/EntityOwnerTrait.php:28
- ⇄⧉public static getDefaultEntityOwner(): mixed Default value callback for 'owner' base field.\Drupal\node\Entity\Node::getDefaultEntityOwner()
/** * Default value callback for 'owner' base field. * * @return mixed * A default value for the owner field. */ Defined in <ROOT>/core/modules/user/src/EntityOwnerTrait.php:86
- ⇄⧉public static preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $entities) {@inheritdoc}\Drupal\node\Entity\Node::preDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $entities)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:162
- ⇄⧉public static postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $nodes) {@inheritdoc}\Drupal\node\Entity\Node::postDelete(Drupal\Core\Entity\EntityStorageInterface $storage, array $nodes)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:178
- ⇄⧉public static baseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type) {@inheritdoc}\Drupal\node\Entity\Node::baseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type)
/** * {@inheritdoc} */ Defined in <ROOT>/core/modules/node/src/Entity/Node.php:261
- ⇄⧉public static publishedBaseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type): \Drupal\Core\Field\BaseFieldDefinition[] Returns an array of base field definitions for publishing status.\Drupal\Core\Entity\EditorialContentEntityBase::publishedBaseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type)
/** * Returns an array of base field definitions for publishing status. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type to add the publishing status field to. * * @return \Drupal\Core\Field\BaseFieldDefinition[] * An array of base field definitions. * * @throws \Drupal\Core\Entity\Exception\UnsupportedEntityTypeDefinitionException * Thrown when the entity type does not implement EntityPublishedInterface * or if it does not have a "published" entity key. */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php:27
- ⇄⧉public static revisionLogBaseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type): \Drupal\Core\Field\FieldDefinitionInterface[] Provides revision-related base field definitions for an entity type.\Drupal\Core\Entity\EditorialContentEntityBase::revisionLogBaseFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type)
/** * Provides revision-related base field definitions for an entity type. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. * * @return \Drupal\Core\Field\FieldDefinitionInterface[] * An array of base field definitions for the entity type, keyed by field * name. * * @see \Drupal\Core\Entity\FieldableEntityInterface::baseFieldDefinitions() */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:28
- ⇄⧉public static create(array $values = array()) {@inheritdoc}\Drupal\Core\Entity\ContentEntityBase::create(array $values = array())
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1132
- ⇄⧉public static bundleFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {@inheritdoc}\Drupal\Core\Entity\ContentEntityBase::bundleFieldDefinitions(Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle, array $base_field_definitions)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\ContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityBase.php:1392
- ⇄⧉public static preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values) {@inheritdoc}\Drupal\Core\Entity\EntityBase::preCreate(Drupal\Core\Entity\EntityStorageInterface $storage, array &$values)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:398
- ⇄⧉public static postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities) {@inheritdoc}\Drupal\Core\Entity\EntityBase::postLoad(Drupal\Core\Entity\EntityStorageInterface $storage, array &$entities)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:423
- ⇄⧉public static load($id) {@inheritdoc}\Drupal\Core\Entity\EntityBase::load($id)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:484
- ⇄⧉public static loadMultiple(?array $ids = null) {@inheritdoc}\Drupal\Core\Entity\EntityBase::loadMultiple(?array $ids = null)
/** * {@inheritdoc} */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:494
- ⧉protected static getRevisionMetadataKey(Drupal\Core\Entity\EntityTypeInterface $entity_type, $key): string Gets the name of a revision metadata field.
/** * Gets the name of a revision metadata field. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * A content entity type definition. * @param string $key * The revision metadata key to get, must be one of 'revision_created', * 'revision_user' or 'revision_log_message'. * * @return string * The name of the field for the specified $key. */ Inherited from Drupal\Core\Entity\EditorialContentEntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php:138
- ⧉protected static invalidateTagsOnDelete(Drupal\Core\Entity\EntityTypeInterface $entity_type, array $entities) Invalidates an entity's cache tags upon delete.
/** * Invalidates an entity's cache tags upon delete. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. * @param \Drupal\Core\Entity\EntityInterface[] $entities * An array of entities. */ Inherited from Drupal\Core\Entity\EntityBase Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityBase.php:542
- ⇄⧉public getOwnerId() {@inheritdoc}
- protected static $fieldsToSkipFromTranslationChangesCheck :: array (0)
- ⇄const TRANSLATION_REMOVED :: integer 0\Drupal\node\Entity\Node::TRANSLATION_REMOVED
- ⇄const TRANSLATION_EXISTING :: integer 1\Drupal\node\Entity\Node::TRANSLATION_EXISTING
- ⇄const TRANSLATION_CREATED :: integer 2\Drupal\node\Entity\Node::TRANSLATION_CREATED
- ⇄const NOT_PUBLISHED :: integer 0\Drupal\node\Entity\Node::NOT_PUBLISHED
- ⇄const PUBLISHED :: integer 1\Drupal\node\Entity\Node::PUBLISHED
- ⇄const NOT_PROMOTED :: integer 0\Drupal\node\Entity\Node::NOT_PROMOTED
- ⇄const PROMOTED :: integer 1\Drupal\node\Entity\Node::PROMOTED
- ⇄const NOT_STICKY :: integer 0\Drupal\node\Entity\Node::NOT_STICKY
- ⇄const STICKY :: integer 1\Drupal\node\Entity\Node::STICKY