PrimitiveInterface.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/TypedData/PrimitiveInterface.php
  2. 8.9.x core/lib/Drupal/Core/TypedData/PrimitiveInterface.php
  3. 11.x core/lib/Drupal/Core/TypedData/PrimitiveInterface.php

Namespace

Drupal\Core\TypedData

File

core/lib/Drupal/Core/TypedData/PrimitiveInterface.php

View source
<?php

namespace Drupal\Core\TypedData;


/**
 * Interface for primitive data.
 *
 * @ingroup typed_data
 */
interface PrimitiveInterface {
    
    /**
     * Gets the primitive data value.
     *
     * @return mixed
     */
    public function getValue();
    
    /**
     * Sets the primitive data value.
     *
     * @param mixed|null $value
     *   The value to set in the format as documented for the data type or NULL to
     *   unset the data value.
     */
    public function setValue($value);
    
    /**
     * Gets the primitive data value casted to the correct PHP type.
     *
     * @return mixed
     */
    public function getCastedValue();

}

Interfaces

Title Deprecated Summary
PrimitiveInterface Interface for primitive data.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.