public FieldConfigInterface::setDefaultValueCallback($callback)
Sets a custom default value callback.
If set, the callback overrides any set default value.
string|null $callback: The callback to invoke for getting the default value (pass NULL to unset a previously set callback). The callback will be invoked with the following arguments:
It should return the default value in the format accepted by the setDefaultValue() method.
$this
public function setDefaultValueCallback($callback);
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Field!FieldConfigInterface.php/function/FieldConfigInterface::setDefaultValueCallback/8.1.x