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 (24)
- ⧉nid => array (1)
- x-default => string (3) "516"
- ⧉vid => array (1)
- x-default => string (3) "517"
- ⧉type => array (1)
- x-default => string (10) "staticpage"
- ⧉uuid => array (1)
- x-default => string (36) "213f89d3-5e24-466b-9f12-7461d86644a4"
- ⧉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) "1723277840"
2024-08-10 08:17:20 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 (72) "Robotický LEGO seminář pro středoškolské učitele 4.10 - 5.10.2024"
- ⧉created => array (1)
- ⧉x-default => string (10) "1723277840"
2024-08-10 08:17:20 UTC
- ⧉changed => array (1)
- ⧉x-default => string (10) "1727903998"
2024-10-02 21:19:58 UTC
- ⧉promote => array (1)
- x-default => string (1) "1"
- ⧉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 (3) "und"
- ⧉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 (8694) "<p>Robotický LEGO seminář je určen pro středoškolské učitele, kteří by se ch...
<p>Robotický LEGO seminář je určen pro středoškolské učitele, kteří by se chtěli seznámit nebo zdokonalit v používání stavebnic LEGO® MINDSTORMS® Education NXT a LEGO® MINDSTORMS® Education EV3 a bude zaměřen především na praktické použití těchto stavebnic. Středoškolští učitelé si budou moct vyzkoušet i novou kostku <a href="https://robosoutez.fel.cvut.cz/kostka-brian">Brian</a>. Ostatní zájemci se budou moci přihlásit v případě nenaplnění kapacity z řad středoškolských učitelů. Seminář se bude konat 4.10.- 5.10.2024 v místnosti KN:E-s109 na Karlově náměstí 13 na Fakultě Elektrotechnické, ČVUT v Praze. Účast na semináři je zdarma (dopravu eventuelně ubytování a další náklady spojené se seminářem si hradí a zajišťují sami účastníci). V průběhu semináře bude pro všechny účastníky zajištěno občerstvení.</p><p>V průběhu semináře Vám zapůjčíme základní sestavu LEGO® MINDSTORMS® Education EV3 (Core set 45544), sestavu technických dílů (Expansion set 45560), síťový adaptér nebo základní sestavu LEGO® MINDSTORMS® Education NXT (9797), sestavu technických dílů (9648 nebo 9695 - doplňkové pasivní díly), síťový adaptér (9833 nebo 8887) a jednoosý gyroskopický senzor (1044 NXT Gyroskop) nebo novou kostku <a href="https://robosoutez.fel.cvut.cz/kostka-brian">Brian</a> (náhrada za starší kostky LEGO Mindstorms EV3 a LEGO Mindstorms NXT, které se již nevyrábí a nejsou podporované firmou LEGO).</p><p>Robotický LEGO seminář se uskuteční při minimálním počtu 10 účastníků. Maximální počet účastníků je 36.</p><p>Přihlásit se na "Robotický LEGO seminář" je možné pomocí <a href="http://media.uceeb.cvut.cz/seminar/" target="_blank">přihlašovacího formuláře</a>. Odesláním přihlašovacího formuláře se uzavírá smluvní vztah mezi pořadatelem (FEL ČVUT v Praze) a účastníkem semináře. V rámci naplnění tohoto smluvního vztahu je nutné zpracování osobních údajů účastníka v rozsahu který je nutný pro naplění tohoto smluvního vztahu (Jméno, příjmení, škola - pro rezervaci místa na semináři, popř. rezervaci ubytování).</p><p>Na požádání bude možné zajistit parkování na zadním dvoře na Karlově náměstí (vjezd z ulice na Zbořenci). E-mailem v tom případě prosím poslat následující informace: </p><ul><li>Jméno a příjmení </li><li>SPZ auta </li><li>Požadavek na parkování (pátek nebo sobota nebo oba dva dny)</li></ul><p><strong>Časový harmonogram robotického LEGO semináře (předběžný časový harmonogram - může ještě dojít k jeho úpravě):</strong></p><p><strong>Pátek 4.10.2024 (místnost KN:E-s109 na Karlově náměstí 13 na Fakultě Elektrotechnické, ČVUT v Praze)</strong></p><p>13:00 Oficiální zahájení „ROBOTICKÉHO LEGO SEMINÁŘE“</p><p>13:05 - 14:05 Programování LEGO MINDSTORMS EV3 s využitím Simulinku (Jaroslav Jirkovský, <a href="http://www.humusoft.cz/" target="_blank">Humusoft</a>)</p><p> Video "Programovanie LEGO MINDSTORMS EV3 s využitím Simulinku" - <a class="moz-txt-link-freetext" href="https://www.mathworks.com/videos/lego-mindstorms-ev3-programming-using-simulink-119175.html" target="_blank">https://www.mathworks.com/videos/lego-mindstorms-ev3-programming-using-simulink-119175.html</a></p><p> Odkaz na webovou stránku MathWorks, kde jsou informace o soutěži a možnost stáhnout Matlab pro potřeby ROBOSOUTĚŽE - <a class="moz-txt-link-freetext" href="https://www.mathworks.com/academia/student-competitions/roborace.html" target="_blank">https://www.mathworks.com/academia/student-competitions/roborace.html</a></p><p> Pokud by jste si chtěli vyzkoušet práci s Matlabem v průběhu semináře na svém počítači, nainstalujte si Matlab před vlastním seminářem. V případě problémů s instalací napište prosím na support@humusoft.cz</p><p>14:05 - 14:35 Prezentace – seznámení s LEGO Mindstorms Education EV3 (hardwarem a softwarem, David Pařil), seznámení a předvedení nové kostky Brian a seznámení s úlohou "Popelář", která bude zadáním v ROBOSOUTĚŽI pro středoškolské týmy (Martin Hlinovský).</p><p>14:35 - 14:50 Přestávka</p><p>14:50 - 18:30 Rozdělení do týmů, převzetí výukových LEGO setů. Řešení úlohy "Popelář", která bude zadáním v ROBOSOUTĚŽI pro středoškolské týmy (programování v libovolném programovacím jazyce).</p><p>18:30 - 20:00 Společné posezení s diskusí a malé občerstvení formou rautu v prostorách fakulty.</p><p><strong>Sobota 5.10.2024 (místnost KN:E-s109 na Karlově náměstí 13 na Fakultě Elektrotechnické, ČVUT v Praze)</strong></p><p>9:00 - 10:00 Programování Lego Mindstorms EV3 v programovacím jazyce Python (Jan Hlaváč, <a href="https://education.lego.com/en-us/support/mindstorms-ev3/python-for-ev3" target="_blank">https://education.lego.com/en-us/support/mindstorms-ev3/python-for-ev3</a>). Porovnání LEGO Mindstorms EV3 a LEGO SPIKE PRIME Education. Jaké jsou vhodné stavebnice pro výuku na středních školách? Diskuse nad současnou situací. Představení kostky Brian, nových senzorů a motorů a možnost jejich vyzkoušení v průběhu semináře.</p><p>10:00 – 12:30 Řešení úlohy "Popelář", která bude zadáním v ROBOSOUTĚŽI pro středoškolské týmy.</p><p>12:30 – 13:30 Oběd pro všechny účastníky semináře v prostorách fakulty</p><p>13:30 – 15:00 Řešení úlohy "Popelář", která bude zadáním v ROBOSOUTĚŽI pro středoškolské týmy.</p><p>15:00 – 15:30 Soutěž a vyhodnocení úlohy "Popelář", která bude zadáním v ROBOSOUTĚŽI pro středoškolské týmy</p><p>15:30 – 15:40 Ukončení „ROBOTICKÉHO LEGO SEMINÁŘE PRO STŘEDOŠKOLSKÉ UČITELE“</p><p><strong>Přihlášení účastníci:</strong></p><p>1. Ing. Šárka Blechová, Ph.D. - VOŠ a SPŠE Plzeň, Koterovská 85, 326 00 Plzeň</p><p>2. Pavlína Horáčková - Gymnázium Zábřeh, Nám. Osvobození 20, 78901 Zábřeh</p><p>3. Vladimír Beránek - SPŠ Trutnov, Školní 101, 54101 Trutnov</p><p>4. Jaroslav Kořínek - Smíchovská střední průmyslová škola a gymnázium, Preslova 72/25, 15021 Praha 5 - Smíchov</p><p>5. Bc. Ondřej Kohut - Gymnázium Písnická, Písnická 760, 142 00 Praha 4</p><p>6. Martin Magnus Fiala - COPaG, Poděbradská 179/1, 190 00 Praha 9</p><p>7. Pavel Linhart - Gymnázium Písnická, Písnická 760, 142 00 Praha 4</p><p>8. Martin Filipský - Gymnázium Arabská, Arabská 14, 160 00 Praha 6</p><p>9. Mgr. Roman Hronek - Gymnázium Benešov, Husova 470, 256 01 Benešov</p><p>10. RNDr. Kateřina Herynková, Ph.D. - Gymnázium Jana Keplera, Parléřova 2/118, 169 00 Praha 6 – Hradčany</p><p>11. Ing. Bedřich Štěpánek - Nový PORG, Pod Krčským lesem 25, 142 00 Praha 4</p><p>12. Mgr. Jiří Šperl - Gymnázium Christiana Dopplera, Zborovská 621/45, 150 00 Praha 5</p><p>13. Mgr. Anna Yaghobová - Gymnázium Christiana Dopplera, Zborovská 621/45, 150 00 Praha 5</p><p>14. Martin Štibingr - Masarykovo klasické gymnázium, Táborská 1685, 251 01 Říčany</p><p>15. Ing. Inessa Skleničková - ISŠT Benešov, Černolezská 199, 258 01 Benešov</p><p>16. Ing. Petr Hellebrand - SPŠEaG V Úžlabině, V Úžlabině 320, 100 00 Praha 10</p><p>17. Ing. Lea Drdková - VOŠ a SPŠ strojní, stavební a dopravní Děčín, Čsl. armády 681/10, 405 02 Děčín</p><p>18. Hanka Šandová - Městská knihovna Polička, Palackého nám. 64, 572 01 Polička</p><p>19. Ing. Peter Podoba - SOŠ a SOU Kladno, Dubská 967, 272 03 Kladno </p><p>20. Milan Vodička - Gymnázium Kladno, Náměstí E.Beneše 1573, 272 01 Kladno</p><p>21. Mgr. Jan Dümont - Gymnázium Lovosice, Sady pionýrů 600/6, 410 02 Lovosice</p><p>22. Ing. Jaroslav Beran - Střední průmyslová škola Trutnov, Školní 101, 541 01 Trutnov</p><p>23. Mgr. Šárka Voráčová, Ph.D. - FD ČVUT, Na Florenci 25, 272 01 Praha</p><p>24. Matěj Kaňuk - SOU Ohradní, Ohradní 126/57, 140 00 Praha 4</p><p>25. Mgr. Jitka Rohelová - Střední průmyslová škola Vlašim, Komenského 41, 258 01 Vlašim</p><p>26.</p><p>27.</p><p>28.</p><p>29.</p><p>30.</p><p>31.</p><p>32.</p><p>33.</p><p>34.</p><p>35.</p><p>36.</p>
- format => string (10) "basic_html"
- ⧉field_perex => array (1)
- ⧉x-default => array (1)
- ⧉0 => array (1)
- ⧉value => UTF-8 string (170) "Seminář pro středoškolské učitele se koná 4.10. - 5.10.2024 a je zaměřen pře...
Seminář pro středoškolské učitele se koná 4.10. - 5.10.2024 a je zaměřen především na praktické použití stavebnice LEGO Education Mindstorms EV3 ve výuce.
- ⧉field_teaser_image => array (1)
- ⧉x-default => array (1)
- ⧉0 => array (1)
- target_id => string (4) "1749"
- 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