$this->_context
);
$prefix = NULL;
- if ($this->_context == 'basic') {
+ if ($this->_context === 'basic') {
$prefix = $this->_prefix;
}
return ts('Member Contact Type');
}
+ /**
+ * Set defaults.
+ *
+ * @return array
+ * @throws \Exception
+ */
+ public function setDefaultValues() {
+ $this->_defaults = parent::setDefaultValues();
+ //LCD also allow restrictions to membership owner via GET
+ $owner = CRM_Utils_Request::retrieve('owner', 'String');
+ if (in_array($owner, ['0', '1'])) {
+ $this->_defaults['member_is_primary'] = $owner;
+ }
+ return $this->_defaults;
+ }
+
/**
* The post processing of the form gets done here.
*
* done.
* The processing consists of using a Selector / Controller framework for getting the
* search results.
+ *
+ * @throws \CRM_Core_Exception
*/
public function postProcess() {
if ($this->_done) {
$selector->setKey($this->controller->_key);
$prefix = NULL;
- if ($this->_context == 'basic') {
+ if ($this->_context === 'basic') {
$prefix = $this->_prefix;
}
$prefix
);
$controller->setEmbedded(TRUE);
-
- $query = &$selector->getQuery();
$controller->run();
}
* If this search has been forced then see if there are any get values, and if so over-ride the post values.
*
* Note that this means that GET over-rides POST :) & that force with no parameters can be very destructive.
+ *
+ * @throws \CRM_Core_Exception
*/
public function fixFormValues() {
if (!$this->_force) {
return;
}
- $status = CRM_Utils_Request::retrieve('status', 'String');
+ // @todo Most of the below is likely no longer required.
+ $status = CRM_Utils_Request::retrieve('membership_status_id', 'String');
if ($status) {
$status = explode(',', $status);
$this->_formValues['membership_status_id'] = $this->_defaults['membership_status_id'] = (array) $status;
$this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive',
$this
);
-
- //LCD also allow restrictions to membership owner via GET
- $owner = CRM_Utils_Request::retrieve('owner', 'String');
- if (in_array($owner, ['0', '1'])) {
- $this->_formValues['member_is_primary'] = $this->_defaults['member_is_primary'] = $owner;
- }
}
/**