You are here

public function WebformElementBase::getDefaultProperty in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::getDefaultProperty()

Get an element's default property value.

Parameters

string $property_name: An element's property name.

Return value

mixed An element's default property value or NULL if default property does not exist.

Overrides WebformElementInterface::getDefaultProperty

13 calls to WebformElementBase::getDefaultProperty()
Date::getItemFormat in src/Plugin/WebformElement/Date.php
Get element's single value format name by looking for '#format' property, global settings, and finally default settings.
Date::prepare in src/Plugin/WebformElement/Date.php
Prepare an element to be rendered within a webform.
DateTime::prepare in src/Plugin/WebformElement/DateTime.php
Prepare an element to be rendered within a webform.
NumericBase::prepare in src/Plugin/WebformElement/NumericBase.php
Prepare an element to be rendered within a webform.
OptionsBase::prepare in src/Plugin/WebformElement/OptionsBase.php
Prepare an element to be rendered within a webform.

... See full list

File

src/Plugin/WebformElementBase.php, line 425

Class

WebformElementBase
Provides a base class for a webform element.

Namespace

Drupal\webform\Plugin

Code

public function getDefaultProperty($property_name) {
  $default_properties = $this
    ->getDefaultProperties();
  return array_key_exists($property_name, $default_properties) ? $default_properties[$property_name] : NULL;
}