ensureComputedValue example

protected function ensureComputedValue() {
    if ($this->valueComputed === FALSE) {
      $this->computeValue();
      $this->valueComputed = TRUE;
    }
  }

  /** * {@inheritdoc} */
  public function getValue() {
    $this->ensureComputedValue();
    return parent::getValue();
  }

  /** * {@inheritdoc} */
  public function setValue($values$notify = TRUE) {
    parent::setValue($values$notify);

    // Make sure that subsequent getter calls do not try to compute the values     // again.
Home | Imprint | This part of the site doesn't use cookies.