$this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('activity', $this->_contactId);
}
+ /**
+ * Edit tab.
+ *
+ * @return mixed
+ */
public function edit() {
// used for ajax tabs
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
));
}
+ /**
+ * Check is active.
+ *
+ * @param \Civi\Token\TokenProcessor $processor
+ *
+ * @return bool
+ */
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
return
}
}
+ /**
+ * Calculate date from age.
+ *
+ * @param string $asofDate
+ * @param int $age
+ * @param string $type
+ *
+ * @return string
+ */
public static function calcDateFromAge($asofDate, $age, $type) {
$date = new DateTime($asofDate);
if ($type == "min") {
);
}
+ /**
+ * Get alias tokens.
+ *
+ * @return array
+ */
protected function getAliasTokens() {
return array(
'id' => 'contribution_id',
private $errorData = array();
/**
- * @param $message
+ * Class constructor.
+ *
+ * @param string $message
* @param int $error_code
* @param array $errorData
* @param null $previous
}
/**
- * custom string representation of object.
+ * Custom string representation of object.
+ *
* @return string
*/
public function __toString() {
return __CLASS__ . ": [{$this->errorData['error_code']}: {$this->message}\n";
}
+ /**
+ * Get error code.
+ *
+ * @return mixed
+ */
public function getErrorCode() {
return $this->errorData['error_code'];
}
/**
- * Return specific error information that can be used for more detailed
- * error messages or translation.
+ * Return specific error information.
+ *
+ * (Can be used for more detailed error messages or translation.)
*
* This method may be overridden in child exception classes in order
* to add functionality not present in PEAR_Exception and is a placeholder
*/
class CRM_Event_Tokens extends \Civi\Token\AbstractTokenSubscriber {
+ /**
+ * Class constructor.
+ */
public function __construct() {
parent::__construct('event', array(
'event_type' => ts('Event Type'),
));
}
+ /**
+ * Check something about being active.
+ *
+ * @param \Civi\Token\TokenProcessor $processor
+ *
+ * @return bool
+ */
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
return
*/
class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber {
+ /**
+ * Class constructor.
+ */
public function __construct() {
parent::__construct('membership', array(
'fee' => ts('Membership Fee'),
$this->_select = "SELECT " . implode(', ', $select) . " ";
}
+ /**
+ * Generate from clause.
+ *
+ * @param bool|FALSE $durationMode
+ */
public function from($durationMode = FALSE) {
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
}
}
+ /**
+ * Generate where clause.
+ *
+ * @param bool|FALSE $durationMode
+ */
public function where($durationMode = FALSE) {
$optionGroupClause = '';
if (!$durationMode) {
);
public $_drilldownReport = array('contact/detail' => 'Link to Detail Report');
+ /**
+ * Class constructor.
+ */
public function __construct() {
$contact_type = CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, '_');
parent::preProcess();
}
+ /**
+ * Run upgrade.
+ *
+ * @throws \Exception
+ */
public function run() {
// lets get around the time limit issue if possible for upgrades
if (!ini_get('safe_mode')) {
private $isVisible;
/**
+ * Class constructor.
+ *
* @param string $name
* Symbolic name for the check.
* @param string $message
}
/**
+ * Get name.
+ *
* @return string
*/
public function getName() {
}
/**
+ * Get message.
+ *
* @return string
*/
public function getMessage() {
}
/**
+ * Get level.
+ *
* @return string
* @see Psr\Log\LogLevel
*/
}
/**
- * Set optional additional help text
+ * Set optional additional help text.
+ *
* @param string $help
*/
public function addHelp($help) {
}
/**
+ * Convert to array.
+ *
* @return array
*/
public function toArray() {
return $array;
}
+ /**
+ * Getter for is visible.
+ *
+ * @return bool
+ */
public function isVisible() {
return $this->isVisible;
}
+ /**
+ * Seter for is visible.
+ *
+ * @param bool $isVisible
+ */
public function setVisible($isVisible) {
$this->isVisible = $isVisible ? 1 : 0;
}
*/
protected $_xml;
+ /**
+ * Class constructor.
+ */
public function __construct() {
$this->_xml = array(
'customGroup' => array(
protected $_saveMapping;
+ /**
+ * Class constructor.
+ */
public function __construct() {
$this->_lookupCache = array();
$this->_saveMapping = array();
}
/**
- * @param $file
+ * Run import.
+ *
+ * @param string $file
*/
public function run($file) {
$json = file_get_contents($file);
$this->rows = array();
}
+ /**
+ * Get columns.
+ *
+ * @param array $columns
+ *
+ * @return $this
+ * @throws \CRM_Core_Exception
+ */
public function columns($columns) {
if ($this->columns !== NULL) {
throw new CRM_Core_Exception("Column order already specified.");
}
/**
+ * Get rows.
+ *
* @param array $rows
+ *
* @return CRM_Utils_SQL_Insert
*/
public function rows($rows) {
}
/**
+ * Get row.
+ *
* @param array $row
+ *
* @return CRM_Utils_SQL_Insert
* @throws CRM_Core_Exception
*/
* Use REPLACE INTO instead of INSERT INTO.
*
* @param bool $asReplace
+ *
* @return CRM_Utils_SQL_Insert
*/
public function usingReplace($asReplace = TRUE) {
}
/**
+ * Escape string.
+ *
* @param string|NULL $value
+ *
* @return string
* SQL expression, e.g. "it\'s great" (with-quotes) or NULL (without-quotes)
*/
}
/**
+ * Convert to SQL.
+ *
* @return string
* SQL statement
*/
}
/**
- * If we are using a theming system, invoke theme, else just print the
- * content.
+ * If we are using a theming system, invoke theme, else just print the content.
*
* @param string $content
* The content that will be themed.
* Generate a query string if input is an array.
*
* @param array|string $query
+ *
* @return string
*/
public static function makeQueryString($query) {
* @param bool $htmlize
* @param bool $frontend
* @param bool $forceBackend
+ *
* @return string
* An HTML string containing a link to the given path.
*/
}
/**
- * @param $text
- * @param null $path
- * @param null $query
+ * Get href.
+ *
+ * @param string $text
+ * @param string $path
+ * @param string|array $query
* @param bool $absolute
- * @param null $fragment
+ * @param string $fragment
* @param bool $htmlize
* @param bool $frontend
* @param bool $forceBackend
}
/**
+ * Permission denied.
+ *
* @return mixed
*/
public static function permissionDenied() {
}
/**
+ * Log out.
+ *
* @return mixed
*/
public static function logout() {
}
/**
- * this is a very drupal specific function for now.
+ * This is a very drupal specific function for now.
*/
public static function updateCategories() {
$config = CRM_Core_Config::singleton();
}
/**
- * What menu path are we currently on. Called for the primary tpl
+ * What menu path are we currently on. Called for the primary tpl.
*
* @return string
* the current menu path
}
/**
- * called from a template to compose a url.
+ * Called from a template to compose a url.
*
* @param array $params
* List of parameters.
/**
* Figures and sets the userContext.
*
- * Uses the referer if valid else uses the default.
+ * Uses the referrer if valid else uses the default.
*
* @param array $names
* Referrer should match any str in this array.
/**
* Append an additional breadcrumb tag to the existing breadcrumbs.
*
- * @param $breadCrumbs
+ * @param string $breadCrumbs
*/
public static function appendBreadCrumb($breadCrumbs) {
$config = CRM_Core_Config::singleton();
/**
* Determine the post URL for a form.
*
- * @param $action
+ * @param int $action
* The default action if one is pre-specified.
*
* @return string
}
/**
+ * Authenticate key.
+ *
* @param bool $abort
* (optional) Whether to exit; defaults to true.
*
}
/**
+ * Authenticate script.
+ *
* @param bool $abort
- * @param null $name
- * @param null $pass
+ * @param string $name
+ * @param string $pass
* @param bool $storeInSession
* @param bool $loadCMSBootstrap
* @param bool $requireKey
* @param string $password
* The password.
* @param bool $loadCMSBootstrap
- * @param $realPath
+ * @param string $realPath
*
* @return false|array
*/
/**
* Determine whether a value is null-ish.
*
- * @param $value
+ * @param mixed $value
* The value to check for null.
+ *
* @return bool
*/
public static function isNull($value) {
* The credit card number to obscure.
* @param int $keep
* (optional) The number of digits to preserve unmodified.
+ *
* @return string
* The obscured credit card number.
*/
}
/**
- * @param $title
+ * Do something no-one bothered to document.
+ *
+ * @param string $title
* (optional)
*
* @return mixed|string
}
/**
+ * Download something or other.
+ *
* @param string $name
* @param string $mimeType
- * @param $buffer
+ * @param string $buffer
* @param string $ext
* @param bool $output
* @param string $disposition
*
* @param string $url
* The URL to operate on.
+ *
* @return string
* The fixed URL.
*/
* @param string $separator
* @param string $string
* @param int $limit
+ *
* @return string[]
*/
public static function explode($separator, $string, $limit) {
}
/**
+ * Check url.
+ *
* @param string $url
* The URL to check.
* @param bool $addCookie
* @param bool $abort
* (optional) Whether to fatally abort if the version requirement is not
* met. Defaults to TRUE.
+ *
* @return bool
* Returns TRUE if the requirement is met, FALSE if the requirement is not
* met and we're not aborting due to the failed requirement. If $abort is
}
/**
- * @param $string
+ * Format wiki url.
+ *
+ * @param string $string
* @param bool $encode
*
* @return string
}
/**
+ * Encode url.
+ *
* @param string $url
*
* @return null|string
return $config->userSystem->getLoggedInUfID();
}
+ /**
+ * Get Base CMS url.
+ *
+ * @return mixed|string
+ */
public static function baseCMSURL() {
static $_baseURL = NULL;
if (!$_baseURL) {
return $result;
}
+/**
+ * Adjust metadata for cxn unregister.
+ *
+ * @param array $spec
+ */
function _civicrm_api3_cxn_unregister_spec(&$spec) {
$daoFields = CRM_Cxn_DAO_Cxn::fields();
$spec['cxn_guid'] = $daoFields['cxn_guid'];
return $cxnId;
}
+/**
+ * Adjust metadata for cxn get action.
+ *
+ * @param array $spec
+ */
function _civicrm_api3_cxn_get_spec(&$spec) {
// Don't trust AJAX callers or other external code to modify, filter, or return the secret.
unset($spec['secret']);
}
}
+/**
+ * Adjust metadata for clone spec action.
+ *
+ * @param array $spec
+ */
function _civicrm_api3_mailing_clone_spec(&$spec) {
$mailingFields = CRM_Mailing_DAO_Mailing::fields();
$spec['id'] = $mailingFields['id'];
$spec['id']['api.required'] = 1;
}
+/**
+ * Clone mailing.
+ *
+ * @param array $params
+ *
+ * @return array
+ * @throws \CiviCRM_API3_Exception
+ */
function civicrm_api3_mailing_clone($params) {
$BLACKLIST = array(
'id',
);
}
+/**
+ * Get options for settings.
+ *
+ * @param array $params
+ *
+ * @return array
+ * @throws \API_Exception
+ */
function civicrm_api3_setting_getoptions($params) {
$specs = CRM_Core_BAO_Setting::getSettingSpecification();