<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone {
- /*
+ /**
* Create phone object - note that the create function calls 'add' but
* has more business logic
*
- * @param array $params input parameters
- */
- /**
- * @param $params
+ * @param array $params
*
* @return object
* @throws API_Exception
*/
- static function create($params) {
+ public static function create($params) {
// Ensure mysql phone function exists
CRM_Core_DAO::checkSqlFunctionsExist();
}
/**
- * takes an associative array and adds phone
+ * Takes an associative array and adds phone
*
- * @param array $params (reference ) an assoc array of name/value pairs
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
*
- * @return object CRM_Core_BAO_Phone object on success, null otherwise
- * @access public
- * @static
+ * @return object
+ * CRM_Core_BAO_Phone object on success, null otherwise
*/
- static function add(&$params) {
+ public static function add(&$params) {
// Ensure mysql phone function exists
CRM_Core_DAO::checkSqlFunctionsExist();
*
* @param array entityBlock input parameters to find object
*
- * @return array array of phone objects
- * @access public
- * @static
+ * @return array
+ * array of phone objects
*/
- static function &getValues($entityBlock) {
+ public static function &getValues($entityBlock) {
$getValues = CRM_Core_BAO_Block::getValues('phone', $entityBlock);
return $getValues;
}
/**
* Get all the phone numbers for a specified contact_id, with the primary being first
*
- * @param int $id the contact id
+ * @param int $id
+ * The contact id.
*
* @param bool $updateBlankLocInfo
* @param null $type
* @param array $filters
*
- * @return array the array of phone ids which are potential numbers
- * @access public
- * @static
+ * @return array
+ * the array of phone ids which are potential numbers
*/
- static function allPhones($id, $updateBlankLocInfo = FALSE, $type = NULL, $filters = array(
- )) {
+ public static function allPhones($id, $updateBlankLocInfo = FALSE, $type = NULL, $filters = array()) {
if (!$id) {
return NULL;
}
);
$numbers = $values = array();
- $dao = CRM_Core_DAO::executeQuery($query, $params);
- $count = 1;
+ $dao = CRM_Core_DAO::executeQuery($query, $params);
+ $count = 1;
while ($dao->fetch()) {
$values = array(
'locationType' => $dao->locationType,
/**
* Get all the phone numbers for a specified location_block id, with the primary phone being first
*
- * @param array $entityElements the array containing entity_id and
- * entity_table name
+ * @param array $entityElements
+ * The array containing entity_id and.
+ * entity_table name
*
* @param null $type
*
- * @return array the array of phone ids which are potential numbers
- * @access public
- * @static
+ * @return array
+ * the array of phone ids which are potential numbers
*/
- static function allEntityPhones($entityElements, $type = NULL) {
+ public static function allEntityPhones($entityElements, $type = NULL) {
if (empty($entityElements)) {
return NULL;
}
/**
* Set NULL to phone, mapping, uffield
*
- * @param $optionId value of option to be deleted
+ * @param $optionId
+ * Value of option to be deleted.
*
- * return void
- * @static
+ * @return void
*/
- static function setOptionToNull($optionId) {
+ public static function setOptionToNull($optionId) {
if (!$optionId) {
return;
}
/**
* Call common delete function
*/
- static function del($id) {
+ public static function del($id) {
// Ensure mysql phone function exists
CRM_Core_DAO::checkSqlFunctionsExist();
return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('Phone', $id);
}
}
-