$this->loadStandardSearchOptionsFromUrl();
- // get user submitted values
- // get it from controller only if form has been submitted, else preProcess has set this
- if (!empty($_POST)) {
- $this->_formValues = $this->controller->exportValues($this->_name);
- }
- else {
- $this->_formValues = $this->get('formValues');
- }
+ $this->_formValues = $this->getFormValues();
//membership ID
$memberShipId = CRM_Utils_Request::retrieve('memberId', 'Positive', $this);
*
* @return array|NULL
* reference to the array of default values
- * @throws \Exception
+ * @throws \CRM_Core_Exception
*/
public function setDefaultValues() {
$defaults = (array) $this->_formValues;
* @throws \Exception
*/
protected function setFormValues() {
- if (!empty($_POST) && !$this->_force) {
- $this->_formValues = $this->controller->exportValues($this->_name);
- }
- elseif ($this->_force) {
- $this->_formValues = $this->setDefaultValues();
- }
+ $this->_formValues = $this->getFormValues();
$this->convertTextStringsToUseLikeOperator();
}
}
}
+ /**
+ * Get the form values.
+ *
+ * @todo consolidate with loadFormValues()
+ *
+ * @return array
+ *
+ * @throws \CRM_Core_Exception
+ */
+ protected function getFormValues() {
+ if (!empty($_POST) && !$this->_force) {
+ return $this->controller->exportValues($this->_name);
+ }
+ if ($this->_force) {
+ return $this->setDefaultValues();
+ }
+ return (array) $this->get('formValues');
+ }
+
}