* Prefix for the controller.
* @var string
*/
- protected $_prefix = "contribute_";
+ protected $_prefix = 'contribute_';
/**
* Explicitly declare the entity api name.
$this->_context
);
$prefix = NULL;
- if ($this->_context == 'user') {
+ if ($this->_context === 'user') {
$prefix = $this->_prefix;
}
* 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) {
$this->fixFormValues();
// We don't show test records in summaries or dashboards
- if (empty($this->_formValues['contribution_test']) && $this->_force && !empty($this->_context) && $this->_context == 'dashboard') {
+ if (empty($this->_formValues['contribution_test']) && $this->_force && !empty($this->_context) && $this->_context === 'dashboard') {
// @todo - stop changing formValues - respect submitted form values, change a working array.
- $this->_formValues["contribution_test"] = 0;
+ $this->_formValues['contribution_test'] = 0;
}
foreach ([
$selector->setKey($this->controller->_key);
$prefix = NULL;
- if ($this->_context == 'basic' || $this->_context == 'user') {
+ if ($this->_context === 'basic' || $this->_context === 'user') {
$prefix = $this->_prefix;
}
$controller->setEmbedded(TRUE);
$query = &$selector->getQuery();
- if ($this->_context == 'user') {
+ if ($this->_context === 'user') {
$query->setSkipPermission(TRUE);
}
* Use values from $_GET if force is set to TRUE.
*
* Note that this means that GET over-rides POST. This was a historical decision & the reasoning is not explained.
+ *
+ * @throws \CRM_Core_Exception
*/
public function fixFormValues() {
if (!$this->_force) {
}
/**
- * @return string
+ * @return \CRM_Contact_BAO_Query
*/
public function &getQuery() {
return $this->_query;
if (($query->_mode & CRM_Contact_BAO_Query::MODE_EVENT) ||
CRM_Contact_BAO_Query::componentPresent($query->_returnProperties, 'participant_')
) {
- $query->_select['participant_id'] = "civicrm_participant.id as participant_id";
+ $query->_select['participant_id'] = 'civicrm_participant.id as participant_id';
$query->_element['participant_id'] = 1;
$query->_tables['civicrm_participant'] = $query->_whereTables['civicrm_participant'] = 1;
//add fee level
if (!empty($query->_returnProperties['participant_fee_level'])) {
- $query->_select['participant_fee_level'] = "civicrm_participant.fee_level as participant_fee_level";
+ $query->_select['participant_fee_level'] = 'civicrm_participant.fee_level as participant_fee_level';
$query->_element['participant_fee_level'] = 1;
}
//add participant contact ID
if (!empty($query->_returnProperties['participant_contact_id'])) {
- $query->_select['participant_contact_id'] = "civicrm_participant.contact_id as participant_contact_id";
+ $query->_select['participant_contact_id'] = 'civicrm_participant.contact_id as participant_contact_id';
$query->_element['participant_contact_id'] = 1;
}
//add fee amount
if (!empty($query->_returnProperties['participant_fee_amount'])) {
- $query->_select['participant_fee_amount'] = "civicrm_participant.fee_amount as participant_fee_amount";
+ $query->_select['participant_fee_amount'] = 'civicrm_participant.fee_amount as participant_fee_amount';
$query->_element['participant_fee_amount'] = 1;
}
$from = NULL;
switch ($name) {
case 'civicrm_participant':
- $from = " LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id ";
+ $from = ' LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id ';
break;
case 'civicrm_event':
//CRM-17121
- $from = " LEFT JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id ";
+ $from = ' LEFT JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id ';
break;
case 'event_type':
$this->_context
);
$prefix = NULL;
- if ($this->_context == 'basic') {
+ if ($this->_context === 'basic') {
$prefix = $this->_prefix;
}
* 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;
}
* 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) {