* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Event_BAO_ManageEvent
+ * @return CRM_Event_DAO_Event
*/
public static function retrieve(&$params, &$defaults) {
$event = new CRM_Event_DAO_Event();
* @param array $params
* Reference array contains the values submitted by the form.
*
- *
- * @return object
+ * @return CRM_Event_DAO_Event
*/
public static function add(&$params) {
CRM_Utils_System::flushCache();
* Location block id to be deleted.
* @param int $eventId
* Event with which loc block is associated.
- *
*/
public static function deleteEventLocBlock($locBlockId, $eventId = NULL) {
$query = "SELECT count(ce.id) FROM civicrm_event ce WHERE ce.loc_block_id = $locBlockId";
* @param bool $role consider counted( is filter role) participant.
* Consider counted( is filter role) participant.
*
- *
* @return array
* array with count of participants for each event based on status/role
*/
*
* @param int $id
*
- * @return
+ * @return bool
*/
public static function isMonetary($id) {
static $isMonetary = array();
}
/**
- * Add the custom fields OR array of participant's
- * profile info
+ * Add the custom fields OR array of participant's profile info.
*
* @param int $id
* @param string $name
* @param int $cid
- * @param $template
+ * @param string $template
* @param int $participantId
- * @param $isTest
+ * @param bool $isTest
* @param bool $isCustomProfile
* @param array $participantParams
+ *
+ * @return array|null
*/
public static function buildCustomDisplay(
$id,
}
/**
- * Build the array for Additional participant's information array of priamry and additional Ids
+ * Build the array for Additional participant's information array of primary and additional Ids.
*
* @param int $participantId
* Id of Primary participant.
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Logging_Schema {
private $logs = array();
);
/**
- * (Setting Callback - Validate)
+ * Setting Callback - Validate.
*
* @param mixed $value
* @param array $fieldSpec
+ *
* @return bool
* @throws API_Exception
*/
}
/**
- * (Setting Callback - On Change)
+ * Setting Callback - On Change.
+ *
* Respond to changes in the "logging" setting. Set up or destroy
* triggers, etal.
*
$this->tables = preg_grep('/_cache$/', $this->tables, PREG_GREP_INVERT);
$this->tables = preg_grep('/_log/', $this->tables, PREG_GREP_INVERT);
$this->tables = preg_grep('/^civicrm_queue_/', $this->tables, PREG_GREP_INVERT);
- $this->tables = preg_grep('/^civicrm_menu/', $this->tables, PREG_GREP_INVERT); //CRM-14672
+ //CRM-14672
+ $this->tables = preg_grep('/^civicrm_menu/', $this->tables, PREG_GREP_INVERT);
$this->tables = preg_grep('/_temp_/', $this->tables, PREG_GREP_INVERT);
// do not log civicrm_mailing_event* tables, CRM-12300
}
/**
- * Enable sitewide logging.
- *
- * @return void
+ * Enable site-wide logging.
*/
public function enableLogging() {
$this->fixSchemaDifferences(TRUE);
* Sync log tables and rebuild triggers.
*
* @param bool $enableLogging : Ensure logging is enabled
- *
- * @return void
*/
public function fixSchemaDifferences($enableLogging = FALSE) {
$config = CRM_Core_Config::singleton();
* @param bool $rebuildTrigger
* should we rebuild the triggers.
*
- * @return void
+ * @return bool
*/
public function fixSchemaDifferencesFor($table, $cols = array(), $rebuildTrigger = FALSE) {
if (empty($table)) {
}
/**
- * @param $table
+ * Get query table.
+ *
+ * @param string $table
*
* @return array
*/
}
/**
- * @param $col
- * @param $createQuery
+ * Get column query.
+ *
+ * @param string $col
+ * @param bool $createQuery
*
* @return array|mixed|string
*/
}
/**
+ * Fix schema differences.
+ *
* @param bool $rebuildTrigger
*/
public function fixSchemaDifferencesForAll($rebuildTrigger = FALSE) {
}
/**
+ * Fix timestamp.
+ *
* Log_civicrm_contact.modified_date for example would always be copied from civicrm_contact.modified_date,
* so there's no need for a default timestamp and therefore we remove such default timestamps
* also eliminate the NOT NULL constraint, since we always copy and schema can change down the road)
*
- * @param $query
+ * @param string $query
*
* @return mixed
*/
return $query;
}
+ /**
+ * Add reports.
+ */
private function addReports() {
$titles = array(
'logging/contact/detail' => ts('Logging Details'),
/**
* Get an array of column names of the given table.
*
- * @param string$table
+ * @param string $table
* @param bool $force
*
* @return array
}
/**
- * @param $civiTable
- * @param $logTable
+ * Get columns that have changed.
+ *
+ * @param string $civiTable
+ * @param string $logTable
*
* @return array
*/
$this->logs[$table] = "log_$table";
}
+ /**
+ * Delete reports.
+ */
private function deleteReports() {
// disable logging templates
CRM_Core_DAO::executeQuery("
}
/**
- * @param $info
+ * Get trigger info.
+ *
+ * @param array $info
* @param null $tableName
* @param bool $force
*/
}
/**
+ * Disable logging temporarily.
+ *
* This allow logging to be temporarily disabled for certain cases
* where we want to do a mass cleanup but dont want to bother with
* an audit trail
- *
*/
public static function disableLoggingForThisConnection() {
// do this only if logging is enabled
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
* This class is used to retrieve and display a range of
* contacts that match the given criteria (specifically for
* results of advanced search options.
- *
*/
class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_Core_Selector_API {
/**
* This method returns the links that are given for each search row.
- * currently the links added for each row are
+ *
+ * Currently the links added for each row are
*
* - View
* - Edit
*
* @param string $status
- * @param null $isPaymentProcessor
+ * @param bool $isPaymentProcessor
* @param null $accessContribution
* @param null $qfKey
* @param null $context
/**
* Getter for array of the parameters required for creating pager.
*
- * @param $action
+ * @param int $action
* @param array $params
*/
public function getPagerParams($action, &$params) {
/**
* Returns total number of rows for the query.
*
- * @param int $action.
+ * @param int $action
*
* @return int
* Total number of rows
}
/**
- * Returns the column headers as an array of tuples:
+ * Returns the column headers as an array of tuples.
+ *
* (name, sortName (key to the sort array))
*
* @param string $action
}
/**
+ * Alphabet query.
+ *
* @return mixed
*/
public function alphabetQuery() {
}
/**
+ * Get query.
+ *
* @return string
*/
public function &getQuery() {
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
* This class generates form components
* for previewing Civicrm Profile Group
- *
*/
class CRM_UF_Form_Inline_Preview extends CRM_UF_Form_AbstractPreview {
* Pre processing work done here.
*
* gets session variables for group or field id
- *
- * @param
- *
- * @return void
*/
public function preProcess() {
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
require_once 'api/Wrapper.php';
/**
- * Class CRM_Utils_API_AbstractFieldCoder
+ * Class CRM_Utils_API_AbstractFieldCoder.
*/
abstract class CRM_Utils_API_AbstractFieldCoder implements API_Wrapper {
/**
- * @return array<string> list of field names
+ * Get skipped fields.
+ *
+ * @return array<string>
+ * List of field names
*/
public function getSkipFields() {
return NULL;
}
/**
+ * Is field skipped.
+ *
* @param string $fldName
* @return bool
* TRUE if encoding should be skipped for this field
}
/**
- * going to filter the
- * submitted values.
+ * Going to filter the submitted values.
*
* @param array|string $values the field value from the API
*/
public abstract function encodeInput(&$values);
/**
- * @param $values
+ * Decode output.
+ *
+ * @param string $values
*
* @return mixed
*/
}
/**
- * @return array<string> list of field names
+ * Get skipped fields.
+ *
+ * @return array<string>
+ * list of field names
*/
public function getSkipFields() {
if ($this->skipFields === NULL) {
private static $_singleton = NULL;
/**
+ * Singleton function.
+ *
* @return CRM_Utils_API_MatchOption
*/
public static function singleton() {
}
/**
- * Use a unit-testing mock object to handle hook invocations
+ * Use a unit-testing mock object to handle hook invocations.
+ *
* e.g. hook_civicrm_foo === $mockObject->foo()
+ *
* @param object $mockObject
*/
public function setMock($mockObject) {
/**
* Build the list of plugins ("modules" in CiviCRM terminology) to be processed for hooks.
+ *
* We need to do this to preserve the CiviCRM hook signatures for hooks that require
* a return value, since the WordPress Plugin API seems to be incompatible with them.
*
}
/**
+ * Merge something or other.
+ *
* @param CRM_Utils_SQL_Select $other
* @param array|NULL $parts
* ex: 'joins', 'wheres'
}
/**
- * Gives the first two parts of the version string E.g. 6.1
+ * Gives the first two parts of the version string E.g. 6.1.
*
* @return string
*/
*
* @param string $version
* Version string to be checked.
+ *
* @return bool
*/
public static function isVersionFormatValid($version) {
return $headers;
}
+ /**
+ * Get request headers.
+ *
+ * @return array|false
+ */
public static function getRequestHeaders() {
if (function_exists('apache_request_headers')) {
return apache_request_headers();
strtolower($_SERVER['HTTPS']) != 'off') ? TRUE : FALSE;
}
+ /**
+ * Redirect to SSL.
+ *
+ * @param bool|FALSE $abort
+ *
+ * @throws \Exception
+ */
public static function redirectToSSL($abort = FALSE) {
$config = CRM_Core_Config::singleton();
$req_headers = self::getRequestHeaders();
* @param bool $loadUser
* Boolean load user or not.
* @param bool $throwError
- * @param $realPath
+ * @param string $realPath
*/
public static function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) {
if (!is_array($params)) {
* Given a URL, return a relative URL if possible.
*
* @param string $url
+ *
* @return string
*/
public static function relativeURL($url) {
}
/**
- * Clean url, replaces first '&' with '?'
+ * Clean url, replaces first '&' with '?'.
*
* @param string $url
*
}
/**
- * Append the contents of an 'extra' smarty template file if it is present in
- * the custom template directory. This does not work if there are
+ * Append the contents of an 'extra' smarty template file.
+ *
+ * It must be present in the custom template directory. This does not work if there are
* multiple custom template directories
*
* @param string $fileName
}
/**
- * Get a list of all files that are found within the directories
- * that are the result of appending the provided relative path to
+ * Get a list of all files that are found within the directories.
+ *
+ * Files must be the result of appending the provided relative path to
* each component of the PHP include path.
*
* @author Ken Zalewski
}
/**
- * Get a list of all "plugins" (PHP classes that implement a piece of
+ * Get a list of all "plugins".
+ *
+ * (PHP classes that implement a piece of
* functionality using a well-defined interface) that are found in a
* particular CiviCRM directory (both custom and core are searched).
*
return $plugins;
}
+ /**
+ * Execute scheduled jobs.
+ */
public static function executeScheduledJobs() {
$facility = new CRM_Core_JobManager();
$facility->execute(FALSE);
* Evaluate any tokens in a URL.
*
* @param string|FALSE $url
+ *
* @return string|FALSE
*/
public static function evalUrl($url) {
}
/**
+ * Is in upgrade mode.
+ *
* @return bool
*/
public static function isInUpgradeMode() {
* - action: int, CRM_Core_Action::UPDATE or CRM_Core_Action::VIEW [default: VIEW]
* - entity_table: string, eg "civicrm_contact"
* - entity_id: int
+ *
* @return array|NULL
* NULL if unavailable, or an array. array has keys:
* - path: string
}
/**
+ * Set http header.
+ *
* @param string $name
* @param string $value
*/
<?php
/**
- * File for the CRM_Utils_Cache_AllTests class
+ * @file
+ *
+ * File for the CRM_Utils_Cache_AllTests class
*
* (PHP 5)
*
* Class CRM_Utils_FileTest
*/
class CRM_Utils_FileTest extends CiviUnitTestCase {
+
+ /**
+ * Test is child path.
+ */
public function testIsChildPath() {
$testCases = array();
$testCases[] = array('/ab/cd/ef', '/ab/cd', FALSE);