const END_URL = 'civicrm/admin/extensions';
const END_PARAMS = 'reset=1';
+ /**
+ * Run Page.
+ */
public function run() {
$queue = CRM_Extension_Upgrades::createQueue();
$runner = new CRM_Queue_Runner(array(
* @param string $paymentType
* 'owed' for purpose of recording partial payments, 'refund' for purpose of recording refund payments.
* @param int $participantId
+ * @param bool $updateStatus
*
* @return null|object
*/
/**
* Compute the stats values
*
- * @param $stat either 'mode' or 'median'
- * @param $sql
- * @param $alias of civicrm_contribution
+ * @param string $stat either 'mode' or 'median'
+ * @param string $sql
+ * @param string $alias of civicrm_contribution
+ *
+ * @return array|null
*/
public static function computeStats($stat, $sql, $alias = NULL) {
$mode = $median = array();
return $median;
default:
- return;
+ return NULL;
}
}
* Duplication of param needs review. Only used by AuthorizeNetIPN
* @param int $isFirstOrLastRecurringPayment
* Deprecated param only used by AuthorizeNetIPN.
+ *
+ * @return array
*/
public static function completeOrder(&$input, &$ids, $objects, $transaction, $recur, $contribution, $isRecurring, $isFirstOrLastRecurringPayment) {
$primaryContributionID = isset($contribution->id) ? $contribution->id : $objects['first_contribution']->id;
}
/**
- * Function to check line items
+ * Function to check line items.
*
* @param array $params
* array of order params.
*
+ * @throws \API_Exception
*/
public static function checkLineItems(&$params) {
$totalAmount = CRM_Utils_Array::value('total_amount', $params);
/**
* Create array of last financial item id's.
*
- * @param array $contributionId
+ * @param int $contributionId
*
+ * @return array
*/
public static function getLastFinancialItemIds($contributionId) {
$sql = "SELECT fi.id, li.price_field_value_id, li.tax_amount, fi.financial_account_id
/**
* Sets contribution Ids for unit test.
+ *
+ * @param array $contributionIds
*/
public function setContributionIds($contributionIds) {
$this->_contributionIds = $contributionIds;
/**
* Process the form with submitted params.
+ *
* Also supports unit test.
+ *
+ * @param CRM_Core_Form $form
+ * @param array $params
+ *
+ * @throws \Exception
*/
public static function processForm($form, $params) {
$statusID = CRM_Utils_Array::value('contribution_status_id', $params);
parent::__construct('contribution', $tokens);
}
+ /**
+ * Check if the token processor is active.
+ *
+ * @param \Civi\Token\TokenProcessor $processor
+ *
+ * @return bool
+ */
public function checkActive(\Civi\Token\TokenProcessor $processor) {
return
!empty($processor->context['actionMapping'])
&& $processor->context['actionMapping']->getEntity() === 'civicrm_contribution';
}
+ /**
+ * Alter action schedule query.
+ *
+ * @param \Civi\ActionSchedule\Event\MailingQueryEvent $e
+ */
public function alterActionScheduleQuery(\Civi\ActionSchedule\Event\MailingQueryEvent $e) {
if ($e->mapping->getEntity() !== 'civicrm_contribution') {
return;
return $importableFields;
}
+ /**
+ * Get the fields relating to locations.
+ *
+ * @return array
+ */
public static function getLocationFields() {
static $locationFields = array(
'street_address',
*/
private $raw;
+ /**
+ * CRM_Core_CodeGen_DAO constructor.
+ *
+ * @param \CRM_Core_CodeGen_Main $config
+ * @param string $name
+ */
public function __construct($config, $name) {
parent::__construct($config);
$this->name = $name;
*
* @package CRM
* @author Michael Morris and Gene Chi @ Phase2 Technology <mmorris@phase2technology.com>
- * $Id$
- *
*/
require_once 'PayJunction/pjClasses.php';
+/**
+ * Class CRM_Core_Payment_PayJunction.
+ */
class CRM_Core_Payment_PayJunction extends CRM_Core_Payment {
# (not used, implicit in the API, might need to convert?)
const CHARSET = 'UFT-8';
return $where;
}
+ /**
+ * Update the statistics for the merge set.
+ *
+ * @param string $cacheKeyString
+ * @param array $result
+ */
public static function updateMergeStats($cacheKeyString, $result = array()) {
// gather latest stats
$merged = count($result['merged']);
CRM_Core_BAO_PrevNextCache::deleteItem(NULL, "{$cacheKeyString}_stats");
}
+ /**
+ * Get merge outcome statistics.
+ *
+ * @param string $cacheKeyString
+ *
+ * @return array
+ * Array of how many were merged and how many were skipped.
+ */
public static function getMergeStats($cacheKeyString) {
$stats = CRM_Core_BAO_PrevNextCache::retrieve("{$cacheKeyString}_stats");
if (!empty($stats)) {
return $stats;
}
+ /**
+ * Get merge statistics message.
+ *
+ * @param string $cacheKeyString
+ *
+ * @return string
+ */
public static function getMergeStatsMsg($cacheKeyString) {
$msg = '';
$stats = CRM_Dedupe_Merger::getMergeStats($cacheKeyString);
return NULL;
}
+ /**
+ * Get the title for the mailing event type.
+ *
+ * @return string
+ */
public function eventToTitle() {
static $events = NULL;
return $events[$this->_event_type];
}
+ /**
+ * Get the title of the event.
+ *
+ * @return string
+ */
public function getTitle() {
return $this->eventToTitle();
}
}
}
+ /**
+ * Group the fields.
+ *
+ * @param bool $includeSelectCol
+ */
public function groupBy($includeSelectCol = TRUE) {
$this->_groupBy = array();
if (!empty($this->_params['group_bys']) &&
return TRUE;
}
+ /**
+ * Add mailing template type.
+ *
+ * @return bool
+ */
public static function addMailingTemplateType() {
if (!CRM_Core_DAO::checkFieldExists('civicrm_mailing', 'template_type', FALSE)) {
CRM_Core_DAO::executeQuery('
return $array;
}
+ /**
+ * Build tree of elements.
+ *
+ * @param array $elements
+ * @param int|null $parentId
+ *
+ * @return array
+ */
public static function buildTree($elements, $parentId = NULL) {
$branch = array();
return $branch;
}
+ /**
+ * Find search string in tree.
+ *
+ * @param string $search
+ * @param array $tree
+ * @param string $field
+ *
+ * @return array|null
+ */
public static function findInTree($search, $tree, $field = 'id') {
foreach ($tree as $item) {
if ($item[$field] == $search) {
return $sql;
}
+ /**
+ * Has an offset been set.
+ *
+ * @param string $offset
+ *
+ * @return bool
+ */
public function offsetExists($offset) {
return isset($this->params[$offset]);
}
throw new CRM_Core_Exception("Not implemented: {$className}->getUfId");
}
+ /**
+ * Set the localisation from the user framework.
+ *
+ * @param string $civicrm_language
+ *
+ * @return bool
+ */
public function setUFLocale($civicrm_language) {
return TRUE;
}
return user_load($userID);
}
+ /**
+ * Parse the name of the drupal site.
+ *
+ * @param string $civicrm_root
+ *
+ * @return null|string
+ */
public function parseDrupalSiteName($civicrm_root) {
$siteName = NULL;
if (strpos($civicrm_root,