You are here

public function BinaryData::getValue in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/TypedData/Plugin/DataType/BinaryData.php \Drupal\Core\TypedData\Plugin\DataType\BinaryData::getValue()

Gets the data value.

Return value

mixed The data value.

Overrides PrimitiveBase::getValue

2 calls to BinaryData::getValue()
BinaryData::getCastedValue in core/lib/Drupal/Core/TypedData/Plugin/DataType/BinaryData.php
Gets the primitive data value casted to the correct PHP type.
BinaryData::getString in core/lib/Drupal/Core/TypedData/Plugin/DataType/BinaryData.php
Returns a string representation of the data.

File

core/lib/Drupal/Core/TypedData/Plugin/DataType/BinaryData.php, line 39

Class

BinaryData
The binary data type.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function getValue() {

  // If the value has been set by (absolute) stream resource URI, access the
  // resource now.
  if (!isset($this->handle) && isset($this->uri)) {
    $this->handle = is_readable($this->uri) ? fopen($this->uri, 'rb') : FALSE;
  }
  return $this->handle;
}