"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/lib/Drupal/Core/TypedData/PrimitiveBase.php" (26 Nov 2020, 588 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "PrimitiveBase.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 namespace Drupal\Core\TypedData;
    4 
    5 /**
    6  * Base class for primitive data types.
    7  */
    8 abstract class PrimitiveBase extends TypedData implements PrimitiveInterface {
    9 
   10   /**
   11    * The data value.
   12    *
   13    * @var mixed
   14    */
   15   protected $value;
   16 
   17   /**
   18    * {@inheritdoc}
   19    */
   20   public function getValue() {
   21     return $this->value;
   22   }
   23 
   24   /**
   25    * {@inheritdoc}
   26    */
   27   public function setValue($value, $notify = TRUE) {
   28     $this->value = $value;
   29     // Notify the parent of any changes.
   30     if ($notify && isset($this->parent)) {
   31       $this->parent->onChange($this->name);
   32     }
   33   }
   34 
   35 }