/**
* Skip remaining logic in the current iteration of a loop.
+ * @param $contents
+ * @param $smarty
+ * @return string
*/
function smarty_compiler_continue($contents, &$smarty) {
return 'continue;';
/**
* {inheritdoc}
+ * @param array $apiRequest
+ * @return array|mixed
*/
public function invoke($apiRequest) {
return call_user_func($this->actions[strtolower($apiRequest['action'])]['callback'], $apiRequest);
/**
* {inheritdoc}
+ * @param int $version
+ * @return array
*/
public function getEntityNames($version) {
return array($this->entity);
/**
* {inheritdoc}
+ * @param int $version
+ * @param string $entity
+ * @return array
*/
public function getActionNames($version, $entity) {
if ($version == $this->version && $entity == $this->entity) {
/**
* {inheritdoc}
+ * @param array $apiRequest
+ * @return array
*/
public function invoke($apiRequest) {
$function = $apiRequest['function'];
/**
* {inheritdoc}
+ * @param int $version
+ * @return array
*/
public function getEntityNames($version) {
$entities = array();
/**
* {inheritdoc}
+ * @param int $version
+ * @param string $entity
+ * @return array
*/
public function getActionNames($version, $entity) {
$entity = _civicrm_api_get_camel_name($entity);
/**
* {inheritdoc}
+ * @param array $apiRequest
+ * @return array
+ * @throws \API_Exception
*/
public function invoke($apiRequest) {
if (strtolower($apiRequest['entity']) == 'entity' && $apiRequest['action'] == 'get') {
/**
* {inheritdoc}
+ * @param int $version
+ * @return array
*/
public function getEntityNames($version) {
return array('Entity');
/**
* {inheritdoc}
+ * @param int $version
+ * @param string $entity
+ * @return array
*/
public function getActionNames($version, $entity) {
$entity = _civicrm_api_get_camel_name($entity, $version);
/**
* Return array of defaults for the given API (function is a wrapper on getfields).
+ * @param $fields
+ * @return array
*/
public function getDefaults($fields) {
$defaults = array();
/**
* Return array of required fields for the given API (function is a wrapper on getfields).
+ * @param $fields
+ * @return array
*/
public function getRequired($fields) {
$required = array('version');
* Call any nested api calls
*
* TODO: We don't really need this to be a separate function.
+ * @param $params
+ * @param $result
+ * @param $action
+ * @param $entity
+ * @param $version
+ * @throws \Exception
*/
protected function callNestedApi(&$params, &$result, $action, $entity, $version) {
$entity = _civicrm_api_get_entity_name_from_camel($entity);
* Sets the tsLocale and dbLocale for multi-lingual sites.
* Some code duplication from CRM/Core/BAO/ConfigSetting.php retrieve()
* to avoid regressions from refactoring.
+ * @param $lcMessagesRequest
+ * @throws \API_Exception
*/
public function setLocale($lcMessagesRequest) {
// We must validate whether the locale is valid, otherwise setting a bad
*/
class PHPUnitScanner {
/**
- * @return array<string> class names
+ * @param $path
+ * @return array <string> class names
*/
public static function _findTestClasses($path) {
// print_r(array(
}
/**
- * @return array
- * (string $file => string $class)
+ * @param $paths
+ * @return array (string $file => string $class)
+ * (string $file => string $class)
+ * @throws \Exception
*/
public static function findTestClasses($paths) {
$testClasses = array();
* A PHP callback.
* @param array|NULL $params Optional values to pass to callback.
* See php manual call_user_func_array for details.
+ * @param null $id
*/
public function addCallback($phase, $callback, $params = NULL, $id = NULL) {
if ($id) {
/**
* Public wrapper for calling private "add" functions
* Provides user feedback
+ * @param $itemName
*/
public function generate($itemName) {
echo "Generating $itemName\n";
/*********************************
* private methods
- *********************************/
+ ********************************
+ * @param int $size
+ * @return string
+ */
// get a randomly generated string
private function randomString($size = 32) {
/**
* Automatically manage the is_primary field by tracking which contacts have each item
+ * @param $cid
+ * @param $type
+ * @return int
*/
private function isPrimary($cid, $type) {
if (empty($this->location[$type][$cid])) {
/**
* Execute a query unless we are doing a dry run
* Note: this wrapper should not be used for SELECT queries
+ * @param $query
+ * @param array $params
+ * @return \CRM_Core_DAO
*/
private function _query($query, $params = array()) {
if (self::ADD_TO_DB) {
/**
* Call dao insert method unless we are doing a dry run
+ * @param $dao
*/
private function _insert(&$dao) {
if (self::ADD_TO_DB) {
/**
* Call dao update method unless we are doing a dry run
+ * @param $dao
*/
private function _update(&$dao) {
if (self::ADD_TO_DB) {
/**
* Add core DAO object
+ * @param $type
+ * @param $params
*/
private function _addDAO($type, $params) {
$daoName = "CRM_Core_DAO_$type";
/**
* Fetch contact type based on stored mapping
+ * @param $id
+ * @return
*/
private function getContactType($id) {
foreach (array('Individual', 'Household', 'Organization') as $type) {
/*********************************
* private methods
- *********************************/
+ ********************************
+ * @param int $size
+ * @return string
+ */
// get a randomly generated string
private function _getRandomString($size = 32) {
*
* @params array to add group
*
- * @param array $params
- * @return int
- * groupId of created group
+ * @param int $groupID
+ * @param int $totalCount
+ * @return int groupId of created group
+ * groupId of created group
*/
public function groupContactCreate($groupID, $totalCount = 10) {
$params = array('group_id' => $groupID);