*/
protected $dataHandler;
+ /**
+ * indicates if the form data has been read via `readData()`
+ * @var boolean
+ */
+ protected $didReadValues = false;
+
/**
* encoding type of this form
* @var null|
);
}
+ /**
+ * @inheritDoc
+ */
+ public function didReadValues() {
+ return $this->didReadValues;
+ }
+
/**
* @inheritDoc
*/
* @inheritDoc
*/
public function getData() {
+ if (!$this->didReadValues()) {
+ throw new \BadMethodCallException("Getting data is only possible after calling 'readValues()'.");
+ }
+
return $this->getDataHandler()->getData($this);
}
$this->requestData = $_POST;
}
+ $this->didReadValues = true;
+
return $this->traitReadValues();
}
*/
public function build();
+ /**
+ * Returns `true` if the form data has been read via `readData()` and `false` otherwise.
+ *
+ * @return boolean
+ */
+ public function didReadValues();
+
/**
* Sets the error message of this form using the given language item and returns this
* document. If `null` is passed, the error message is unset.
* of a database object action.
*
* @return array data passed to database object action
+ *
+ * @throws \BadMethodCallException if the method is called before `readValues()` is called
*/
public function getData();