<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
CONST MAX_SMS_CHAR = 460;
/**
- * singleton function used to manage this object
+ * Singleton function used to manage this object
+ *
+ * @param array $providerParams
+ * @param bool $force
*
* @return object
* @static
- *
*/
- static function &singleton($providerParams = array(
- ), $force = FALSE) {
+ static function &singleton($providerParams = array(), $force = FALSE) {
$mailingID = CRM_Utils_Array::value('mailing_id', $providerParams);
$providerID = CRM_Utils_Array::value('provider_id', $providerParams);
$providerName = CRM_Utils_Array::value('provider', $providerParams);
abstract function send($recipients, $header, $message, $dncID = NULL);
/**
- * Function to return message text. Child class could override this function to have better control over the message being sent.
+ * Return message text. Child class could override this function to have better control over the message being sent.
*
* @access public
*/
return $html ? $html : $text;
}
+ /**
+ * @param $fields
+ * @param $additionalDetails
+ *
+ * @return mixed
+ */
function getRecipientDetails($fields, $additionalDetails) {
// we could do more altering here
$fields['To'] = $fields['phone'];
return $fields;
}
- function createActivity($apiMsgID, $message, $headers = array(
- ), $jobID = NULL, $userID = NULL) {
+ /**
+ * @param int $apiMsgID
+ * @param $message
+ * @param array $headers
+ * @param int $jobID
+ * @param int $userID
+ *
+ * @return $this|null|object
+ * @throws CRM_Core_Exception
+ */
+ function createActivity($apiMsgID, $message, $headers = array(), $jobID = NULL, $userID = NULL) {
if ($jobID) {
$sql = "
SELECT scheduled_id FROM civicrm_mailing m
return CRM_Activity_BAO_Activity::create($activityParams);
}
+ /**
+ * @param string $name
+ * @param $type
+ * @param bool $abort
+ * @param null $default
+ * @param string $location
+ *
+ * @return mixed
+ */
function retrieve($name, $type, $abort = TRUE, $default = NULL, $location = 'REQUEST') {
static $store = NULL;
$value = CRM_Utils_Request::retrieve($name, $type, $store,
return $value;
}
+ /**
+ * @param $from
+ * @param $body
+ * @param null $to
+ * @param int $trackID
+ *
+ * @return $this|null|object
+ * @throws CRM_Core_Exception
+ */
function processInbound($from, $body, $to = NULL, $trackID = NULL) {
$formatFrom = $this->formatPhone($this->stripPhone($from), $like, "like");
$escapedFrom = CRM_Utils_Type::escape($formatFrom, 'String');
}
}
+ /**
+ * @param $phone
+ *
+ * @return mixed|string
+ */
function stripPhone($phone) {
$newphone = preg_replace('/[^0-9x]/', '', $phone);
while (substr($newphone, 0, 1) == "1") {
return $newphone;
}
+ /**
+ * @param $phone
+ * @param $kind
+ * @param string $format
+ *
+ * @return mixed|string
+ */
function formatPhone($phone, &$kind, $format = "dash") {
$phoneA = explode("x", $phone);
switch (strlen($phoneA[0])) {
}
}
+ /**
+ * @param $values
+ *
+ * @return string
+ */
function urlEncode($values) {
$uri = '';
foreach ($values as $key => $value) {