MissingDataException example

// Notify the parent of any changes.     if ($notify && isset($this->parent)) {
      $this->parent->onChange($this->name);
    }
  }

  /** * {@inheritdoc} */
  public function get($property_name) {
    if (!isset($this->entity)) {
      throw new MissingDataException("Unable to get property $property_name as no entity has been provided.");
    }
    if (!$this->entity instanceof FieldableEntityInterface) {
      throw new \InvalidArgumentException("Unable to get unknown property $property_name.");
    }
    // This will throw an exception for unknown fields.     return $this->entity->get($property_name);
  }

  /** * {@inheritdoc} */
  

  protected $typedConfigManager;

  /** * {@inheritdoc} */
  public function get($property_name) {
    if (!isset($this->entity)) {
      throw new MissingDataException("Unable to get property $property_name as no entity has been provided.");
    }
    return $this->getConfigTypedData()->get($property_name);
  }

  /** * {@inheritdoc} */
  public function set($property_name$value$notify = TRUE) {
    if (!isset($this->entity)) {
      throw new MissingDataException("Unable to set property $property_name as no entity has been provided.");
    }
    
Home | Imprint | This part of the site doesn't use cookies.