Merge pull request #5060 from eileenmcnaughton/api-comment-fixes
authorEileen McNaughton <eileen@mcnaughty.com>
Tue, 3 Feb 2015 02:26:56 +0000 (15:26 +1300)
committerEileen McNaughton <eileen@mcnaughty.com>
Tue, 3 Feb 2015 02:26:56 +0000 (15:26 +1300)
Api comment fixes

202 files changed:
CRM/Activity/BAO/ActivityContact.php
CRM/Activity/BAO/Query.php
CRM/Activity/Form/Search.php
CRM/Activity/Form/Task/Batch.php
CRM/Activity/Form/Task/Delete.php
CRM/Activity/Form/Task/Print.php
CRM/Activity/Import/Controller.php
CRM/Activity/Import/Parser.php
CRM/Activity/Selector/Search.php
CRM/Activity/StateMachine/Search.php
CRM/Activity/Task.php
CRM/Contact/BAO/Contact.php
CRM/Contact/Controller/Search.php
CRM/Contact/Form/Edit/TagsAndGroups.php
CRM/Contact/Form/Search/Custom/FullText/Activity.php
CRM/Contact/Form/Search/Custom/FullText/Contact.php
CRM/Contact/Form/Search/Custom/FullText/Participant.php
CRM/Contact/Form/Search/Custom/RandomSegment.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/BAO/Query.php
CRM/Contribute/BAO/Widget.php
CRM/Contribute/Controller/Contribution.php
CRM/Contribute/Controller/Search.php
CRM/Contribute/Form/AdditionalPayment.php
CRM/Contribute/Form/Contribution.php
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/Contribution/Main.php
CRM/Contribute/Form/ContributionBase.php
CRM/Contribute/Form/SoftCredit.php
CRM/Contribute/Form/Task/PDF.php
CRM/Contribute/Import/Field.php
CRM/Contribute/Import/Form/Preview.php
CRM/Contribute/Import/Parser.php
CRM/Contribute/Import/Parser/Contribution.php
CRM/Contribute/Selector/Search.php
CRM/Contribute/StateMachine/Contribution.php
CRM/Core/BAO/RecurringEntity.php
CRM/Core/BAO/Setting.php
CRM/Core/Form/RecurringEntity.php
CRM/Core/I18n/SchemaStructure_4_5_beta2.php
CRM/Core/ManagedEntities.php
CRM/Core/Payment/PayPalIPN.php
CRM/Core/StateMachine.php
CRM/Event/PseudoConstant.php
CRM/Group/StateMachine.php
CRM/Member/Import/Controller.php
CRM/Member/StateMachine/Search.php
CRM/PCP/Controller/PCP.php
CRM/Pledge/Page/Tab.php
CRM/Pledge/StateMachine/Search.php
CRM/Price/BAO/PriceField.php
CRM/Price/BAO/PriceSet.php
CRM/Upgrade/Incremental/php/FourSix.php
CRM/Utils/PDF/Utils.php
CRM/Utils/Pager.php
CRM/Utils/QueryFormatter.php
Civi/CCase/Analyzer.php
Civi/CCase/CaseChangeListener.php
Civi/CCase/Event/CaseChangeEvent.php
Civi/CCase/Events.php
Civi/CCase/Exception/MultipleActivityException.php
Civi/CCase/SequenceListener.php
Civi/CiUtil/Arrays.php
Civi/CiUtil/Command/AntagonistCommand.php
Civi/CiUtil/Command/CompareCommand.php
Civi/CiUtil/Command/LsCommand.php
Civi/CiUtil/ComparisonPrinter.php
Civi/CiUtil/CsvPrinter.php
Civi/CiUtil/EnvTestRunner.php
Civi/Core/DAO/Event/PostDelete.php
Civi/Core/DAO/Event/PostUpdate.php
Civi/Core/Event/PostEvent.php
Civi/Core/Event/PreEvent.php
Civi/Core/Event/UnhandledExceptionEvent.php
Civi/Core/Transaction/Frame.php
api/Exception.php
api/Wrapper.php
api/api.php
api/class.api.php
api/v3/AclRole.php
api/v3/ActionSchedule.php
api/v3/Activity.php
api/v3/ActivityContact.php
api/v3/ActivityType.php
api/v3/Address.php
api/v3/Attachment.php
api/v3/Batch.php
api/v3/Campaign.php
api/v3/Case.php
api/v3/CaseType.php
api/v3/Constant.php
api/v3/Contact.php
api/v3/ContactType.php
api/v3/Contribution.php
api/v3/ContributionPage.php
api/v3/ContributionRecur.php
api/v3/ContributionSoft.php
api/v3/Country.php
api/v3/CustomField.php
api/v3/CustomGroup.php
api/v3/CustomSearch.php
api/v3/CustomValue.php
api/v3/Dashboard.php
api/v3/DashboardContact.php
api/v3/Domain.php
api/v3/Email.php
api/v3/Entity.php
api/v3/Event.php
api/v3/Extension.php
api/v3/File.php
api/v3/FinancialAccount.php
api/v3/FinancialType.php
api/v3/Generic.php
api/v3/Grant.php
api/v3/Group.php
api/v3/GroupContact.php
api/v3/GroupNesting.php
api/v3/GroupOrganization.php
api/v3/Job.php
api/v3/LineItem.php
api/v3/LocBlock.php
api/v3/Location.php
api/v3/LocationType.php
api/v3/MailSettings.php
api/v3/Mailing.php
api/v3/MailingAB.php
api/v3/MailingComponent.php
api/v3/MailingContact.php
api/v3/MailingEventQueue.php
api/v3/MailingEventSubscribe.php
api/v3/MailingEventUnsubscribe.php
api/v3/MailingGroup.php
api/v3/MailingJob.php
api/v3/MailingRecipients.php
api/v3/Membership.php
api/v3/MembershipBlock.php
api/v3/MembershipPayment.php
api/v3/MembershipStatus.php
api/v3/MembershipType.php
api/v3/MessageTemplate.php
api/v3/Note.php
api/v3/OptionGroup.php
api/v3/OptionValue.php
api/v3/Participant.php
api/v3/ParticipantPayment.php
api/v3/ParticipantStatusType.php
api/v3/PaymentProcessor.php
api/v3/PaymentProcessorType.php
api/v3/Phone.php
api/v3/Phone/Get.php
api/v3/Pledge.php
api/v3/PledgePayment.php
api/v3/Premium.php
api/v3/PriceField.php
api/v3/PriceFieldValue.php
api/v3/PriceSet.php
api/v3/PrintLabel.php
api/v3/Product.php
api/v3/Profile.php
api/v3/Relationship.php
api/v3/RelationshipType.php
api/v3/ReportInstance.php
api/v3/ReportTemplate.php
api/v3/Setting.php
api/v3/SmsProvider.php
api/v3/Survey.php
api/v3/SurveyRespondant.php
api/v3/System.php
api/v3/SystemLog.php
api/v3/Tag.php
api/v3/UFField.php
api/v3/UFGroup.php
api/v3/UFJoin.php
api/v3/UFMatch.php
api/v3/Website.php
api/v3/WordReplacement.php
api/v3/utils.php
tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php
tests/phpunit/CRM/Core/InnoDBIndexerTest.php
tests/phpunit/CRM/Core/MenuTest.php
tests/phpunit/CRM/Core/Page/RedirectTest.php
tests/phpunit/CRM/Core/TransactionTest.php
tests/phpunit/CRM/Utils/HookTest.php
tests/phpunit/CRM/Utils/HtmlToTextTest.php
tests/phpunit/CRM/Utils/StringTest.php
tests/phpunit/CRM/Utils/TimeTest.php
tests/phpunit/CRM/Utils/versionCheckTest.php
tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php
tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php
tests/phpunit/Civi/CCase/SequenceListenerTest.php
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/CiviTest/Custom.php
tests/phpunit/WebTest/Activity/AddRecurringActivityTest.php
tests/phpunit/WebTest/Event/AddRecurringEventTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddTest.php
tests/phpunit/api/v3/ActionScheduleTest.php
tests/phpunit/api/v3/LocBlockTest.php
tests/phpunit/api/v3/NoteTest.php
tests/phpunit/api/v3/PriceFieldValueTest.php

index 32ca64447dc883987d394c7e22dd6b550d62260e..20aae7cab8409649856e7629dfd4c1868b8243dc 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Activity_BAO_ActivityContact extends CRM_Activity_DAO_ActivityContact
   }
 
   /**
-   * Funtion to add activity contact
+   * Function to add activity contact.
    *
    * @param array $params
    *   The values for this table: activity id, contact id, record type.
index a24f4c02ddde272740437bc6488adcdb8b510f90..0dd18450e6ccb413366bce5c09ab517e881eec96 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Activity_BAO_Query {
 
   /**
-   * Build select for Case
+   * Build select for Case.
    *
    * @param $query
-   *
-   * @return void
    */
   public static function select(&$query) {
     if (!empty($query->_returnProperties['activity_id'])) {
index 9c30ef073fddc0d1a2fa253ec78a03ab8ce75adb..3f089653371ed21a8667a01b4e84f50e10fb848c 100644 (file)
@@ -191,12 +191,9 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
    *        the form values associated with the saved search are used for searching.
    *      - if user has done a submit with new values the regular post submissing is
    *        done.
+   *
    * The processing consists of using a Selector / Controller framework for getting the
    * search results.
-   *
-   * @param
-   *
-   * @return void
    */
   public function postProcess() {
     if ($this->_done) {
index a60c9a71031ab4de9ee6f32f3851b571ecba2631..518f69e4739af06877ce005fb77f118a7674ff77 100755 (executable)
@@ -95,10 +95,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
   }
 
   /**
-   * Build the form object
-   *
-   *
-   * @return void
+   * Build the form object.
    */
   public function buildQuickForm() {
     $ufGroupId = $this->get('ufGroupId');
@@ -199,9 +196,6 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
 
   /**
    * Set default values for the form.
-   *
-   *
-   * @return void
    */
   public function setDefaultValues() {
     if (empty($this->_fields)) {
@@ -219,9 +213,6 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
 
   /**
    * Process the form after the input has been submitted and validated
-   *
-   *
-   * @return void
    */
   public function postProcess() {
     $params = $this->exportValues();
index d6ceb4de4d3ad8c0d66142b20ec4590ca56d2013..1a29df04412b3e2d19d1165c793f9d6a8c6a1f67 100755 (executable)
@@ -35,7 +35,7 @@
 
 /**
  * This class provides the functionality to delete a group of
- * Activites. This class provides functionality for the actual
+ * Activities. This class provides functionality for the actual
  * deletion.
  */
 class CRM_Activity_Form_Task_Delete extends CRM_Activity_Form_Task {
index ccadc7837c8fd7ca59e49604e2997c7550a17270..9897bcd62abda6b04114bc981b433f611dc29184 100644 (file)
@@ -39,7 +39,7 @@
 class CRM_Activity_Form_Task_Print extends CRM_Activity_Form_Task {
 
   /**
-   * Build all the data structures needed to build the form
+   * Build all the data structures needed to build the form.
    *
    * @return void
    */
index f61c1041651fe16a93cfeea7009936d6d818f8f9..e5f821ea1c2286ffc062692989d161d080bab701 100644 (file)
@@ -35,7 +35,8 @@
 class CRM_Activity_Import_Controller extends CRM_Core_Controller {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
    * @param null $title
    * @param bool|int $action
    * @param bool $modal
index 02e925737975b15888fa255d8cb8c8721b9bdf86..ee2659d490ebd784e8d66fe986839571b99fa2d1 100644 (file)
@@ -46,7 +46,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser {
   protected $_fileSize;
 
   /**
-   * Seperator being used
+   * Separator being used.
    */
   protected $_seperator;
 
index 296c51f37e074653027ef958278ed3c92f9a1615..f86cabccc12562b0173ef8f610e0c541d08e7c3a 100644 (file)
@@ -202,7 +202,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
   /**
    * Returns total number of rows for the query.
    *
-   * @param
+   * @param string $action
    *
    * @return int
    *   Total number of rows
@@ -217,7 +217,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
   }
 
   /**
-   * Returns all the rows in the given offset and rowCount
+   * Returns all the rows in the given offset and rowCount.
    *
    * @param string $action
    *   The action being performed.
index 49cf8febb56f1439e5d637fc773493ed7053ca0f..345f04bc1333524fe16dd5dc4a773ec6bb12d07d 100644 (file)
@@ -41,9 +41,10 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine {
   protected $_task;
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
    * @param object $controller
-   * @param int $action
+   * @param \const|int $action
    */
   public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
index 24c782772333b48ab9af551e3e9214ba19b572ed..9f6c5aeb62650a62cce43cc1cfa56c1c773f0e82 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * class to represent the actions that can be performed on a group of contacts
- * used by the search forms
- *
+ * Class to represent the actions that can be performed on a group of contacts
+ * used by the search forms.
  */
 class CRM_Activity_Task {
   const
index febc0c2dd987774b98785e158f85987e2fbfd65b..99157178828ae34a07436ecf36647a624ffe9d18 100644 (file)
@@ -3212,6 +3212,9 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
    * @see hook_civicrm_triggerInfo
    * @see CRM_Core_DAO::triggerRebuild
    * @see http://issues.civicrm.org/jira/browse/CRM-10554
+   *
+   * @param $info
+   * @param null $tableName
    */
   public static function triggerInfo(&$info, $tableName = NULL) {
     //during upgrade, first check for valid version and then create triggers
index 1d893fe81a10a2199ac7f00a00cfd1a2d6e7b37d..dad7c7cdddf8ad700d413547208fd2eaacbd7105 100644 (file)
 class CRM_Contact_Controller_Search extends CRM_Core_Controller {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param string $title
+   * @param bool $modal
+   * @param int|mixed|null $action
    */
   public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) {
     parent::__construct($title, $modal);
index 32e98b18b83b9e8326b9d0c78325f9b45e8f842c..80d7eb2b825e9196e0f1cab76931176eb1be48dc 100644 (file)
@@ -184,6 +184,15 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
     $form->assign('tagGroup', $form->_tagGroup);
   }
 
+  /**
+   * Climb tree.
+   *
+   * @param $form
+   * @param $tree
+   * @param $elements
+   *
+   * @return mixed
+   */
   public static function climbtree($form, $tree, &$elements) {
     foreach ($tree as $tagID => $varValue) {
       $tagAttribute = array(
index a8e122111f9e6610634535d41e6e3747fc37de80..c261ff3bf6633be94a52a40d1d74be0e2260125b 100644 (file)
@@ -42,6 +42,8 @@ class CRM_Contact_Form_Search_Custom_FullText_Activity extends CRM_Contact_Form_
   }
 
   /**
+   * Is search active for this user.
+   *
    * @return bool
    */
   public function isActive() {
@@ -123,6 +125,13 @@ AND    (ca.is_deleted = 0 OR ca.is_deleted IS NULL)
     return $tables;;
   }
 
+  /**
+   * Move IDs.
+   *
+   * @param string $fromTable
+   * @param string $toTable
+   * @param int $limit
+   */
   public function moveIDs($fromTable, $toTable, $limit) {
     $sql = "
 INSERT INTO {$toTable}
index 85631655e7d150521e36bdb2f33d7e82bbe9f6ed..4e19cfd93d649b42822ba93ecdcd130b76d29b5d 100644 (file)
@@ -135,6 +135,13 @@ GROUP BY   et.entity_id
     return $tables;
   }
 
+  /**
+   * Move IDs.
+   *
+   * @param $fromTable
+   * @param $toTable
+   * @param $limit
+   */
   public function moveIDs($fromTable, $toTable, $limit) {
     $sql = "
 INSERT INTO {$toTable}
index 59e1f0b612c530d0469234f476cff4d7782f594a..35665773f67f3f0c45a5257e8b476c6465e0a432 100644 (file)
@@ -109,6 +109,12 @@ WHERE      ({$this->matchText('civicrm_contact c', array('sort_name', 'display_n
     return $tables;
   }
 
+  /**
+   * Move IDs.
+   * @param string $fromTable
+   * @param string $toTable
+   * @param int $limit
+   */
   public function moveIDs($fromTable, $toTable, $limit) {
     $sql = "
 INSERT INTO {$toTable}
index 228f3729e9cb31feb31b20293f47b7c711873f85..30078110ddc6224213b27a3ecf1d290fcaa9475d 100644 (file)
@@ -372,6 +372,9 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear
     return $dao->N;
   }
 
+  /**
+   * Destructor function.
+   */
   public function __destruct() {
     // the temporary tables are dropped automatically
     // so we don't do it here
index 97d53a1dbeba1181620fa8210178e569fae5757f..030b14039131083c72c5514db7b75170883dfe6a 100644 (file)
@@ -493,12 +493,18 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
   }
 
   /**
-   * convert associative array names to values
-   * and vice-versa.
+   * Convert associative array names to values and vice-versa.
    *
    * This function is used by both the web form layer and the api. Note that
    * the api needs the name => value conversion, also the view layer typically
    * requires value => name conversion
+   *
+   * @param array $defaults
+   * @param string $property
+   * @param array $lookup
+   * @param bool $reverse
+   *
+   * @return bool
    */
   public static function lookupValue(&$defaults, $property, &$lookup, $reverse) {
     $id = $property . '_id';
@@ -945,8 +951,7 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = civicrm_contribution.conta
   }
 
   /**
-   * Add extra fields specific to contribtion
-   *
+   * Add extra fields specific to contribution.
    */
   public static function getSpecialContributionFields() {
     $extraFields = array(
@@ -1383,6 +1388,12 @@ LEFT JOIN  civicrm_contribution contribution ON ( componentPayment.contribution_
 
   /**
    * Update contribution as well as related objects.
+   *
+   * @param array $params
+   * @param bool $processContributionObject
+   *
+   * @return array
+   * @throws \Exception
    */
   public static function transitionComponents($params, $processContributionObject = FALSE) {
     // get minimum required values.
index 1abae585be55f93073b7a1113baa498b6e5e9054..d76dc8badd12058bbaff2c4206332eea35d2a9f1 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Contribute_BAO_Contribution_Utils {
 
index c95cb01373866ccfd549fee3ddfb4c716b67497c..4d9647ecf610d02066f403320f3abf0e632dc740 100644 (file)
@@ -924,7 +924,8 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
   }
 
   /**
-   * Helper to determine if the page supports separate membership payments
+   * Helper to determine if the page supports separate membership payments.
+   *
    * @param int $id form id
    *
    * @return bool
index 6b915f2453ed69a5670cbbf5bb5323dc16fad74e..dd0693dd6b04cccc4ac3d378b4f643f1224f1640 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Contribute_BAO_Query {
 
   /**
-   * Static field for all the export/import contribution fields
+   * Static field for all the export/import contribution fields.
    *
    * @var array
    */
@@ -63,7 +62,7 @@ class CRM_Contribute_BAO_Query {
   }
 
   /**
-   * If contributions are involved, add the specific contribute fields
+   * If contributions are involved, add the specific contribute fields.
    *
    * @param $query
    *
index c5dc7a984ebae0330b0a5e410859d415a138d1f2..d0f34918c4c92af74826472239da472b7fc10f64 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
index 6d302d84133de4a49fc33391f10c908eb7af6c2d..079e0af1bf78c81c24556829aa5e31b0036dd2b4 100644 (file)
  *
  * Typically the first form will display the search criteria and it's results
  *
- * The second form is used to process search results with the asscociated actions
+ * The second form is used to process search results with the associated actions
  *
  */
 class CRM_Contribute_Controller_Contribution extends CRM_Core_Controller {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param string $title
+   * @param bool|int $action
+   * @param bool $modal
    */
   public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
     parent::__construct($title, $modal);
index 9f8b11136ec2ef103fb87aa0d57b796be84bd15e..fe1f7bb5d379778c7d80c7a02b3f518d171782e6 100644 (file)
 class CRM_Contribute_Controller_Search extends CRM_Core_Controller {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param string $title
+   * @param bool|int $action
+   * @param bool $modal
    */
   public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
 
index 61101dac20734bb51bf7f14cd9bb74873285adcc..0fd2c8091d54d8fcebf8d61ff42d3c7775ae5091 100644 (file)
@@ -11,7 +11,7 @@
  | under the terms of the GNU Affero General Public License           |
  | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
  |                                                                    |
- | CiviCRM is distributed in the hope that it will be usefusul, but   |
+ | CiviCRM is distributed in the hope that it will be useful, but   |
  | WITHOUT ANY WARRANTY; without even the implied warranty of         |
  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
  | See the GNU Affero General Public License for more details.        |
index e19f9068b0d1a3c3be2df68c38918476d5a91dd1..5824a757759095e3842fe7cb24a910021e98084f 100644 (file)
@@ -11,7 +11,7 @@
  | under the terms of the GNU Affero General Public License           |
  | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
  |                                                                    |
- | CiviCRM is distributed in the hope that it will be usefusul, but   |
+ | CiviCRM is distributed in the hope that it will be useful, but   |
  | WITHOUT ANY WARRANTY; without even the implied warranty of         |
  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
  | See the GNU Affero General Public License for more details.        |
index 31ca13b77efe23b1de3f5eb95787c75041a9ed6f..20812df92bad8991ed23a93ffcd93afdc5108660 100644 (file)
@@ -661,9 +661,10 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Set default values for the form. Note that in edit/view mode
-   * the default values are retrieved from the database
+   * Set default values for the form.
    *
+   * Note that in edit/view mode
+   * the default values are retrieved from the database
    *
    * @return void
    */
@@ -1058,10 +1059,13 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
+   * Wrangle financial type ID.
+   *
    * This wrangling of the financialType ID was happening in a shared function rather than in the form it relates to & hence has been moved to that form
    * Pledges are not relevant to the membership code so that portion will not go onto the membership form.
    *
-   * Comments from previous refactor indicate doubt as to what was going on
+   * Comments from previous refactor indicate doubt as to what was going on.
+   *
    * @param int $contributionTypeId
    *
    * @return null|string
@@ -1080,12 +1084,10 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Process the form
+   * Process the form.
    *
    * @param array $premiumParams
    * @param $contribution
-   *
-   * @return void
    */
   public function postProcessPremium($premiumParams, $contribution) {
     $hour = $minute = $second = 0;
@@ -1204,7 +1206,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Process the contribution
+   * Process the contribution.
    *
    * @param CRM_Core_Form $form
    * @param array $params
@@ -1526,7 +1528,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Create the recurring contribution record
+   * Create the recurring contribution record.
    *
    * @param CRM_Core_Form $form
    * @param array $params
@@ -1614,7 +1616,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Add on behalf of organization and it's location
+   * Add on behalf of organization and it's location.
    *
    * @param array $behalfOrganization
    *   array of organization info.
@@ -1626,8 +1628,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
    *   form values array.
    * @param array $params
    * @param null $fields
-   *
-   * @return void
    */
   public static function processOnBehalfOrganization(&$behalfOrganization, &$contactID, &$values, &$params, $fields = NULL) {
     $isCurrentEmployer = FALSE;
@@ -1726,16 +1726,16 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Function used to save pcp / soft credit entry
+   * Function used to save pcp / soft credit entry.
+   *
    * This is used by contribution and also event pcps
    *
    * @param array $params
    * @param object $contribution
    *   Contribution object.
-   *
    */
   public static function processPcpSoft(&$params, &$contribution) {
-    //add soft contribution due to pcp or Submit Credit / Debit Card Contribution by admin.
+    // Add soft contribution due to pcp or Submit Credit / Debit Card Contribution by admin.
     if (!empty($params['soft_credit_to'])) {
       $contributionSoftParams = array();
       foreach (array(
@@ -1767,15 +1767,14 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Function used to send notification mail to pcp owner
-   * This is used by contribution and also event pcps
+   * Function used to send notification mail to pcp owner.
+   *
+   * This is used by contribution and also event PCPs.
    *
    * @param object $contribution
    * @param object $contributionSoft
    *   Contribution object.
-   *
    */
-
   public static function pcpNotifyOwner($contribution, $contributionSoft) {
     $params = array('id' => $contributionSoft->pcp_id);
     CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCP', $params, $pcpInfo);
@@ -1827,8 +1826,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Function used to se pcp related defaults / params
-   * This is used by contribution and also event pcps
+   * Function used to se pcp related defaults / params.
+   *
+   * This is used by contribution and also event PCPs
    *
    * @param CRM_Core_Form $page
    *   Form object.
@@ -1861,6 +1861,8 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
+   * Process membership.
+   *
    * @param array $membershipParams
    * @param int $contactID
    * @param array $customFieldsFormatted
@@ -1908,10 +1910,11 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Are we going to do 2 financial transactions?
-   * ie the membership block supports a separate transactions AND the contribution form has been configured for a contribution
-   * transaction AND a membership transaction AND the payment processor supports double financial transactions (ie. NOT doTransferPayment style)
+   * Are we going to do 2 financial transactions.
    *
+   * Ie the membership block supports a separate transactions AND the contribution form has been configured for a
+   * contribution
+   * transaction AND a membership transaction AND the payment processor supports double financial transactions (ie. NOT doTransferPayment style)
    *
    * @param int $formID
    * @param bool $amountBlockActiveOnForm
@@ -1927,7 +1930,8 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * This function sets the fields
+   * This function sets the fields.
+   *
    * - $this->_params['amount_level']
    * - $this->_params['selectMembership']
    * And under certain circumstances sets
@@ -1956,7 +1960,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
           $this->_params['selectMembership'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue',
             $this->_params["price_{$priceField->id}"], 'membership_type_id');
         }
-      } // if separate payment we set contribution amount to be null, so that it will not show contribution amount same as membership amount.
+      }
+      // If separate payment we set contribution amount to be null, so that it will not show contribution amount same
+      // as membership amount.
       // @todo - this needs more documentation - it appears the setting to null is tied up with separate membership payments
       // but the circumstances are very confusing. Many of these conditions are repeated in the next conditional
       // so we should merge them together
@@ -1988,6 +1994,8 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
+   * Submit function.
+   *
    * @param array $params
    *
    * @throws CiviCRM_API3_Exception
@@ -2031,7 +2039,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
   }
 
   /**
-   * Helper function for static submit function - set relevant params - help us to build up an array that we can pass in
+   * Helper function for static submit function - set relevant params - help us to build up an array that we can pass
+   * in.
+   *
    * @param int $id
    * @param array $params
    *
index 243daceabab84b8ecbdd3a7acf558a3fb44f58b6..ac4c167c606ab183f12c62d5d6a73ae3861568b6 100644 (file)
@@ -732,7 +732,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
    *   The uploaded files if any.
    * @param $self
    *
-   *
    * @return bool|array
    *   true if no errors, else array of errors
    */
@@ -1398,8 +1397,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
   }
 
   /**
-   * Handle Payment Processor switching
-   * For contribution and event registration forms
+   * Handle Payment Processor switching for contribution and event registration forms.
+   *
    * @param CRM_Contribute_Form_Contribution_Main|CRM_Event_Form_Registration_Register $form
    * @param bool $noFees
    */
index ef5d36563689eca61e16a71a2ee54be6f5cf4c91..af11f4cf41fcaf1b8fb918a5423b13d8ef1c1244 100644 (file)
@@ -200,8 +200,8 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
   /**
    * Set variables up before form is built
    *
-   * @throws CRM_Contribution_Exception_InactiveContributionPageException
-   * @return void
+   * @throws \CRM_Contribute_Exception_InactiveContributionPageException
+   * @throws \Exception
    */
   public function preProcess() {
 
index dda0cf792f5515e9fb2b991bda4732ea741204c0..9950d550847e37da4ed2d28582e758a82a564986 100644 (file)
@@ -34,7 +34,7 @@
  */
 
 /**
- * This class build form elements for select exitsing or create new soft block
+ * This class build form elements for select existing or create new soft block
  */
 class CRM_Contribute_Form_SoftCredit {
 
index 582db29cc36590e7767147591118c286eccbfb68..c9abc96453d7fdcebd60e5868c8776158983fe44 100644 (file)
@@ -29,7 +29,6 @@
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
- *
  */
 
 /**
index 19df9e74aac1313603c07283725bc28f75fc95ac..0532540159ec9c09d4e33f0461171efcdafd9301 100644 (file)
@@ -113,14 +113,20 @@ class CRM_Contribute_Import_Field {
   }
 
   /**
-   * The value is in string format. convert the value to the type of this field
+   * Set a value.
+   *
+   * The value is in string format. Convert the value to the type of this field
    * and set the field value with the appropriate type
+   *
+   * @param $value
    */
   public function setValue($value) {
     $this->_value = $value;
   }
 
   /**
+   * Validate a field.
+   *
    * @return bool
    */
   public function validate() {
index 3f5ba0b7a4bda1dbb24591d4231c783eb10a372c..eee332bd8596cd8302c1957bff9197231bce54ef 100644 (file)
@@ -161,10 +161,10 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
       $onDuplicate
     );
 
-    // add all the necessary variables to the form
+    // Add all the necessary variables to the form.
     $parser->set($this, CRM_Import_Parser::MODE_IMPORT);
 
-    // check if there is any error occured
+    // Check if there is any error occurred.
 
     $errorStack = CRM_Core_Error::singleton();
     $errors = $errorStack->getErrors();
index 097cc8c3f901195dabf8fab9213da8ef5433e1c7..e55a563ff40fb06c988e0e6eeb95613357187b7b 100644 (file)
@@ -501,8 +501,6 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
    * @param CRM_Core_Session $store
    *
    * @param int $mode
-   *
-   * @return void
    */
   public function set($store, $mode = self::MODE_SUMMARY) {
     $store->set('fileSize', $this->_fileSize);
index 09ab819cdfab4c0f197ac5e29d16bf5547b132b8..dd2ca07561ba4a6fa8211a3a8d1401a5be53af8b 100644 (file)
@@ -34,7 +34,7 @@
  */
 
 /**
- * class to parse contribution csv files
+ * Class to parse contribution csv files.
  */
 class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Parser {
 
@@ -55,7 +55,12 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa
   protected $_newContributions;
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param $mapperKeys
+   * @param null $mapperSoftCredit
+   * @param null $mapperPhoneType
+   * @param null $mapperSoftCreditType
    */
   public function __construct(&$mapperKeys, $mapperSoftCredit = NULL, $mapperPhoneType = NULL, $mapperSoftCreditType = NULL) {
     parent::__construct();
@@ -570,7 +575,11 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa
   }
 
   /**
-   * Process pledge payments
+   * Process pledge payments.
+   *
+   * @param array $formatted
+   *
+   * @return int
    */
   public function processPledgePayments(&$formatted) {
     if (!empty($formatted['pledge_payment_id']) && !empty($formatted['pledge_id'])) {
index 1bd7aa97cc1da8730b1b7bec6de9e61eb8f197a2..ed22579c57b9bd8e4853903fbfae977ce286f82d 100644 (file)
@@ -280,7 +280,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
   /**
    * Returns total number of rows for the query.
    *
-   * @param
+   * @param string $action
    *
    * @return int
    *   Total number of rows
index 44b13c6eca3d417ae569025e6d5e40275a0ad3a9..f9c757b031529ffdd9336e14b595b56afbdbee95 100644 (file)
@@ -42,7 +42,7 @@ class CRM_Contribute_StateMachine_Contribution extends CRM_Core_StateMachine {
   /**
    * Class constructor
    *
-   * @param CRM_Contact_Import_Controller $controller
+   * @param CRM_Core_Controller $controller
    * @param \const|int $action
    *
    * @return CRM_Contribute_StateMachine_Contribution
index 0b74ca82d11c9263282863c50707eaf0f32c807e..95a4bdc4fdba38d9a36be2eb0aa56460f179b548 100644 (file)
@@ -128,20 +128,29 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
       ),
     );
 
+  /**
+   * Getter for status.
+   *
+   * @return string
+   */
   public static function getStatus() {
     return self::$status;
   }
 
+  /**
+   * Setter for status.
+   *
+   * @param string $status
+   */
   public static function setStatus($status) {
     self::$status = $status;
   }
 
   /**
-   * Save records in civicrm_recujrring_entity table
+   * Save records in civicrm_recurring_entity table.
    *
    * @param array $params
-   *   Reference array contains the values submitted by the form .
-   *
+   *   Reference array contains the values submitted by the form.
    *
    * @return object
    */
index f42e66c6f98d669ea54e30e687285f4204205970..14d45628ca7c710d46b7718516503846a3af65ec 100644 (file)
@@ -260,15 +260,14 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
   }
 
   /**
-   * Store multiple items in the setting table
+   * Store multiple items in the setting table.
    *
    * @param array $params
    *   (required) An api formatted array of keys and values.
-   * @param null $domains
+   * @param array $domains Array of domains to get settings for. Default is the current domain
    * @param $settingsToReturn
    *
-   * @domains array an array of domains to get settings for. Default is the current domain
-   * @return void
+   * @return array
    */
   public static function getItems(&$params, $domains = NULL, $settingsToReturn) {
     $originalDomain = CRM_Core_Config::domainID();
index 8dbed40139449f3e3b493784280bd22cea1df304..c202188193ec1bcdee0e4a240d4fe6a7f8c49220 100644 (file)
@@ -150,6 +150,11 @@ class CRM_Core_Form_RecurringEntity {
     return $defaults;
   }
 
+  /**
+   * Build form.
+   *
+   * @param $form
+   */
   public static function buildQuickForm(&$form) {
     if (self::$_entityTable) {
       $entityType = explode("_", self::$_entityTable);
index 8131ac8d142b66e68465255621895df1511b05e2..9fa762398fd8754260f262a766bed334ebd0af4c 100644 (file)
@@ -192,6 +192,11 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 {
     return $result;
   }
 
+  /**
+   * Get indices.
+   *
+   * @return array
+   */
   public static function &indices() {
     static $result = NULL;
     if (!$result) {
@@ -230,6 +235,11 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 {
     return $result;
   }
 
+  /**
+   * Get tables.
+   *
+   * @return array
+   */
   public static function &tables() {
     static $result = NULL;
     if (!$result) {
index 16ac0ad2fd3fe8d305255ad6abf118e29a575d08..66db51e95985d3b4ab4fcbdd3067b5a0e3d4e7c1 100644 (file)
@@ -345,6 +345,11 @@ class CRM_Core_ManagedEntities {
     }
   }
 
+  /**
+   * Get declarations.
+   *
+   * @return array|null
+   */
   public function getDeclarations() {
     if ($this->declarations === NULL) {
       $this->declarations = array();
index 0d2996af739697e6180bbd82b761089038026e07..ba1262ea8e3d88dafe0405dd59675cb9675c671b 100644 (file)
@@ -290,6 +290,11 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
     $this->completeTransaction($input, $ids, $objects, $transaction, $recur);
   }
 
+  /**
+   * Main function.
+   *
+   * @return bool
+   */
   public function main() {
     //@todo - this could be refactored like PayPalProIPN & a test could be added
 
index 02517aabaf341749482cbb1d5f49859df4191220..d41330b95613aab8c712bb14995447aff9fe71fe 100644 (file)
@@ -100,7 +100,7 @@ class CRM_Core_StateMachine {
   }
 
   /**
-   * Getter for name
+   * Getter for name.
    *
    * @return string
    */
@@ -109,7 +109,7 @@ class CRM_Core_StateMachine {
   }
 
   /**
-   * Setter for name
+   * Setter for name.
    *
    * @param string $name
    *
@@ -120,7 +120,9 @@ class CRM_Core_StateMachine {
   }
 
   /**
-   * Do a state transition jump. Currently only supported types are
+   * Do a state transition jump.
+   *
+   * Currently only supported types are
    * Next and Back. The other actions (Cancel, Done, Submit etc) do
    * not need the state machine to figure out where to go
    *
@@ -171,7 +173,7 @@ class CRM_Core_StateMachine {
   }
 
   /**
-   * Helper function to add a State to the state machine
+   * Helper function to add a State to the state machine.
    *
    * @param string $name
    *   The internal name.
@@ -189,7 +191,7 @@ class CRM_Core_StateMachine {
   }
 
   /**
-   * Given a name find the corresponding state
+   * Given a name find the corresponding state.
    *
    * @param string $name
    *   The state name.
@@ -207,7 +209,7 @@ class CRM_Core_StateMachine {
   }
 
   /**
-   * Return the list of state objects
+   * Return the list of state objects.
    *
    * @return array
    *   array of states in the state machine
@@ -255,18 +257,12 @@ class CRM_Core_StateMachine {
   }
 
   /**
-   * AddSequentialStates: meta level function to create a simple
-   * wizard for a state machine that is completely sequential.
+   * Add sequential pages.
    *
+   * Meta level function to create a simple wizard for a state machine that is completely sequential.
    *
    * @param array $pages
    *   (reference ) the array of page objects.
-   *
-   * @internal param array $states states is an array of arrays. Each element
-   * of the top level array describes a state. Each state description
-   * includes the name, the display name and the class name
-   *
-   * @return void
    */
   public function addSequentialPages(&$pages) {
     $this->_pages = &$pages;
index 9138c9ede0fca4cfd68eec4edc2e4d7ddb82b838..4d5d14b3e558e9bd7e5223411575c959b9f6953b 100644 (file)
@@ -156,6 +156,11 @@ class CRM_Event_PseudoConstant extends CRM_Core_PseudoConstant {
     return self::$participantStatus[$index];
   }
 
+  /**
+   * Get participant status class options.
+   *
+   * @return array
+   */
   public static function participantStatusClassOptions() {
     return array(
       'Positive' => ts('Positive'),
index 0cf651290c8011675650f1c9a5d6aa50b584d632..77e4448aaf0df9a33501956e93a957a2315f1c42 100644 (file)
 class CRM_Group_StateMachine extends CRM_Core_StateMachine {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param object $controller
+   * @param \const|int $action
    */
   public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
index f6e70a1b3af2260b3dcc90d28546306c9660819c..5cf03f58a7867d6efaf02a647000f02db7e4cc49 100644 (file)
 class CRM_Member_Import_Controller extends CRM_Core_Controller {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param string $title
+   * @param bool|int $action
+   * @param bool $modal
    */
   public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
     parent::__construct($title, $modal);
index c0aa52c0cbe9d105675c03b8f69e801ed65f24ff..b7397cfde9e72e8e2ee812a4cc866d33bd79576e 100644 (file)
@@ -42,7 +42,10 @@ class CRM_Member_StateMachine_Search extends CRM_Core_StateMachine {
   protected $_task;
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param object $controller
+   * @param \const|int $action
    */
   public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
@@ -91,7 +94,7 @@ class CRM_Member_StateMachine_Search extends CRM_Core_StateMachine {
   }
 
   /**
-   * Return the form name of the task
+   * Return the form name of the task.
    *
    * @return string
    */
index 7bd50976a2308881bab669a1f07f5e6fda3820e5..a00486ca93dea38f052d954ce16c273f06b1f372 100644 (file)
 class CRM_PCP_Controller_PCP extends CRM_Core_Controller {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param string $title
+   * @param bool|int $action
+   * @param bool $modal
    */
   public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
 
index 9714348352f49d6d1966dec1bd6f295814c0a762..7b131f63353e75d61a75b6c23cb84699378a2c0f 100644 (file)
@@ -154,6 +154,11 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page {
     return parent::run();
   }
 
+  /**
+   * Get context.
+   *
+   * @param $form
+   */
   public static function setContext(&$form) {
     $context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search');
 
index a6b05372d13eb475c851b342640dad03d12b0b48..74fe68e3805b43618c3b2013ee96bc0afded5194 100644 (file)
@@ -42,7 +42,10 @@ class CRM_Pledge_StateMachine_Search extends CRM_Core_StateMachine {
   protected $_task;
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param object $controller
+   * @param \const|int $action
    */
   public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
index b837aedd1f2319dceb0b8cdb4c045c84c73ad5d5..dc7e7c0f442aee3d3a70659c9e20116e8f8ba61b 100644 (file)
@@ -190,13 +190,20 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
    *   Value we want to set the is_active field.
    *
    * @return Object
-   *   DAO object on sucess, null otherwise
-   *
+   *   DAO object on success, null otherwise.
    */
   public static function setIsActive($id, $is_active) {
     return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceField', $id, 'is_active', $is_active);
   }
 
+  /**
+   * Freeze form if the event is full.
+   *
+   * @param $element
+   * @param $fieldOptions
+   *
+   * @return null
+   */
   public static function freezeIfEnabled(&$element, $fieldOptions) {
     if (!empty($fieldOptions['is_full'])) {
       $element->freeze();
index 494530164cf99654147c615ea9a08b6b298f5967..cc55a91d12b8d6f1414b0cf18e88eb10452e2019 100644 (file)
@@ -484,8 +484,6 @@ WHERE     ct.id = cp.financial_type_id AND
    * @param bool $required
    * @param bool $validOnly
    *
-   * @internal param int $setId - price set id whose details are needed
-   *
    * @return array
    *   array consisting of field details
    */
index 0e8a6a28d557057037db4a71c26e212eab9701ed..d7d3222548996eb7fcd60816a385af7f0f73a0ca 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Upgrade_Incremental_php_FourSix {
   const BATCH_SIZE = 5000;
 
   /**
+   * Verify DB state.
+   *
    * @param $errors
    *
    * @return bool
@@ -44,7 +45,7 @@ class CRM_Upgrade_Incremental_php_FourSix {
   }
 
   /**
-   * Compute any messages which should be displayed beforeupgrade
+   * Compute any messages which should be displayed before upgrade.
    *
    * Note: This function is called iteratively for each upcoming
    * revision to the database.
@@ -53,8 +54,6 @@ class CRM_Upgrade_Incremental_php_FourSix {
    * @param string $rev
    *   a version number, e.g. '4.4.alpha1', '4.4.beta3', '4.4.0'.
    * @param null $currentVer
-   *
-   * @return void
    */
   public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
   }
@@ -112,15 +111,27 @@ class CRM_Upgrade_Incremental_php_FourSix {
     $queue->createItem($task, array('weight' => -1));
   }
 
-  function upgrade_4_6_alpha3($rev) {
-    // task to process sql
+  /**
+   * Upgrade function.
+   *
+   * @param string $rev
+   */
+  public function upgrade_4_6_alpha3($rev) {
+    // Task to process sql.
     $this->addTask(ts('Add and update reference_date column for Schedule Reminders'), 'updateReferenceDate');
   }
 
-  // CRM-15728, Add new column reference_date to civicrm_action_log in order to track
-  // actual action_start_date for membership entity for only those schedule reminders which are not repeatable
-  static function updateReferenceDate(CRM_Queue_TaskContext $ctx) {
-    //Add column civicrm_action_log.reference_date if not exists
+  /**
+   * Add new column reference_date to civicrm_action_log in order to track.
+   *
+   * CRM-15728, actual action_start_date for membership entity for only those schedule reminders which are not repeatable
+   *
+   * @param \CRM_Queue_TaskContext $ctx
+   *
+   * @return bool
+   */
+  public static function updateReferenceDate(CRM_Queue_TaskContext $ctx) {
+    //Add column civicrm_action_log.reference_date if not exists.
     $sql = "SELECT count(*) FROM information_schema.columns WHERE table_schema = database() AND table_name = 'civicrm_action_log' AND COLUMN_NAME = 'reference_date' ";
     $res = CRM_Core_DAO::singleValueQuery($sql);
 
@@ -130,7 +141,7 @@ class CRM_Upgrade_Incremental_php_FourSix {
       CRM_Core_DAO::executeQuery($query);
     }
 
-    //Retrieve schedule reminders for membership entity and is not repeatable and no absolute date chosen
+    //Retrieve schedule reminders for membership entity and is not repeatable and no absolute date chosen.
     $query = "SELECT schedule.* FROM civicrm_action_schedule schedule
  LEFT JOIN civicrm_action_mapping mapper ON mapper.id = schedule.mapping_id AND
    mapper.entity = 'civicrm_membership' AND
@@ -139,10 +150,10 @@ class CRM_Upgrade_Incremental_php_FourSix {
 
     // construct basic where clauses
     $where = array(
-      'reminder.action_date_time >= DATE_SUB(reminder.action_date_time, INTERVAL 9 MONTH)'
+      'reminder.action_date_time >= DATE_SUB(reminder.action_date_time, INTERVAL 9 MONTH)',
     ); //choose reminder older then 9 months
     $dao = CRM_Core_DAO::executeQuery($query);
-    while($dao->fetch()) {
+    while ($dao->fetch()) {
 
       $referenceColumn = str_replace('membership_', "m.", $dao->start_action_date);
       $value = implode(', ', explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($dao->entity_value, CRM_Core_DAO::VALUE_SEPARATOR)));
@@ -170,4 +181,5 @@ class CRM_Upgrade_Incremental_php_FourSix {
 
     return TRUE;
   }
+
 }
index 0e9f00c6d8d14868531c9f73075bffec6b8431b2..cfb4de1f009cec976b1242c24a8e1ccccc96d446 100644 (file)
@@ -124,6 +124,17 @@ class CRM_Utils_PDF_Utils {
     }
   }
 
+  /**
+   * Convert html to tcpdf.
+   *
+   * @param $paper_size
+   * @param $orientation
+   * @param $margins
+   * @param $html
+   * @param $output
+   * @param $fileName
+   * @param $stationery_path
+   */
   public static function _html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName, $stationery_path) {
     // Documentation on the TCPDF library can be found at: http://www.tcpdf.org
     // This function also uses the FPDI library documented at: http://www.setasign.com/products/fpdi/about/
index 41a97a49b2168e5fe90fbf9a84db18c4ccbf181a..65b29ac741f08ecf529e5dcd357383fbebc656be 100644 (file)
@@ -70,14 +70,6 @@ class CRM_Utils_Pager extends Pager_Sliding {
    *
    * @param array $params
    *
-   * @internal param \total $int the total count of items to be displayed
-   * @internal param \currentPage $int the page currently being displayed
-   * @internal param \status $string the status message to be displayed. It embeds a token
-   *                             %%statusMessage%% that will be replaced with which items
-   *                             are currently being displayed
-   * @internal param \csvString $string the title of the link to be displayed for the export
-   * @internal param \perPage $int the number of items displayed per page
-   *
    * @return \CRM_Utils_Pager the newly created and initialized pager object
    */
   public function __construct($params) {
@@ -136,7 +128,7 @@ class CRM_Utils_Pager extends Pager_Sliding {
 
   /**
    * Helper function to assign remaining pager options as good default
-   * values
+   * values.
    *
    * @param array $params
    *   The set of options needed to initialize the parent.
index 81023a58c0fbc9ba70298009837a5960fcbb0788..14694b1cf2dfd7c3580b0efc5ccad75a7c836c85 100644 (file)
@@ -144,6 +144,14 @@ class CRM_Utils_QueryFormatter {
     return $text;
   }
 
+  /**
+   * Format Fts.
+   *
+   * @param string $text
+   * @param $mode
+   *
+   * @return mixed
+   */
   protected function _formatFts($text, $mode) {
     $result = NULL;
 
@@ -187,6 +195,14 @@ class CRM_Utils_QueryFormatter {
     return $this->dedupeWildcards($result, '%');
   }
 
+  /**
+   * Format FTS.
+   *
+   * @param string $text
+   * @param $mode
+   *
+   * @return mixed
+   */
   protected function _formatFtsBool($text, $mode) {
     $result = NULL;
 
@@ -238,6 +254,14 @@ class CRM_Utils_QueryFormatter {
     return $this->dedupeWildcards($result, '%');
   }
 
+  /**
+   * Format like.
+   *
+   * @param $text
+   * @param $mode
+   *
+   * @return mixed
+   */
   protected function _formatLike($text, $mode) {
     $result = NULL;
 
@@ -309,6 +333,11 @@ class CRM_Utils_QueryFormatter {
     return $text;
   }
 
+  /**
+   * Get modes.
+   *
+   * @return array
+   */
   public static function getModes() {
     return array(
       self::MODE_NONE,
@@ -319,6 +348,11 @@ class CRM_Utils_QueryFormatter {
     );
   }
 
+  /**
+   * Get languages.
+   *
+   * @return array
+   */
   public static function getLanguages() {
     return array(
       self::LANG_SOLR,
index b6ae7446891b0a96d6430d2a154f1ffdb3b8ec93..28b9b371ac2d8d37bc95a772d2a9260d24040d60 100644 (file)
  */
 namespace Civi\CCase;
 
+/**
+ * Class Analyzer
+ *
+ * @package Civi\CCase
+ */
 class Analyzer {
   /**
    * @var int
@@ -57,6 +62,9 @@ class Analyzer {
    */
   private $indices;
 
+  /**
+   * @param $caseId
+   */
   public function __construct($caseId) {
     $this->caseId = $caseId;
     $this->flush();
index d54bb60d0ce88c3b1c7ec6beed528148b980a4b5..70b12e0870eefa107be7911a32c4156816804c91 100644 (file)
  */
 namespace Civi\CCase;
 
+/**
+ * Interface CaseChangeListener
+ *
+ * @package Civi\CCase
+ */
 interface CaseChangeListener {
+  /**
+   * @param \Civi\CCase\Event\CaseChangeEvent $event
+   *
+   * @return mixed
+   */
   public function onCaseChange(\Civi\CCase\Event\CaseChangeEvent $event);
 
 }
index 2112d41c807ddb7a7c9457af290db5a1368a745f..270f2861b9e8849efe6c824330ec262acd217f6c 100644 (file)
@@ -37,6 +37,9 @@ class CaseChangeEvent extends \Symfony\Component\EventDispatcher\Event {
    */
   public $analyzer;
 
+  /**
+   * @param $analyzer
+   */
   public function __construct($analyzer) {
     $this->analyzer = $analyzer;
   }
index b31adcded567a7fe54563288aaf291c09a0f706b..db794dbd96b2763199ee67445ee19ab91e9028da 100644 (file)
  */
 namespace Civi\CCase;
 
+/**
+ * Class Events
+ *
+ * @package Civi\CCase
+ */
 class Events {
   /**
    * @var array (int $caseId => bool $active) list of cases for which we are actively firing case-change event
@@ -74,6 +79,9 @@ class Events {
     }
   }
 
+  /**
+   * @param $caseId
+   */
   public static function fireCaseChangeForRealz($caseId) {
     if (!isset(self::$isActive[$caseId])) {
       $tx = new \CRM_Core_Transaction();
index da80ed3d22fa60d6d6bc3602622dd4853ed3f864..9a23be272f84471b9600bf61bc55f7b8b564ca52 100644 (file)
@@ -1,6 +1,11 @@
 <?php
 namespace Civi\CCase\Exception;
 
+/**
+ * Class MultipleActivityException
+ *
+ * @package Civi\CCase\Exception
+ */
 class MultipleActivityException extends \CRM_Core_Exception {
 
 }
index d2d9858035de4fed0db85813e4a99fe955e7a9b0..5d40b49628b609fd54d176343c1a69df06b42ca0 100644 (file)
@@ -25,10 +25,18 @@ class SequenceListener implements CaseChangeListener {
     return self::$singleton;
   }
 
+  /**
+   * @param \Civi\CCase\Event\CaseChangeEvent $event
+   */
   public static function onCaseChange_static(\Civi\CCase\Event\CaseChangeEvent $event) {
     self::singleton()->onCaseChange($event);
   }
 
+  /**
+   * @param \Civi\CCase\Event\CaseChangeEvent $event
+   *
+   * @throws \CiviCRM_API3_Exception
+   */
   public function onCaseChange(\Civi\CCase\Event\CaseChangeEvent $event) {
     /** @var \Civi\CCase\Analyzer $analyzer */
     $analyzer = $event->analyzer;
index 2c28c1383c74d5cb893e166037880940e7106efe..f34954c1d339b00df6d00571abf4766d72cf5128 100644 (file)
@@ -1,7 +1,18 @@
 <?php
 namespace Civi\CiUtil;
 
+/**
+ * Class Arrays
+ *
+ * @package Civi\CiUtil
+ */
 class Arrays {
+  /**
+   * @param $arr
+   * @param $col
+   *
+   * @return array
+   */
   public static function collect($arr, $col) {
     $r = array();
     foreach ($arr as $k => $item) {
index 46441305b35f2605e6872a48f4dac5c54b58382a..1f9e9335f669f49bfed049628262d4d86f639f47 100644 (file)
@@ -1,7 +1,15 @@
 <?php
 namespace Civi\CiUtil\Command;
 
+/**
+ * Class AntagonistCommand
+ *
+ * @package Civi\CiUtil\Command
+ */
 class AntagonistCommand {
+  /**
+   * @param $argv
+   */
   public static function main($argv) {
     if (count($argv) != 3) {
       print "usage: {$argv[0]} <TargetTest::testFunc> </path/to/suite>\n";
index 03c8b8d72a52514a38131af3fcfb419c787bdaed..ae8bd6d3f02647286d56636a3e6598591ba4a8ad 100644 (file)
@@ -1,7 +1,15 @@
 <?php
 namespace Civi\CiUtil\Command;
 
+/**
+ * Class CompareCommand
+ *
+ * @package Civi\CiUtil\Command
+ */
 class CompareCommand {
+  /**
+   * @param $argv
+   */
   public static function main($argv) {
     if (empty($argv[1])) {
       echo "summary: Compares the output of different test runs\n";
index 8cdb679b052f91a6be35693ef11247f3a0fe6671..88f0d84947e30db2755c4e40193e7a42bd656bf6 100644 (file)
@@ -7,6 +7,9 @@ namespace Civi\CiUtil\Command;
  * @package Civi\CiUtil\Command
  */
 class LsCommand {
+  /**
+   * @param $argv
+   */
   public static function main($argv) {
     $paths = $argv;
     array_shift($paths);
index bb75ad68ac841430af5dc21597126899b8f79970..a58a83eb6704af9b2d420099d1d623ea1dbc37e6 100644 (file)
@@ -1,10 +1,18 @@
 <?php
 namespace Civi\CiUtil;
 
+/**
+ * Class ComparisonPrinter
+ *
+ * @package Civi\CiUtil
+ */
 class ComparisonPrinter {
   var $headers;
   var $hasHeader = FALSE;
 
+  /**
+   * @param $headers
+   */
   public function __construct($headers) {
     $this->headers = $headers;
   }
@@ -35,6 +43,10 @@ class ComparisonPrinter {
     $this->hasHeader = TRUE;
   }
 
+  /**
+   * @param $test
+   * @param $values
+   */
   public function printRow($test, $values) {
     $this->printHeader();
     printf("%-90s ", $test);
index 9fe7d97fef50b7bfe538dd4f4eaacc2350d1e63f..4c4ec185a3efbd5d542725af792503a1549dbbbf 100644 (file)
@@ -1,11 +1,20 @@
 <?php
 namespace Civi\CiUtil;
 
+/**
+ * Class CsvPrinter
+ *
+ * @package Civi\CiUtil
+ */
 class CsvPrinter {
   var $file;
   var $headers;
   var $hasHeader = FALSE;
 
+  /**
+   * @param $file
+   * @param $headers
+   */
   public function __construct($file, $headers) {
     $this->file = fopen($file, "w");
     $this->headers = $headers;
@@ -23,6 +32,10 @@ class CsvPrinter {
     $this->hasHeader = TRUE;
   }
 
+  /**
+   * @param $test
+   * @param $values
+   */
   public function printRow($test, $values) {
     $this->printHeader();
     $row = $values;
index 6ab005fc489fbd6ed9166a36fd40e0607e78fc41..f5e0502758cf45b9df5fbf5e7b2ee623f575c058 100644 (file)
@@ -8,6 +8,10 @@ class EnvTestRunner {
   protected $phpunit;
   protected $envTestSuite;
 
+  /**
+   * @param string $phpunit
+   * @param string $envTestSuite
+   */
   public function __construct($phpunit = "phpunit", $envTestSuite = 'EnvTests') {
     $this->phpunit = $phpunit;
     $this->envTestSuite = $envTestSuite;
index 5ba051a7e2c3d8cfa00eb7eb8f689439fef9a4f6..b231d42c44da1919792d1e93c8528167d0adf024 100644 (file)
@@ -43,6 +43,10 @@ class PostDelete extends \Symfony\Component\EventDispatcher\Event {
    */
   public $result;
 
+  /**
+   * @param $object
+   * @param $result
+   */
   public function __construct($object, $result) {
     $this->object = $object;
     $this->result = $result;
index fcbd6081bbb4c2e469b5190e65dab56172212fb1..72dbeab2d9478b2dbf61e9c42cfb3f7102578aef 100644 (file)
@@ -38,6 +38,9 @@ class PostUpdate extends \Symfony\Component\EventDispatcher\Event {
    */
   public $object;
 
+  /**
+   * @param $object
+   */
   public function __construct($object) {
     $this->object = $object;
   }
index d71de10b68418d3fe50dc7b6681b7642a2c84aab..879f66c091d616cd641e7c5b2c0cc07589d3d037 100644 (file)
@@ -53,6 +53,12 @@ class PostEvent extends \Symfony\Component\EventDispatcher\Event {
    */
   public $object;
 
+  /**
+   * @param $action
+   * @param $entity
+   * @param $id
+   * @param $object
+   */
   public function __construct($action, $entity, $id, $object) {
     $this->action = $action;
     $this->entity = $entity;
index 8a59f8847a8215f3c22a00e672d63bbccddfa279..e8e15eb07ecdfa3c2155e27a0d5494db5366a9ea 100644 (file)
@@ -53,6 +53,12 @@ class PreEvent extends \Symfony\Component\EventDispatcher\Event {
    */
   public $params;
 
+  /**
+   * @param $action
+   * @param $entity
+   * @param $id
+   * @param $params
+   */
   public function __construct($action, $entity, $id, $params) {
     $this->action = $action;
     $this->entity = $entity;
index 547f882f7c2a48cfbce12fee9e6e08a0c6bb6735..42270723b0ad494e517673ba8d5bf74d04573376 100644 (file)
@@ -43,6 +43,10 @@ class UnhandledExceptionEvent extends \Symfony\Component\EventDispatcher\Event {
    */
   public $request;
 
+  /**
+   * @param $e
+   * @param $request
+   */
   public function __construct($e, $request) {
     $this->request = $request;
     $this->exception = $e;
index cb085c3ba40485514c2b295670bc367b3b2134f1..cf7fb75c92ed4028ea6d8aa872bdbc6fe070af1a 100644 (file)
@@ -99,10 +99,16 @@ class Frame {
     $this->refCount--;
   }
 
+  /**
+   * @return bool
+   */
   public function isEmpty() {
     return ($this->refCount == 0);
   }
 
+  /**
+   * @return bool
+   */
   public function isRollbackOnly() {
     return !$this->doCommit;
   }
index 8629359f219541ed41e2e930bdee26f6ac64dc68..2bb9dcdd76fb9c2d10f78e1707e2ba19286a818d 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 /**
+ * @file
  * File for the CiviCRM APIv3 API wrapper
  *
  * @package CiviCRM_APIv3
@@ -23,6 +24,8 @@ class API_Exception extends Exception {
   private $extraParams = array();
 
   /**
+   * Class constructor.
+   *
    * @param string $message
    *   The human friendly error message.
    * @param mixed $error_code
@@ -48,7 +51,8 @@ class API_Exception extends Exception {
   }
 
   /**
-   * custom string representation of object
+   * Custom string representation of object.
+   *
    * @return string
    */
   public function __toString() {
@@ -56,6 +60,8 @@ class API_Exception extends Exception {
   }
 
   /**
+   * Get extra parameters.
+   *
    * @return array
    */
   public function getExtraParams() {
@@ -63,6 +69,8 @@ class API_Exception extends Exception {
   }
 
   /**
+   * Get error codes.
+   *
    * @return array
    */
   public function getErrorCodes() {
@@ -85,6 +93,8 @@ class CiviCRM_API3_Exception extends Exception {
   private $extraParams = array();
 
   /**
+   * Class constructor.
+   *
    * @param string $message
    *   The human friendly error message.
    * @param mixed $error_code
@@ -103,7 +113,8 @@ class CiviCRM_API3_Exception extends Exception {
   }
 
   /**
-   * custom string representation of object
+   * Custom string representation of object.
+   *
    * @return string
    */
   public function __toString() {
@@ -111,6 +122,8 @@ class CiviCRM_API3_Exception extends Exception {
   }
 
   /**
+   * Get error code.
+   *
    * @return mixed
    */
   public function getErrorCode() {
@@ -118,6 +131,8 @@ class CiviCRM_API3_Exception extends Exception {
   }
 
   /**
+   * Get extra parameters.
+   *
    * @return array
    */
   public function getExtraParams() {
index 4df24d242fba6b3267bda14a6bc90b1110a1fe51..6c9dad30e607e7406da136751b1fb1e9c1669a8e 100644 (file)
@@ -6,6 +6,8 @@
 interface API_Wrapper {
 
   /**
+   * Interface for interpreting api input.
+   *
    * @param array $apiRequest
    *
    * @return array
@@ -14,6 +16,8 @@ interface API_Wrapper {
   public function fromApiInput($apiRequest);
 
   /**
+   * Interface for interpreting api output.
+   *
    * @param array $apiRequest
    * @param array $result
    *
index 9425c81057f3784d785ba656636f93b572045aca..6c263513e871deca72176ac02f4b600bda8b387c 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 
 /**
- * File for the CiviCRM APIv3 API wrapper
+ * @file
+ * File for the CiviCRM APIv3 API wrapper.
  *
  * @package CiviCRM_APIv3
  * @subpackage API
@@ -11,6 +12,8 @@
  */
 
 /**
+ * CiviCRM API wrapper function.
+ *
  * @param string $entity
  *   type of entities to deal with
  * @param string $action
@@ -26,7 +29,9 @@ function civicrm_api($entity, $action, $params, $extra = NULL) {
 }
 
 /**
- * Version 3 wrapper for civicrm_api. Throws exception
+ * Version 3 wrapper for civicrm_api.
+ *
+ * Throws exception.
  *
  * @param string $entity
  *   Type of entities to deal with.
@@ -48,7 +53,9 @@ function civicrm_api3($entity, $action, $params = array()) {
 }
 
 /**
- * Call getfields from api wrapper. This function ensures that settings that
+ * Call getfields from api wrapper.
+ *
+ * This function ensures that settings that
  * could alter getfields output (e.g. action for all api & profile_id for
  * profile api ) are consistently passed in.
  *
@@ -59,6 +66,7 @@ function civicrm_api3($entity, $action, $params = array()) {
  * @todo other output modifiers include contact_type
  *
  * @param array $apiRequest
+ *
  * @return array
  *   getfields output
  */
@@ -102,6 +110,8 @@ function civicrm_error($result) {
 }
 
 /**
+ * Get camel case version of entity or action name.
+ *
  * @param $entity
  *
  * @return string
@@ -111,7 +121,9 @@ function _civicrm_api_get_camel_name($entity) {
 }
 
 /**
- * Swap out any $values vars - ie. the value after $value is swapped for the parent $result
+ * Swap out any $values vars.
+ *
+ * Ie. the value after $value is swapped for the parent $result
  * 'activity_type_id' => '$value.testfield',
  * 'tag_id'  => '$value.api.tag.create.id',
  * 'tag1_id' => '$value.api.entity.create.0.id'
@@ -156,11 +168,12 @@ function _civicrm_api_replace_variables(&$params, &$parentResult, $separator = '
 }
 
 /**
- * Convert possibly camel name to underscore separated entity name
+ * Convert possibly camel name to underscore separated entity name.
  *
  * @param string $entity
  *   Entity name in various formats e.g. Contribution, contribution,
  *   OptionValue, option_value, UFJoin, uf_join.
+ *
  * @return string
  *   Entity name in underscore separated format.
  *
@@ -181,9 +194,11 @@ function _civicrm_api_get_entity_name_from_camel($entity) {
 }
 
 /**
- * Having a DAO object find the entity name
+ * Having a DAO object find the entity name.
+ *
  * @param object $bao
  *   DAO being passed in.
+ *
  * @return string
  */
 function _civicrm_api_get_entity_name_from_dao($bao) {
index c2ae50b8c73dca3c0baa14ed481581a0caccf787..7a5f72cdec04c95a304e4a94ea056d892d2cf0ee 100644 (file)
@@ -79,6 +79,8 @@
 class civicrm_api3 {
 
   /**
+   * Class constructor.
+   *
    * @param array $config API configuration.
    */
   public function __construct($config = NULL) {
@@ -126,6 +128,8 @@ class civicrm_api3 {
   }
 
   /**
+   * Convert to string.
+   *
    * @return string
    */
   public function __toString() {
@@ -133,9 +137,11 @@ class civicrm_api3 {
   }
 
   /**
-   * Perform action
+   * Perform action.
+   *
    * @param $action
    * @param $params
+   *
    * @return bool
    */
   public function __call($action, $params) {
@@ -149,7 +155,8 @@ class civicrm_api3 {
   }
 
   /**
-   *  As of PHP 5.3.0
+   * As of PHP 5.3.0.
+   *
    * @param $name
    * @param $arguments
    */
@@ -159,10 +166,12 @@ class civicrm_api3 {
   }
 
   /**
-   * Call via rest
+   * Call via rest.
+   *
    * @param $entity
    * @param $action
    * @param array $params
+   *
    * @return \stdClass
    */
   public function remoteCall($entity, $action, $params = array()) {
@@ -208,6 +217,8 @@ class civicrm_api3 {
   }
 
   /**
+   * Call api function.
+   *
    * @param $entity
    * @param string $action
    * @param array $params
@@ -269,15 +280,18 @@ class civicrm_api3 {
   }
 
   /**
-   * Initialize
+   * Initialize.
    */
   public function init() {
     CRM_Core_DAO::init($this->cfg->dsn);
   }
 
   /**
+   * Get attribute.
+   *
    * @param $name
    * @param null $value
+   *
    * @return $this
    */
   public function attr($name, $value = NULL) {
@@ -293,6 +307,8 @@ class civicrm_api3 {
   }
 
   /**
+   * Is this an error.
+   *
    * @return bool
    */
   public function is_error() {
@@ -300,7 +316,10 @@ class civicrm_api3 {
   }
 
   /**
+   * Check if var is set.
+   *
    * @param string $name
+   *
    * @return bool
    */
   public function is_set($name) {
@@ -308,7 +327,10 @@ class civicrm_api3 {
   }
 
   /**
-   * @param $name
+   * Get object.
+   *
+   * @param string $name
+   *
    * @return $this
    */
   public function __get($name) {
index 7c8763ef34b2c23f80ca7284a9d07c1af5233c82..31775ea8c035a617013bafa6cd82216e445b55a0 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_acl_role
- *
  */
 
 /**
- * Save an acl_role
+ * Save an acl_role.
  *
  * Allowed @params array keys are:
- * {@getfields acl_role_create}
- * @example acl_roleCreate.php
  *
  * @param array $params
  *
@@ -50,11 +47,7 @@ function civicrm_api3_acl_role_create($params) {
 }
 
 /**
- * Get an acl_role
- *
- * Allowed @params array keys are:
- * {@getfields acl_role_get}
- * @example acl_roleCreate.php
+ * Get an acl_role.
  *
  * @param array $params
  *
@@ -66,11 +59,7 @@ function civicrm_api3_acl_role_get($params) {
 }
 
 /**
- * Delete an acl_role
- *
- * Allowed @params array keys are:
- * {@getfields acl_role_delete}
- * @example acl_roleCreate.php
+ * Delete an acl_role.
  *
  * @param array $params
  *
index e37f97321304c24adebbea4b8d8e8238cc2717a2..ed0c42605cede441acaa9ddf4c7e50cef18d5ac1 100644 (file)
  * @subpackage API_ActionSchedule
  *
  * @copyright CiviCRM LLC (c) 2004-2014
- *
  */
 
 /**
- * Get CiviCRM Action Schedule details
- * {@getfields action_schedule_create}
+ * Get CiviCRM Action Schedule details.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_action_schedule_get($params) {
@@ -47,13 +47,11 @@ function civicrm_api3_action_schedule_get($params) {
 
 
 /**
- * Create a new Action Schedule
+ * Create a new Action Schedule.
  *
  * @param array $params
  *
  * @return array
- *
- *   {@getfields action_schedule_create}
  */
 function civicrm_api3_action_schedule_create($params) {
   civicrm_api3_verify_one_mandatory($params, NULL, array('start_action_date', 'absolute_date'));
@@ -74,12 +72,11 @@ function civicrm_api3_action_schedule_create($params) {
 function _civicrm_api3_action_schedule_create_spec(&$params) {
   $params['title']['api.required'] = TRUE;
   $params['mapping_id']['api.required'] = TRUE;
-  //  $params['entity_status']['api.required'] = TRUE;
   $params['entity_value']['api.required'] = TRUE;
 }
 
 /**
- * delete an existing action_schedule
+ * Delete an existing action_schedule.
  *
  * @param array $params
  *   Array containing id of the action_schedule.
@@ -87,7 +84,6 @@ function _civicrm_api3_action_schedule_create_spec(&$params) {
  *
  * @return array
  *   API result array
- *
  */
 function civicrm_api3_action_schedule_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 2d006ce781e392143cf94bd32a5f207b8dc3619d..d140f2d94a68c110f0c369cf6752b8a6b75ca697 100644 (file)
  * @subpackage API_Activity
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Activity.php 30486 2010-11-02 16:12:09Z shot $
- *
  */
 
 
 /**
- * Creates or updates an Activity. See the example for usage
+ * Creates or updates an Activity.
  *
  * @param array $params
- *   Associative array of property name/value.
- *                             pairs for the activity.
- * {@getfields activity_create}
+ *  Array per getfields documentation.
  *
  * @throws API_Exception
  * @return array
- *   Array containing 'is_error' to denote success or failure and details of the created activity
- *
- * @example ActivityCreate.php Standard create example
- * @example Activity/ContactRefCustomField.php Create example including setting a contact reference custom field
- * {@example ActivityCreate.php 0}
+ *   Array containing 'is_error' to denote success or failure and details of the created activity.
  */
 function civicrm_api3_activity_create($params) {
 
@@ -182,14 +175,17 @@ function civicrm_api3_activity_create($params) {
 }
 
 /**
- * Specify Meta data for create. Note that this data is retrievable via the getfields function
- * and is used for pre-filling defaults and ensuring mandatory requirements are met.
+ * Specify Meta data for create.
+ *
+ * Note that this data is retrievable via the getfields function and is used for pre-filling defaults and
+ * ensuring mandatory requirements are met.
+ *
  * @param array $params
- *   (reference) array of parameters determined by getfields.
+ *  Array of parameters determined by getfields.
  */
 function _civicrm_api3_activity_create_spec(&$params) {
 
-  //default for source_contact_id = currently logged in user
+  // Default for source_contact_id = currently logged in user.
   $params['source_contact_id']['api.default'] = 'user_contact_id';
 
   $params['status_id']['api.aliases'] = array('activity_status');
@@ -218,23 +214,18 @@ function _civicrm_api3_activity_create_spec(&$params) {
 }
 
 /**
- * Gets a CiviCRM activity according to parameters
+ * Gets a CiviCRM activity according to parameters.
  *
  * @param array $params
- *   Associative array of property name/value.
- *                             pairs for the activity.
+ *   Array per getfields documentation.
  *
  * @return array
- *
- *   {@getfields activity_get}
- * @example ActivityGet.php Basic example
- * @example Activity/DateTimeHigh.php Example get with date filtering
- * {@example ActivityGet.php 0}
  */
 function civicrm_api3_activity_get($params) {
   if (!empty($params['contact_id'])) {
     $activities = CRM_Activity_BAO_Activity::getContactActivity($params['contact_id']);
-    //BAO function doesn't actually return a contact ID - hack api for now & add to test so when api re-write happens it won't get missed
+    // BAO function doesn't actually return a contact ID - hack api for now & add to test so when api re-write
+    // happens it won't get missed.
     foreach ($activities as $key => $activityArray) {
       $activities[$key]['id'] = $key;
     }
@@ -253,13 +244,14 @@ function civicrm_api3_activity_get($params) {
 }
 
 /**
- * Given a list of activities, append any extra data requested about the activities
+ * Given a list of activities, append any extra data requested about the activities.
  *
  * NOTE: Called by civicrm-core and CiviHR
  *
  * @param array $params
  *   API request parameters.
  * @param array $activities
+ *
  * @return array
  *   new activities list
  */
@@ -319,16 +311,10 @@ function _civicrm_api3_activity_get_formatResult($params, $activities) {
  *
  * @param array $params
  *   Array holding 'id' of activity to be deleted.
- * {@getfields activity_delete}
  *
  * @throws API_Exception
- * @return void|CRM_Core_Error  An error if 'activityName or ID' is invalid,
- *                         permissions are insufficient, etc. or CiviCRM success array
- *
- *
- *
- * @example ActivityDelete.php Standard Delete Example
  *
+ * @return array
  */
 function civicrm_api3_activity_delete($params) {
 
@@ -341,7 +327,7 @@ function civicrm_api3_activity_delete($params) {
 }
 
 /**
- * Check for required params
+ * Check for required params.
  *
  * @param array $params
  *   Associated array of fields.
@@ -385,7 +371,7 @@ SELECT  count(*)
   FROM  civicrm_contact
  WHERE  id IN (' . implode(', ', $contactIds) . ' )';
     if (count($contactIds) != CRM_Core_DAO::singleValueQuery($sql)) {
-      throw new API_Exception('Invalid ' . ' Contact Id');
+      throw new API_Exception('Invalid Contact Id');
     }
   }
 
@@ -451,6 +437,8 @@ SELECT  count(*)
 }
 
 /**
+ * Get parameters for activity list.
+ *
  * @see _civicrm_api3_generic_getlist_params
  *
  * @param array $request
@@ -472,6 +460,8 @@ function _civicrm_api3_activity_getlist_params(&$request) {
 }
 
 /**
+ * Get output for activity list.
+ *
  * @see _civicrm_api3_generic_getlist_output
  *
  * @param array $result
index a2ea4899f6fd8c344919dd990da334539617bad0..d9220ac8ca67aeff0cddb8d65636078eccf9b34a 100644 (file)
  */
 
 /**
- *  Add a record relating a contact with an activity
- *
- * Allowed @params array keys are:
- *
- * @example ActivityContact.php
+ * Add a record relating a contact with an activity.
  *
  * @param array $params
  *
  * @return array
- *   Array of newly created activity contact records.
+ *   API result array.
  */
 function civicrm_api3_activity_contact_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -65,14 +61,12 @@ function _civicrm_api3_activity_contact_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing ActivityContact record
+ * Delete an existing ActivityContact record.
  *
  * @param array $params
  *
  * @return array
  *   Api Result
- *
- * @example ActivityContact.php
  */
 function civicrm_api3_activity_contact_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -81,14 +75,11 @@ function civicrm_api3_activity_contact_delete($params) {
 /**
  * Get a ActivityContact.
  *
- * @example ActivityContact.php
- *
  * @param array $params
  *   An associative array of name/value pairs.
  *
  * @return array
  *   details of found tags else error
- *
  */
 function civicrm_api3_activity_contact_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index d1705c641a9651836723956fe4010485489e318f..5affa0690c6e5b39c5254e5945b8be9524f9801f 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: ActivityType.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
+ * Notification of deprecated function.
+ *
  * @deprecated api notice
  * @return string
  *   to indicate this entire api entity is deprecated
@@ -46,7 +47,7 @@ function _civicrm_api3_activity_type_deprecation() {
 }
 
 /**
- * retrieve activity types
+ * Retrieve activity types.
  *
  * @param array $params
  *
@@ -61,7 +62,7 @@ function civicrm_api3_activity_type_get($params) {
 }
 
 /**
- * create activity type (
+ * Create activity type.
  *
  * @param array $params
  *
@@ -101,11 +102,11 @@ function _civicrm_api3_activity_type_create_spec(&$params) {
 }
 
 /**
- * delete activity type
+ * Delete activity type.
  *
  * @param array $params
  *   Array including id of activity_type to delete.
-
+ *
  * @return array
  *   API result array
  *
index 6cbf1d9e72923425d3bf98b4a6f6b33469bb92bc..472e85fc0be99600baf24dee0b43355bdeb485ba 100644 (file)
  */
 
 /**
- *  Add an Address for a contact
- *
- * Allowed @params array keys are:
- * {@getfields address_create}
- * {@example AddressCreate.php}
+ * Add an Address for a contact.
  *
  * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array
  *   Array of newly created tag property values.
@@ -108,10 +105,10 @@ function _civicrm_api3_address_create_spec(&$params) {
   );
 }
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * @param array $params
- *   Array or parameters determined by getfields.
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_address_get_spec(&$params) {
   $params['world_region'] = array(
@@ -122,12 +119,10 @@ function _civicrm_api3_address_get_spec(&$params) {
 }
 
 /**
- * Deletes an existing Address
+ * Delete an existing Address.
  *
  * @param array $params
- *
- * {@getfields address_delete}
- * {@example AddressDelete.php 0}
+ *   Array per getfields metadata.
  *
  * @return array
  *   api result array
@@ -137,11 +132,10 @@ function civicrm_api3_address_delete($params) {
 }
 
 /**
- * Retrieve one or more addresses on address_id, contact_id, street_name, city
- * or a combination of those
+ * Retrieve one or more addresses.
  *
  * @param array $params
- *   An associative array of name/value pairs.
+ *   Array per getfields metadata.
  *
  * @return array
  *   details of found addresses else error
index ccd87b143ac74653473947b9b2a6d1345bddc3ef..455fd96517e2ccbf1368a895333360b3176668cd 100644 (file)
  * @subpackage API_Attachment
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: $
- *
  */
 
 /**
- * Adjust metadata for "create" action
+ * Adjust metadata for "create" action.
  *
  * @param array $spec
  *   List of fields.
@@ -85,9 +84,10 @@ function _civicrm_api3_attachment_create_spec(&$spec) {
 }
 
 /**
- * Create an attachment
+ * Create an attachment.
  *
  * @param array $params
+ *
  * @return array
  *   Array of newly created file property values.
  * @throws API_Exception validation errors
@@ -152,7 +152,7 @@ function civicrm_api3_attachment_create($params) {
 }
 
 /**
- * Adjust metadata for "create" action
+ * Adjust metadata for get action.
  *
  * @param array $spec
  *   List of fields.
@@ -162,7 +162,10 @@ function _civicrm_api3_attachment_get_spec(&$spec) {
 }
 
 /**
+ * Get attachment.
+ *
  * @param array $params
+ *
  * @return array
  *   per APIv3
  * @throws API_Exception validation errors
@@ -179,6 +182,8 @@ function civicrm_api3_attachment_get($params) {
 }
 
 /**
+ * Adjust metadata for attachment delete action.
+ *
  * @param $spec
  */
 function _civicrm_api3_attachment_delete_spec(&$spec) {
@@ -191,7 +196,10 @@ function _civicrm_api3_attachment_delete_spec(&$spec) {
 }
 
 /**
+ * Delete attachment.
+ *
  * @param array $params
+ *
  * @return array
  * @throws API_Exception
  */
@@ -235,6 +243,8 @@ function civicrm_api3_attachment_delete($params) {
 }
 
 /**
+ * Attachment find helper.
+ *
  * @param array $params
  * @param int|null $id the user-supplied ID of the attachment record
  * @param array $file
@@ -242,6 +252,7 @@ function civicrm_api3_attachment_delete($params) {
  * @param array $entityFile
  *   The user-supplied values of the entity-file (entity_table, entity_id).
  * @param bool $isTrusted
+ *
  * @return CRM_Core_DAO
  * @throws API_Exception
  */
@@ -267,14 +278,14 @@ function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTru
   if ($id) {
     $select->where('cf.id = #id', array('#id' => $id));
   }
-  // recall: $file is filtered by parse_params
+  // Recall: $file is filtered by parse_params.
   foreach ($file as $key => $value) {
     $select->where('cf.!field = @value', array(
       '!field' => $key,
       '@value' => $value,
     ));
   }
-  // recall: $entityFile is filtered by parse_params
+  // Recall: $entityFile is filtered by parse_params.
   foreach ($entityFile as $key => $value) {
     $select->where('cef.!field = @value', array(
       '!field' => $key,
@@ -295,8 +306,12 @@ function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTru
 }
 
 /**
+ * Attachment parsing helper.
+ *
  * @param array $params
- * @return array (0 => int $id, 1 => array $file, 2 => array $entityFile, 3 => string $name, 4 => string $content,
+ *
+ * @return array
+ *   (0 => int $id, 1 => array $file, 2 => array $entityFile, 3 => string $name, 4 => string $content,
  *    5 => string $moveFile, 6 => $isTrusted, 7 => bool $returnContent)
  *    - array $file: whitelisted fields that can pass through directly to civicrm_file
  *    - array $entityFile: whitelisted fields that can pass through directly to civicrm_entity_file
@@ -357,6 +372,8 @@ function _civicrm_api3_attachment_parse_params($params) {
 }
 
 /**
+ * Attachment result formatting helper.
+ *
  * @param CRM_Core_DAO_File $fileDao
  *   Maybe "File" or "File JOIN EntityFile".
  * @param CRM_Core_DAO_EntityFile $entityFileDao
@@ -365,6 +382,7 @@ function _civicrm_api3_attachment_parse_params($params) {
  *   Whether to return the full content of the file.
  * @param bool $isTrusted
  *   Whether the current request is trusted to perform file-specific operations.
+ *
  * @return array
  */
 function _civicrm_api3_attachment_format_result($fileDao, $entityFileDao, $returnContent, $isTrusted) {
@@ -397,6 +415,8 @@ function _civicrm_api3_attachment_format_result($fileDao, $entityFileDao, $retur
 }
 
 /**
+ * Attachment getfields helper.
+ *
  * @return array
  *   list of fields (indexed by name)
  */
@@ -415,7 +435,8 @@ function _civicrm_api3_attachment_getfields() {
   $spec['description'] = $fileFields['description'];
   $spec['upload_date'] = $fileFields['upload_date'];
   $spec['entity_table'] = $entityFileFields['entity_table'];
-  $spec['entity_table']['title'] = CRM_Utils_Array::value('title', $spec['entity_table'], 'Entity Table') . ' (write-once)'; // would be hard to securely handle changes
+  // Would be hard to securely handle changes.
+  $spec['entity_table']['title'] = CRM_Utils_Array::value('title', $spec['entity_table'], 'Entity Table') . ' (write-once)';
   $spec['entity_id'] = $entityFileFields['entity_id'];
   $spec['entity_id']['title'] = CRM_Utils_Array::value('title', $spec['entity_id'], 'Entity ID') . ' (write-once)'; // would be hard to securely handle changes
   $spec['url'] = array(
index dee694cd52cb73d6be06ba18b964bad9f8cfb19e..d9524ffc51861dd9c9da6fd9b7301f7a16f25a14 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_Batch
- *
  */
 
 /**
- * Save a Batch
- *
- * Allowed @params array keys are:
- * {@getfields batch_create}
- * @example BatchCreate.php
+ * Save a Batch.
  *
  * @param array $params
  *
@@ -71,11 +66,7 @@ function _civicrm_api3_batch_create_spec(&$params) {
 }
 
 /**
- * Get a Batch
- *
- * Allowed @params array keys are:
- * {@getfields batch_get}
- * @example BatchCreate.php
+ * Get a Batch.
  *
  * @param array $params
  *
@@ -87,11 +78,7 @@ function civicrm_api3_batch_get($params) {
 }
 
 /**
- * Delete a Batch
- *
- * Allowed @params array keys are:
- * {@getfields batch_delete}
- * @example BatchCreate.php
+ * Delete a Batch.
  *
  * @param array $params
  *
index 569867dae9e75c62c253b8ec20f0af62279927eb..e33b2edc75522af56afdfe15cdbbbfcf010621ca 100644 (file)
@@ -61,7 +61,7 @@ function _civicrm_api3_campaign_create_spec(&$params) {
 }
 
 /**
- * Returns array of campaigns  matching a set of one or more group properties
+ * Returns array of campaigns  matching a set of one or more group properties.
  *
  * @param array $params
  *   Array per getfields
@@ -74,7 +74,7 @@ function civicrm_api3_campaign_get($params) {
 }
 
 /**
- * delete an existing campaign
+ * Delete an existing campaign.
  *
  * This method is used to delete any existing campaign. id of the group
  * to be deleted is required field in $params array
index fa1fee74bef973f2f8ed556dcbd6fbf5d2fdfc95..54549943943e90bd563564be36c25c2624635370 100644 (file)
@@ -268,7 +268,9 @@ SELECT DISTINCT case_id
 }
 
 /**
- * Deprecated. Use activity API instead
+ * Deprecated API.
+ *
+ * Use activity API instead.
  *
  * @param array $params
  *
@@ -283,6 +285,8 @@ function civicrm_api3_case_activity_create($params) {
 }
 
 /**
+ * Declare deprecated api functions.
+ *
  * @deprecated api notice
  * @return array
  *   Array of deprecated actions
@@ -430,7 +434,7 @@ function _civicrm_api3_case_read($caseId, $options) {
 }
 
 /**
- * Internal function to format create params for processing
+ * Internal function to format create params for processing.
  *
  * @param array $params
  */
@@ -444,7 +448,7 @@ function _civicrm_api3_case_format_params(&$params) {
     if (!$params['case_type_id']) {
       $caseTypeLabels = CRM_Case_PseudoConstant::caseType('title', FALSE);
       $params['case_type_id'] = array_search($params['case_type'], $caseTypeLabels);
-      $params['case_type'] = $caseTypes[$params['case_type_id']]; // label => name
+      $params['case_type'] = $caseTypes[$params['case_type_id']];
     }
   }
   elseif (empty($params['case_type'])) {
index 3d00eca7af84609ed8ea5a7087193889cdf7e6b1..90f8e1b7ebf031b973494613c3d17c2e1164380e 100644 (file)
  * @package CiviCRM_APIv3
  * @subpackage API_Case
  * @copyright CiviCRM LLC (c) 2004-2014
- *
  */
 
 /**
- * create or update case type
+ * Create or update case type.
  *
  * @param array $params
  *   Input parameters.
  *
- * Allowed @params array keys are:
- * {@getfields case_type_create}
- *
  * @throws API_Exception
  * @return array
  *   API result array
- *
  */
 function civicrm_api3_case_type_create($params) {
   civicrm_api3_verify_mandatory($params, _civicrm_api3_get_DAO(__FUNCTION__));
-  unset($params['is_forkable']); // computed property
-  unset($params['is_forked']); // computed property
+  // Computed properties.
+  unset($params['is_forkable']);
+  unset($params['is_forked']);
 
   if (!array_key_exists('is_active', $params) && empty($params['id'])) {
     $params['is_active'] = TRUE;
   }
-  if (!empty($params['id']) // this is an existing case-type
+  // This is an existing case-type.
+  if (!empty($params['id'])
     && !CRM_Case_BAO_CaseType::isForked($params['id']) // which is not yet forked
     && !CRM_Case_BAO_CaseType::isForkable($params['id']) // for which new forks are prohibited
   ) {
@@ -68,7 +65,7 @@ function civicrm_api3_case_type_create($params) {
 }
 
 /**
- * retrieve case types
+ * Retrieve case types.
  *
  * @param array $params
  *
@@ -85,9 +82,10 @@ function civicrm_api3_case_type_get($params) {
 }
 
 /**
- * format definition
+ * Format definition.
  *
  * @param array $result
+ *
  * @return array
  * @throws \CRM_Core_Exception
  */
@@ -108,7 +106,7 @@ function _civicrm_api3_case_type_get_formatResult(&$result) {
 }
 
 /**
- * Function to delete case type
+ * Function to delete case type.
  *
  * @param array $params
  *   Array including id of case_type to delete.
index 5e379c7e540e9ac6bad0aae128454d280731b4ff..1b7363e4b01e811f91d847472f21ebcf4897f0de 100644 (file)
@@ -36,6 +36,8 @@
  */
 
 /**
+ * Declare deprecated api entity.
+ *
  * @deprecated api notice
  * @return string
  *   to indicate this entire api entity is deprecated
@@ -45,6 +47,8 @@ function _civicrm_api3_constant_deprecation() {
 }
 
 /**
+ * Get constant values (deprecated).
+ *
  * @deprecated as of CiviCRM 4.4.
  * It's recommended to use the api getoptions action instead
  *
@@ -93,9 +97,8 @@ function _civicrm_api3_constant_deprecation() {
  *    <li>worldRegion</li>
  *    <li>wysiwygEditor</li>
  *  </ul>
+ *
  * @return array
- * @example ConstantGet.php
- *  {@getfields constant_get}
  */
 function civicrm_api3_constant_get($params) {
 
@@ -137,6 +140,8 @@ function civicrm_api3_constant_get($params) {
 }
 
 /**
+ * Adjust metadata for constant get action.
+ *
  * @param array $params
  */
 function _civicrm_api3_constant_get_spec(&$params) {
index 14618f8c2911357cc301a1b094aa6d891742e14b..5d97e5362a4ee3f06a12f9c08de1eedf341a7999 100644 (file)
  * @subpackage API_Contact
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: Contact.php 30879 2010-11-22 15:45:55Z shot $
- *
  */
 
 /**
- * Create or update a contact (note you should always call this via civicrm_api() & never directly)
+ * Create or update a contact (note you should always call this via civicrm_api() & never directly).
  *
  * @param array $params
  *   Input parameters.
  *
- * Allowed @params array keys are:
- * {@getfields contact_create}
- *
- *
  * @throws API_Exception
- * @example ContactCreate.php Example of Create Call
  *
  * @return array
  *   API Result Array
- *
  */
 function civicrm_api3_contact_create($params) {
 
@@ -139,7 +132,9 @@ function _civicrm_api3_contact_create_spec(&$params) {
 }
 
 /**
- * Retrieve one or more contacts, given a set of search params
+ * Retrieve one or more contacts, given a set of search params.
+ *
+ * @param array $params
  *
  * @return array
  *   API Result Array
@@ -152,6 +147,8 @@ function civicrm_api3_contact_get($params) {
 }
 
 /**
+ * Get count of contact.
+ *
  * @param array $params
  *
  * @return int
@@ -164,7 +161,7 @@ function civicrm_api3_contact_getcount($params) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * @param array $params
  *   Array or parameters determined by getfields.
@@ -172,7 +169,7 @@ function civicrm_api3_contact_getcount($params) {
 function _civicrm_api3_contact_get_spec(&$params) {
   $params['contact_is_deleted']['api.default'] = 0;
 
-  //we declare all these pseudofields as there are other undocumented fields accessible
+  // We declare all these pseudoFields as there are other undocumented fields accessible
   // via the api - but if check permissions is set we only allow declared fields
   $params['address_id']['title'] = 'Primary Address ID';
   $params['street_address']['title'] = 'Primary Address Street Address';
@@ -212,6 +209,8 @@ function _civicrm_api3_contact_get_spec(&$params) {
 }
 
 /**
+ * Support for historical oddities.
+ *
  * We are supporting 'showAll' = 'all', 'trash' or 'active' for contact get
  * and for getcount
  * - hopefully some day we'll come up with a std syntax for the 3-way-boolean of
@@ -257,7 +256,7 @@ function _civicrm_api3_contact_get_supportanomalies(&$params, &$options) {
 }
 
 /**
- * Delete a contact with given contact id
+ * Delete a contact with given contact id.
  *
  * @param array $params
  *   input parameters per getfields
@@ -292,6 +291,10 @@ function civicrm_api3_contact_delete($params) {
 
 
 /**
+ * Check parameters passed in.
+ *
+ * This function is on it's way out.
+ *
  * @param array $params
  * @param bool $dupeCheck
  *
@@ -388,8 +391,7 @@ function _civicrm_api3_contact_check_params(&$params, $dupeCheck) {
 }
 
 /**
- * Takes an associative array and creates a contact object and all the associated
- * derived objects (i.e. individual, location, email, phone etc)
+ * Helper function for contact create.
  *
  * @param array $params
  *   (reference ) an assoc array of name/value pairs.
@@ -408,14 +410,12 @@ function _civicrm_api3_contact_update($params, $contactID = NULL) {
 }
 
 /**
- * Validate the addressee or email or postal greetings
+ * Validate the addressee or email or postal greetings.
  *
  * @param array $params
- *   Associative array of property name/value.
- *                                   pairs to insert in new contact.
+ *   Array per getfields metadata.
  *
  * @throws API_Exception
- *
  */
 function _civicrm_api3_greeting_format_params($params) {
   $greetingParams = array('', '_id', '_custom');
@@ -426,7 +426,7 @@ function _civicrm_api3_greeting_format_params($params) {
     }
 
     $formatParams = FALSE;
-    // unset display value from params.
+    // Unset display value from params.
     if (isset($params["{$key}{$greeting}_display"])) {
       unset($params["{$key}{$greeting}_display"]);
     }
@@ -535,12 +535,12 @@ function _civicrm_api3_greeting_format_params($params) {
 }
 
 /**
- * Old contact quick search api
+ * Old contact quick search api.
  *
  * @deprecated
  *
- * {@example ContactGetquick.php 0}
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -837,6 +837,8 @@ LIMIT    0, {$limit}
 }
 
 /**
+ * Declare deprecated api functions.
+ *
  * @deprecated api notice
  * @return array
  *   Array of deprecated actions
@@ -860,7 +862,6 @@ function _civicrm_api3_contact_deprecation() {
  *
  * @return array
  *   API Result Array
- *
  */
 function civicrm_api3_contact_merge($params) {
   $mode = CRM_Utils_Array::value('mode', $params, 'safe');
@@ -881,6 +882,8 @@ function civicrm_api3_contact_merge($params) {
 }
 
 /**
+ * Adjust metadata for contact_proximity api function.
+ *
  * @param array $params
  */
 function _civicrm_api3_contact_proximity_spec(&$params) {
@@ -893,6 +896,8 @@ function _civicrm_api3_contact_proximity_spec(&$params) {
 }
 
 /**
+ * Get contacts by proximity.
+ *
  * @param array $params
  *
  * @return array
@@ -944,6 +949,8 @@ WHERE     $whereClause
 
 
 /**
+ * Get parameters for getlist function.
+ *
  * @see _civicrm_api3_generic_getlist_params
  *
  * @param array $request
@@ -987,6 +994,8 @@ function _civicrm_api3_contact_getlist_params(&$request) {
 }
 
 /**
+ * Get output for getlist function.
+ *
  * @see _civicrm_api3_generic_getlist_output
  *
  * @param array $result
@@ -997,7 +1006,13 @@ function _civicrm_api3_contact_getlist_params(&$request) {
 function _civicrm_api3_contact_getlist_output($result, $request) {
   $output = array();
   if (!empty($result['values'])) {
-    $addressFields = array_intersect(array('street_address', 'city', 'state_province', 'country'), $request['params']['return']);
+    $addressFields = array_intersect(array(
+        'street_address',
+        'city',
+        'state_province',
+        'country',
+      ),
+      $request['params']['return']);
     foreach ($result['values'] as $row) {
       $data = array(
         'id' => $row[$request['id_field']],
index 4cffddfe82c87fbe53fcd18a533a3520637b7507..116fd8f037e5b25bd2ac84a322f2a77ac9e60605 100644 (file)
  */
 
 /**
- * create/update contact_type
+ * Create/update contact_type.
  *
  * This API is used to create new contact_type or update any of the existing
  * In case of updating existing contact_type, id of that particular contact_type must
  * be in $params array.
  *
  * @param array $params
- *   (reference) Associative array of property.
- *                       name/value pairs to insert in new 'contact_type'
+ *   Array per getfields metadata.
  *
  * @return array
  *   contact_type array
- *
  */
 function civicrm_api3_contact_type_create($params) {
   civicrm_api3_verify_mandatory($params, _civicrm_api3_get_DAO(__FUNCTION__), array('name', 'parent_id'));
@@ -65,7 +63,7 @@ function civicrm_api3_contact_type_create($params) {
 }
 
 /**
- * Returns array of contact_types  matching a set of one or more group properties
+ * Returns array of contact_types  matching a set of one or more group properties.
  *
  * @param array $params
  *   One or more valid.
@@ -81,7 +79,7 @@ function civicrm_api3_contact_type_get($params) {
 }
 
 /**
- * delete an existing contact_type
+ * Delete an existing contact_type.
  *
  * This method is used to delete any existing contact_type. id of the group
  * to be deleted is required field in $params array
@@ -92,7 +90,6 @@ function civicrm_api3_contact_type_get($params) {
  *
  * @return array
  *   API Result Array
- *
  */
 function civicrm_api3_contact_type_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index e97bff6c96c0c17324afcfef7842338d04f2712e..5c696661f583e983a27a22cbc18ba42e2e1c052f 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Contribution.php 30486 2010-11-02 16:12:09Z shot $
- *
  */
 
 /**
- * Add or update a contribution
+ * Add or update a contribution.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *   Input parameters.
  *
  * @throws API_Exception
  * @return array
@@ -64,7 +63,7 @@ function civicrm_api3_contribution_create(&$params) {
 
   _civicrm_api3_contribution_create_legacy_support_45($params);
 
-  // make sure tax calculation is handled via api
+  // Make sure tax calculation is handled via api.
   $params = CRM_Contribute_BAO_Contribution::checkTaxAmount($params);
 
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Contribution');
@@ -144,10 +143,12 @@ function _civicrm_api3_contribution_create_spec(&$params) {
 }
 
 /**
- * Support for schema changes made in 4.5
+ * Support for schema changes made in 4.5.
+ *
  * The main purpose of the API is to provide integrators a level of stability not provided by
  * the core code or schema - this means we have to provide support for api calls (where possible)
  * across schema changes.
+ *
  * @param array $params
  */
 function _civicrm_api3_contribution_create_legacy_support_45(&$params) {
@@ -169,13 +170,12 @@ function _civicrm_api3_contribution_create_legacy_support_45(&$params) {
 }
 
 /**
- * Delete a contribution
+ * Delete a contribution.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *   Input parameters.
  *
- * @return bool
- *   true if success, else false
+ * @return array
  */
 function civicrm_api3_contribution_delete($params) {
 
@@ -189,7 +189,10 @@ function civicrm_api3_contribution_delete($params) {
 }
 
 /**
- * modify metadata. Legacy support for contribution_id
+ * Modify metadata for delete action.
+ *
+ * Legacy support for contribution_id.
+ *
  * @param array $params
  */
 function _civicrm_api3_contribution_delete_spec(&$params) {
@@ -197,10 +200,10 @@ function _civicrm_api3_contribution_delete_spec(&$params) {
 }
 
 /**
- * Retrieve a set of contributions, given a set of input params
+ * Retrieve a set of contributions.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *  Input parameters.
  *
  * @return array
  *   Array of contributions, if error an array with an error id and error message
@@ -224,9 +227,11 @@ function civicrm_api3_contribution_get($params) {
 }
 
 /**
- * This function is used to format the soft credit for backward compatibility
- * as of v4.4 we support multiple soft credit, so now contribution returns array with 'soft_credit' as key
+ * This function is used to format the soft credit for backward compatibility.
+ *
+ * As of v4.4 we support multiple soft credit, so now contribution returns array with 'soft_credit' as key
  * but we still return first soft credit as a part of contribution array
+ *
  * @param $contribution
  */
 function _civicrm_api3_format_soft_credit(&$contribution) {
@@ -237,7 +242,7 @@ function _civicrm_api3_format_soft_credit(&$contribution) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -254,8 +259,10 @@ function _civicrm_api3_contribution_get_spec(&$params) {
 }
 
 /**
- * take the input parameter list as specified in the data model and
- * convert it into the same format that we use in QF and BAO object
+ * Legacy handling for contribution parameters.
+ *
+ * Take the input parameter list as specified in the data model and
+ * convert it into the same format that we use in QF and BAO object.
  *
  * @param array $params
  *   property name/value  pairs to insert in new contact.
@@ -271,7 +278,7 @@ function _civicrm_api3_contribute_format_params($params, &$values) {
 }
 
 /**
- * Adjust Metadata for Transact action
+ * Adjust Metadata for Transact action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -288,7 +295,7 @@ function _civicrm_api3_contribution_transact_spec(&$params) {
  * Process a transaction and record it against the contact.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *   Input parameters.
  *
  * @return array
  *   contribution of created or updated record (or a civicrm error)
@@ -328,7 +335,8 @@ function civicrm_api3_contribution_transact($params) {
 }
 
 /**
- * Send a contribution confirmation (receipt or invoice)
+ * Send a contribution confirmation (receipt or invoice).
+ *
  * The appropriate online template will be used (the existence of related objects
  * (e.g. memberships ) will affect this selection
  *
@@ -336,7 +344,6 @@ function civicrm_api3_contribution_transact($params) {
  *   Input parameters.
  *
  * @throws Exception
- *   Api result array.
  */
 function civicrm_api3_contribution_sendconfirmation($params) {
   $contribution = new CRM_Contribute_BAO_Contribution();
@@ -350,7 +357,7 @@ function civicrm_api3_contribution_sendconfirmation($params) {
 }
 
 /**
- * Adjust Metadata for sendconfirmation action
+ * Adjust Metadata for sendconfirmation action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -381,15 +388,16 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
 }
 
 /**
- * Complete an existing (pending) transaction, updating related entities (participant, membership, pledge etc)
- * and taking any complete actions from the contribution page (e.g. send receipt)
+ * Complete an existing (pending) transaction.
+ *
+ * This will update related entities (participant, membership, pledge etc)
+ * and take any complete actions from the contribution page (e.g. send receipt).
  *
  * @todo - most of this should live in the BAO layer but as we want it to be an addition
  * to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
  *
  * @param array $params
  *   Input parameters.
- * {@getfields Contribution_completetransaction}
  *
  * @throws API_Exception
  *   Api result array.
@@ -430,7 +438,8 @@ function civicrm_api3_contribution_completetransaction(&$params) {
 }
 
 /**
- * provide function metadata
+ * Provide function metadata.
+ *
  * @param array $params
  */
 function _civicrm_api3_contribution_completetransaction_spec(&$params) {
index 0c838cb4afed8f73400dc84d2aff5d64078034c9..5c68330cb520809a88ea15b6362dc39117c24c7f 100644 (file)
  */
 
 /**
- * Create or update a contribution_page
+ * Create or update a contribution_page.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'contribution_page'
- * @example ContributionPageCreate.php Std Create example
+ *   Array per getfields metadata.
  *
  * @return array
  *   api result array
- *   {@getfields contribution_page_create}
  */
 function civicrm_api3_contribution_page_create($params) {
   $result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -59,7 +56,7 @@ function civicrm_api3_contribution_page_create($params) {
  * The metadata is used for setting defaults, documentation & validation.
  *
  * @param array $params
- *   Array or parameters determined by getfields.
+ *   Array per getfields metadata.
  */
 function _civicrm_api3_contribution_page_create_spec(&$params) {
   $params['financial_type_id']['api.required'] = 1;
@@ -68,50 +65,42 @@ function _civicrm_api3_contribution_page_create_spec(&$params) {
 }
 
 /**
- * Returns array of contribution_pages  matching a set of one or more group properties
+ * Returns array of contribution_pages matching a set of one or more group properties.
  *
  * @param array $params
- *   Array of one or more valid property_name=>value pairs.
+ *   Array per getfields metadata.
  *
  * @return array
  *   API Result array Array of matching contribution_pages
- *   {@getfields contribution_page_get}
  */
 function civicrm_api3_contribution_page_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * delete an existing contribution_page
+ * Delete an existing contribution_page.
  *
  * This method is used to delete any existing contribution_page. id of the group
  * to be deleted is required field in $params array
  *
  * @param array $params
- *   Array containing id of the group.
- *                       to be deleted
+ *   Array per getfields metadata.
  *
  * @return array
  *   API result Array
- *   {@getfields contribution_page_delete}
  */
 function civicrm_api3_contribution_page_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * delete an existing contribution_page
- *
- * This method is used to delete any existing contribution_page. id of the group
- * to be deleted is required field in $params array
+ * Submit a contribution_page.
  *
  * @param array $params
- *   (reference) array containing id of the group.
- *                       to be deleted
+ *   Array per getfields metadata.
  *
  * @return array
  *   API result array
- *   {@getfields contribution_page_delete}
  */
 function civicrm_api3_contribution_page_submit($params) {
   $result = CRM_Contribute_Form_Contribution_Confirm::submit($params);
index c30303bef3ce229ba7908d67db9a5411c45bae31..41e8bbaf06c161a1328322a409d693ba5b9c6a3d 100644 (file)
  */
 
 /**
- * Create or update a contribution_recur
+ * Create or update a contribution_recur.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'contribution_recur'
- * @example ContributionRecurCreate.php Std Create example
+ *   Array per getfields metadata.
  *
  * @return array
  *   api result array
@@ -64,7 +62,7 @@ function _civicrm_api3_contribution_recur_create_spec(&$params) {
 }
 
 /**
- * Returns array of contribution_recurs  matching a set of one or more group properties
+ * Returns array of contribution_recurs matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid.
@@ -79,10 +77,10 @@ function civicrm_api3_contribution_recur_get($params) {
 }
 
 /**
- * Cancel a recurring contribution of existing contribution_recur.id
+ * Cancel a recurring contribution of existing contribution_recur.id.
  *
  * @param array $params
- *   (reference) array containing id of the recurring contribution.
+ *   Array containing id of the recurring contribution.
  *
  * @return bool
  *   returns true is successfully cancelled
@@ -93,7 +91,7 @@ function civicrm_api3_contribution_recur_cancel($params) {
 }
 
 /**
- * delete an existing contribution_recur
+ * Delete an existing contribution_recur.
  *
  * This method is used to delete any existing contribution_recur. id of the group
  * to be deleted is required field in $params array
index 781897805d5e825a3633274fca05f05cd0b7c573..8d6187cf7c07f9a2c575b46d520efd83ac22cba3 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-// $Id$
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
@@ -28,7 +26,7 @@
  */
 
 /**
- * File for the CiviCRM APIv3 soft credit functions
+ * File for the CiviCRM APIv3 soft credit functions.
  *
  * @package CiviCRM_APIv3
  * @subpackage API_ContributionSoft
  */
 
 /**
- * Create or Update a Soft Credit
+ * Create or Update a Soft Credit.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'contribution_soft'
- *
- * @example ContributionSoftCreate.php Standard Create Example //FIXME
+ *   Array per getfields metadata.
  *
- * @return array API result array {@getfields contribution_soft_create}
+ * @return array
+ *   API result array
  */
 function civicrm_api3_contribution_soft_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -67,27 +63,24 @@ function _civicrm_api3_contribution_soft_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Soft Credit
+ * Deletes an existing Soft Credit.
  *
  * @param array $params
- *
- * @example ContributionSoftDelete.php Standard Delete Example
- * {@getfields contribution_soft_delete}
  */
 function civicrm_api3_contribution_soft_delete($params) {
-  // non standard BAO - we have to write custom code to cope
+  // Non standard BAO - we have to write custom code to cope.
   CRM_Contribute_BAO_ContributionSoft::del(array('id' => $params['id']));
 
 }
 
 /**
- * Retrieve one or more Soft Credits
+ * Retrieve one or more Soft Credits.
  *
- * @example ContributionSoftGet.php Standard Get Example
- *
- * @param array $params An associative array of name/value pairs.
+ * @param array $params
+ *   Array per getfields metadata.
  *
- * @return array api result {@getfields contribution_soft_get}
+ * @return array
+ *   API result
  */
 function civicrm_api3_contribution_soft_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 2a854bc690361830f9ff06f30bcbdad07506451a..5683691ebf73e50eddaa7129fbe75bab38ebf2c1 100644 (file)
  * @version $Id: Country.php 2011-02-16 ErikHommel $
  */
 
-require_once 'CRM/Core/DAO/Country.php';
-
 /**
- * Add an Country for a contact
- *
- * Allowed @params array keys are:
- *
- * @example CountryCreate.php Standard Create Example
+ * Add an Country for a contact.
  *
  * @param array $params
+ *   Array per getfields metadata.
+ *
  * @return array
  *   API result array
  * @throws \API_Exception
@@ -68,31 +64,24 @@ function _civicrm_api3_country_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Country
+ * Deletes an existing Country.
  *
  * @param array $params
  *
- * @example CountryDelete.php Standard Delete Example
- *
- * @return bool
- *   | error  true if successfull, error otherwise
- *   {@getfields country_delete}
+ * @return array
  */
 function civicrm_api3_country_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_DAO(__FUNCTION__), $params);
 }
 
 /**
- * Retrieve one or more countrys
- *
- * @example CountryGet.php Standard Get Example
+ * Retrieve one or more countryies.
  *
  * @param array $params
- *   An associative array of name/value pairs.
+ *   Array per getfields metadata.
  *
  * @return array
  *   api result array
- *   {@getfields country_get}
  */
 function civicrm_api3_country_get($params) {
 
index 57b09a1a161011bd83d8f948f4ba5ba7a92954ad..bfcf45e4cd34ec6c4f02a6fdd999bcb71ac14fea 100644 (file)
 
 /**
  * Create a 'custom field' within a custom field group.
+ *
  * We also empty the static var in the getfields
  * function after deletion so that the field is available for us (getfields manages date conversion
  * among other things
  *
  * @param array $params
- *   Array Associative array of property name/value pairs to create new custom field.
+ *   Array per getfields metadata.
  *
  * @return array
  *   API success array
  */
 function civicrm_api3_custom_field_create($params) {
 
-  // Array created for passing options in params
+  // Array created for passing options in params.
   if (isset($params['option_values']) && is_array($params['option_values'])) {
     foreach ($params['option_values'] as $key => $value) {
       $params['option_label'][$key] = $value['label'];
@@ -66,7 +67,7 @@ function civicrm_api3_custom_field_create($params) {
 }
 
 /**
- * Flush static caches in functions that might have stored available custom fields
+ * Flush static caches in functions that might have stored available custom fields.
  */
 function _civicrm_api3_custom_field_flush_static_caches() {
   civicrm_api('custom_field', 'getfields', array('version' => 3, 'cache_clear' => 1));
@@ -122,7 +123,8 @@ function civicrm_api3_custom_field_get($params) {
 }
 
 /**
- * Helper function to validate custom field value
+ * Helper function to validate custom field value.
+ *
  * @deprecated
  *
  * @param string $fieldName
@@ -246,8 +248,11 @@ SELECT count(*)
 }
 
 /**
- * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom field
+ * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom field.
+ *
  * @param array $params
+ *   Array per getfields metadata.
+ *
  * @return array
  */
 function civicrm_api3_custom_field_setvalue($params) {
index 0f5e213ac9799b360c2d857c0a9953e8c16d9fbe..dbe0bfb4cd8e37873f45e99825a41eb8a09777f8 100644 (file)
  */
 
 /**
- * Most API functions take in associative arrays ( name => value pairs
- * as parameters. Some of the most commonly used parameters are
- * described below
+ * Use this API to create a new group.
  *
- * @param array $params
- *   An associative array used in construction.
- *   retrieval of the object
- * @todo missing get function
- *
- *
- */
-
-/**
- * Use this API to create a new group.  The 'extends' value accepts an array or a comma separated string.
+ * The 'extends' value accepts an array or a comma separated string.
  * e.g array(
  'Individual','Contact') or 'Individual,Contact'
* 'Individual','Contact') or 'Individual,Contact'
  * See the CRM Data Model for custom_group property definitions
  * $params['class_name'] is a required field, class being extended.
  *
  * @param array $params
- *   Array Associative array of property name/value pairs to insert in group.
- * {@getfields CustomGroup_create}
+ *   Array per getfields metadata.
  *
  * @return array
  * @todo $params['extends'] is array format - is that std compatible
@@ -109,10 +97,10 @@ function civicrm_api3_custom_group_delete($params) {
 }
 
 /**
- * Use this API to get existing custom fields.
+ * API to get existing custom fields.
  *
  * @param array $params
- *   Array to search on.
+ *   Array per getfields metadata.
  *
  * @return array
  */
@@ -121,8 +109,11 @@ function civicrm_api3_custom_group_get($params) {
 }
 
 /**
- * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom group
+ * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom group.
+ *
  * @param array $params
+ *   Array per getfields metadata.
+ *
  * @return array
  */
 function civicrm_api3_custom_group_setvalue($params) {
index 3137c49ecfe20e9d94636c1a05485f662f3e4430..3f34e8547449289272c9fc8633e343ea3c4880a5 100644 (file)
@@ -1,18 +1,14 @@
 <?php
 
 /**
- * Retrieve a CustomSearches
+ * Retrieve custom searches.
  *
  * FIXME This is a bare-minimum placeholder
  *
  * @param array $params
  *
- * {@example OptionValueGet.php 0}
- * @example OptionValueGet.php
- *
  * @return array
  *   details of found Option Values
- *   {@getfields OptionValue_get}
  */
 function civicrm_api3_custom_search_get($params) {
   require_once 'api/v3/OptionValue.php';
@@ -23,17 +19,12 @@ function civicrm_api3_custom_search_get($params) {
 }
 
 /**
- * Add a CustomSearch
- *
- * Allowed @params array keys are:
- *
- * {@example OptionValueCreate.php}
+ * Add a CustomSearch.
  *
  * @param array $params
  *
  * @return array
  *   Array of newly created option_value property values.
- *   {@getfields OptionValue_create}
  */
 function civicrm_api3_custom_search_create($params) {
   require_once 'api/v3/OptionValue.php';
@@ -65,15 +56,12 @@ function _civicrm_api3_custom_search_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing ReportTemplate
+ * Deletes an existing ReportTemplate.
  *
  * @param array $params
  *
- * {@example ReportTemplateDelete.php 0}
- *
  * @return array
  *   Api result
- *   {@getfields ReportTemplate_create}
  */
 function civicrm_api3_custom_search_delete($params) {
   require_once 'api/v3/OptionValue.php';
index 464e70d925c1a3d91fb6fd3ea0415d47240f3237..748bbde23b97ba2c765ed20dceb306e5aa10dd52 100644 (file)
@@ -64,7 +64,6 @@
  * @throws Exception
  * @return array
  *   ['values' => TRUE] or ['is_error' => 1, 'error_message' => 'what went wrong']
- *
  */
 function civicrm_api3_custom_value_create($params) {
   // @todo it's not clear where the entity_table is used as  CRM_Core_BAO_CustomValueTable::setValues($create)
@@ -136,8 +135,6 @@ function _civicrm_api3_custom_value_create_spec(&$params) {
  *
  * @throws API_Exception
  * @return array
- *
- *
  */
 function civicrm_api3_custom_value_get($params) {
 
@@ -228,7 +225,7 @@ function civicrm_api3_custom_value_get($params) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
index 9cc600bcda172a3610cd471a53d7d93cfad80fa0..706d28e77f02369ad5f15a313f6e834606ddd046 100644 (file)
@@ -34,7 +34,6 @@
  * @subpackage API_Activity
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Activity.php 30486 2010-11-02 16:12:09Z shot $
- *
  */
 
 
@@ -58,17 +57,20 @@ function civicrm_api3_dashboard_create($params) {
 }
 
 /**
- * Specify Meta data for create. Note that this data is retrievable via the getfields function
+ * Specify Meta data for create.
+ *
+ * Note that this data is retrievable via the getfields function
  * and is used for pre-filling defaults and ensuring mandatory requirements are met.
+ *
  * @param array $params
- *   (reference) array of parameters determined by getfields.
+ *   array of parameters determined by getfields.
  */
 function _civicrm_api3_dashboard_create_spec(&$params) {
   unset($params['version']);
 }
 
 /**
- * Gets a CiviCRM Dashlets according to parameters
+ * Gets a CiviCRM Dashlets according to parameters.
  *
  * @param array $params
  *
index 86f39aacc550708da9a92ccd9e89c38bbb79c54b..294930046b2aaf41058c0277e9179f291258d6e2 100644 (file)
  * @subpackage API_ActionSchedule
  *
  * @copyright CiviCRM LLC (c) 2004-2014
- *
  */
 
 /**
- * Creates/Updates a new Dashboard Contact Entry
+ * Creates/Updates a new Dashboard Contact Entry.
  *
  * @param array $params
  *
  * @return array
- *
  */
 function civicrm_api3_dashboard_contact_create($params) {
   if (empty($params['id'])) {
@@ -60,14 +58,12 @@ function civicrm_api3_dashboard_contact_create($params) {
 }
 
 /**
- * Gets a CiviCRM Dashlets of Contacts according to parameters
+ * Gets a CiviCRM Dashlets of Contacts according to parameters.
  *
  * @param array $params
- *   Associative array of property name/value.
- *                             pairs for the activity.
+ *   Array per getfields metadata.
  *
  * @return array
- *
  */
 function civicrm_api3_dashboard_contact_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -86,7 +82,10 @@ function _civicrm_api3_dashboard_contact_create_spec(&$params) {
 }
 
 /**
+ * Check permissions on contact dashboard retrieval.
+ *
  * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array|null
  */
@@ -102,12 +101,13 @@ function _civicrm_api3_dashboard_contact_check_params(&$params) {
 }
 
 /**
- * Delete an existing dashboard-contact
+ * Delete an existing dashboard-contact.
  *
  * This method is used to delete any existing dashboard-board. the id of the dashboard-contact
  * is required field in $params array
  *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
index f39391d98cf0f868819c62e0753b843def319746..950dcb4d4ff8b3eb5e8715d09a40e0b50f4dc6de 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Domain.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * Get CiviCRM domain details
- * {@getfields domain_create}
- * @example DomainGet.php
+ * Get CiviCRM domain details.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -114,7 +113,7 @@ function civicrm_api3_domain_get($params) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -126,13 +125,11 @@ function _civicrm_api3_domain_get_spec(&$params) {
 }
 
 /**
- * Create a new domain
+ * Create a new domain.
  *
  * @param array $params
  *
  * @return array
- * @example DomainCreate.php
- * {@getfields domain_create}
  */
 function civicrm_api3_domain_create($params) {
   $params['version'] = $params['domain_version'];
index b1cee2718797c30176ba7b08c3b054d011699227..ff2ae35a2764235d676cb6402f7acef06246bded 100644 (file)
  */
 
 /**
- * Add an Email for a contact
- *
- * Allowed @params array keys are:
- *
- * @example EmailCreate.php Standard Create Example
+ * Add an Email for a contact.
  *
  * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array
  *   API result array
@@ -67,24 +64,23 @@ function _civicrm_api3_email_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Email
+ * Deletes an existing Email.
  *
  * @param array $params
+ *   Array per getfields metadata.
  *
- * @example EmailDelete.php Standard Delete Example
- *
- * @return bool
- *   | error  true if successfull, error otherwise
+ * @return array
+ *   API result array.
  */
 function civicrm_api3_email_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Retrieve one or more emails
+ * Retrieve one or more emails.
  *
  * @param array $params
- *   An associative array of name/value pairs.
+ *   Array per getfields metadata.
  *
  * @return array
  *   api result array
index 52ce682a1aa02af3a7c7bce210b51b253816cd1b..ff3bb42511e40e6abb431a9c43c02a74c75a0565 100644 (file)
@@ -1,8 +1,12 @@
 <?php
 
 /**
+ * Get list of deprecated entities.
+ *
  * @deprecated api notice
+ *
  * @param array $entities
+ *
  * @return array
  *   Array of deprecated api entities
  */
@@ -19,8 +23,12 @@ function _civicrm_api3_entity_deprecation($entities) {
 }
 
 /**
- *  Placeholder function. This should never be called, as it doesn't have any meaning
+ * Placeholder function.
+ *
+ * This should never be called, as it doesn't have any meaning.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_entity_create($params) {
@@ -28,8 +36,12 @@ function civicrm_api3_entity_create($params) {
 }
 
 /**
- *  Placeholder function. This should never be called, as it doesn't have any meaning
+ * Placeholder function.
+ *
+ * This should never be called, as it doesn't have any meaning.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_entity_delete($params) {
@@ -37,8 +49,12 @@ function civicrm_api3_entity_delete($params) {
 }
 
 /**
- *  Placeholder function. This should never be called, as it doesn't have any meaning
+ * Placeholder function.
+ *
+ * This should never be called, as it doesn't have any meaning.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_entity_getfields($params) {
index 84eee188049f6a237fb01c45449c214685640007..ae02240f4af5874436380a5b8d90b9bf209474bd 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Event.php 30964 2010-11-29 09:41:54Z shot $
- *
  */
 
 /**
- * Create a Event
- *
- * This API is used for creating a Event
+ * Create a Event.
  *
  * @param array $params
  *   Input parameters.
- *   Allowed @params array keys are:
- * {@getfields event_create}
  *
  * @return array
  *   API result Array.
@@ -81,10 +76,12 @@ function _civicrm_api3_event_create_spec(&$params) {
 }
 
 /**
- * Support for schema changes made in 4.2
+ * Support for schema changes made in 4.2.
+ *
  * The main purpose of the API is to provide integrators a level of stability not provided by
  * the core code or schema - this means we have to provide support for api calls (where possible)
  * across schema changes.
+ *
  * @param array $params
  */
 function _civicrm_api3_event_create_legacy_support_42(&$params) {
@@ -152,7 +149,7 @@ function civicrm_api3_event_get($params) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -164,12 +161,14 @@ function _civicrm_api3_event_get_spec(&$params) {
 }
 
 /**
- * Support for schema changes made in 4.2
+ * Support for schema changes made in 4.2.
+ *
  * The main purpose of the API is to provide integrators a level of stability not provided by
  * the core code or schema - this means we have to provide support for api calls (where possible)
  * across schema changes.
- * @param $event
- * @param $event_id
+ *
+ * @param array $event
+ * @param int $event_id
  */
 function _civicrm_api3_event_get_legacy_support_42(&$event, $event_id) {
   if (!empty($event[$event_id]['payment_processor'])) {
@@ -181,31 +180,28 @@ function _civicrm_api3_event_get_legacy_support_42(&$event, $event_id) {
 }
 
 /**
- * Deletes an existing event
+ * Delete an existing event.
  *
- * This API is used for deleting a event
+ * This API is used for deleting a event.
  *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_event_delete($params) {
   return CRM_Event_BAO_Event::del($params['id']) ? civicrm_api3_create_success() : civicrm_api3_create_error(ts('Error while deleting event'));
 }
-/*
 
 /**
- * add 'is_full' & 'available_seats' to the return array. (this might be better in the BAO)
+ * Add 'is_full' & 'available_seats' to the return array.
+ *
+ * (this might be better in the BAO)
  * Default BAO function returns a string if full rather than a Bool - which is more appropriate to a form
  *
  * @param array $event
  *   Return array of the event.
  * @param int $event_id
  *   Id of the event to be updated.
- *
- */
-/**
- * @param $event
- * @param int $event_id
  */
 function _civicrm_api3_event_getisfull(&$event, $event_id) {
   $eventFullResult = CRM_Event_BAO_Participant::eventFull($event_id, 1);
@@ -220,6 +216,8 @@ function _civicrm_api3_event_getisfull(&$event, $event_id) {
 
 
 /**
+ * Get event list parameters.
+ *
  * @see _civicrm_api3_generic_getlist_params
  *
  * @param array $request
@@ -235,6 +233,8 @@ function _civicrm_api3_event_getlist_params(&$request) {
 }
 
 /**
+ * Get event list output.
+ *
  * @see _civicrm_api3_generic_getlist_output
  *
  * @param array $result
@@ -249,7 +249,13 @@ function _civicrm_api3_event_getlist_output($result, $request) {
       $data = array(
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']],
-        'description' => array(CRM_Core_Pseudoconstant::getLabel('CRM_Event_BAO_Event', 'event_type_id', $row['event_type_id'])),
+        'description' => array(
+          CRM_Core_Pseudoconstant::getLabel(
+            'CRM_Event_BAO_Event',
+            'event_type_id',
+            $row['event_type_id']
+          ),
+        ),
       );
       if (!empty($row['start_date'])) {
         $data['description'][0] .= ': ' . CRM_Utils_Date::customFormat($row['start_date']);
index 3646d416e048666c0a7f05ea5036112bf9cc7ca5..2bbd45af13cca4e73787d38bad017e3fd6922371 100644 (file)
@@ -36,11 +36,10 @@ define('API_V3_EXTENSION_DELIMITER', ',');
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id$
- *
  */
 
 /**
- * Install an extension
+ * Install an extension.
  *
  * @param array $params
  *   Input parameters.
@@ -68,7 +67,7 @@ function civicrm_api3_extension_install($params) {
 }
 
 /**
- * Upgrade an extension - runs upgrade_N hooks and system.flush
+ * Upgrade an extension - runs upgrade_N hooks and system.flush.
  *
  * @return array
  *   API result
@@ -98,7 +97,7 @@ function civicrm_api3_extension_upgrade() {
 }
 
 /**
- * Enable an extension
+ * Enable an extension.
  *
  * @param array $params
  *   Input parameters.
@@ -120,7 +119,7 @@ function civicrm_api3_extension_enable($params) {
 }
 
 /**
- * Disable an extension
+ * Disable an extension.
  *
  * @param array $params
  *   Input parameters.
@@ -130,7 +129,6 @@ function civicrm_api3_extension_enable($params) {
  *
  * @return array
  *   API result
- * @example ExtensionDisable.php
  */
 function civicrm_api3_extension_disable($params) {
   $keys = _civicrm_api3_getKeys($params);
@@ -143,7 +141,7 @@ function civicrm_api3_extension_disable($params) {
 }
 
 /**
- * Uninstall an extension
+ * Uninstall an extension.
  *
  * @param array $params
  *   Input parameters.
@@ -167,7 +165,7 @@ function civicrm_api3_extension_uninstall($params) {
 }
 
 /**
- * Download and install an extension
+ * Download and install an extension.
  *
  * @param array $params
  *   Input parameters.
@@ -218,7 +216,7 @@ function civicrm_api3_extension_download($params) {
 }
 
 /**
- * Download and install an extension
+ * Download and install an extension.
  *
  * @param array $params
  *   Input parameters.
@@ -227,8 +225,6 @@ function civicrm_api3_extension_download($params) {
  *
  * @return array
  *   API result
- * @example ExtensionRefresh.php
- *
  */
 function civicrm_api3_extension_refresh($params) {
   $defaults = array('local' => TRUE, 'remote' => TRUE);
@@ -252,13 +248,12 @@ function civicrm_api3_extension_refresh($params) {
 }
 
 /**
- * Get a list of available extensions
+ * Get a list of available extensions.
  *
  * @param array $params
  *
  * @return array
  *   API result
- * @example ExtensionGet.php
  */
 function civicrm_api3_extension_get($params) {
   $statuses = CRM_Extension_System::singleton()->getManager()->getStatuses();
@@ -278,10 +273,11 @@ function civicrm_api3_extension_get($params) {
 }
 
 /**
- * Determine the list of extension keys
+ * Determine the list of extension keys.
  *
  * @param array $params
  *   API request params with 'key' or 'keys'.
+ *
  * @return array
  *   Array of extension keys
  * @throws API_Exception
index f99dd393593d165abfed49a0eb87c9d5c30099bf..682775b1e7e9d156feae2558a53583ee88826543 100644 (file)
  * @subpackage API_File
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: $
- *
  */
 
 /**
- * Create a file
- *
- * This API is used for creating a file
+ * Create a file.
  *
  * @param array $params
- *   An associative array of name/value property values of civicrm_file.
+ *   Array per getfields metadata.
  *
  * @return array
  *   Array of newly created file property values.
@@ -59,7 +56,15 @@ function civicrm_api3_file_create($params) {
   }
 
   $fileDAO = new CRM_Core_DAO_File();
-  $properties = array('id', 'file_type_id', 'mime_type', 'uri', 'document', 'description', 'upload_date');
+  $properties = array(
+    'id',
+    'file_type_id',
+    'mime_type',
+    'uri',
+    'document',
+    'description',
+    'upload_date',
+  );
 
   foreach ($properties as $name) {
     if (array_key_exists($name, $params)) {
@@ -78,11 +83,8 @@ function civicrm_api3_file_create($params) {
 /**
  * Get a file.
  *
- * This api is used for finding an existing file.
- * Required parameters : id OR file_type_id of a file
- *
  * @param array $params
- *   An associative array of name/value property values of civicrm_file.
+ *   Array per getfields metadata.
  *
  * @return array
  *   Array of all found file object property values.
@@ -93,12 +95,11 @@ function civicrm_api3_file_get($params) {
 }
 
 /**
- * Update an existing file
- *
- * This api is used for updating an existing file.
- * Required parameters : id of a file
+ * Update an existing file.
  *
  * @param array $params
+ *   Array per getfields metadata.
+ *
  * @return array
  */
 function civicrm_api3_file_update($params) {
@@ -122,12 +123,10 @@ function civicrm_api3_file_update($params) {
 }
 
 /**
- * Deletes an existing file
- *
- * This API is used for deleting a file
- * Required parameters : id of a file
+ * Delete an existing file.
  *
  * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array
  *   API result array
index 6445ff1ea30ebc97ed8fb4f65b5b43d3a1ab610d..96c708efbdb38bc3d5712eafd5b27c35b4f66bf9 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_financial_account
- *
  */
 
 /**
- * Save a financial_account
- *
- * Allowed @params array keys are:
- * {@getfields financial_account_create}
- * @example financial_accountCreate.php
+ * Save a financial_account.
  *
  * @param array $params
  *
@@ -50,11 +45,7 @@ function civicrm_api3_financial_account_create($params) {
 }
 
 /**
- * Get a financial_account
- *
- * Allowed @params array keys are:
- * {@getfields financial_account_get}
- * @example financial_accountCreate.php
+ * Get a financial_account.
  *
  * @param array $params
  *
@@ -66,11 +57,7 @@ function civicrm_api3_financial_account_get($params) {
 }
 
 /**
- * Delete a financial_account
- *
- * Allowed @params array keys are:
- * {@getfields financial_account_delete}
- * @example financial_accountCreate.php
+ * Delete a financial_account.
  *
  * @param array $params
  *
index cc6466ebe55cd14a6b7079497dab638822259a2f..1af8001aaf2c7cc7ed0a8b3245bb65cf1427bb97 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_financial_type
- *
  */
 
 /**
- * Save a financial_type
- *
- * Allowed @params array keys are:
- * {@getfields financial_type_create}
- * @example financial_typeCreate.php
+ * Save a financial_type.
  *
  * @param array $params
  *
@@ -50,11 +45,7 @@ function civicrm_api3_financial_type_create($params) {
 }
 
 /**
- * Get a financial_type
- *
- * Allowed @params array keys are:
- * {@getfields financial_type_get}
- * @example financial_typeCreate.php
+ * Get a financial_type.
  *
  * @param array $params
  *
@@ -66,11 +57,7 @@ function civicrm_api3_financial_type_get($params) {
 }
 
 /**
- * Delete a financial_type
- *
- * Allowed @params array keys are:
- * {@getfields financial_type_delete}
- * @example financial_typeCreate.php
+ * Delete a financial_type.
  *
  * @param array $params
  *
index 4de5a5db663b72c8df0ed491994f0d3f7e399fbb..daf416e65c134ed99141a8f14a8fa84e2ef26d73 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 
 /**
- * Get information about fields for a given api request. Getfields information
- * is used for documentation, validation, default setting
+ * Get information about fields for a given api request.
+ *
+ * Getfields information is used for documentation, validation, default setting
  * We first query the scheme using the $dao->fields function & then augment
  * that information by calling the _spec functions that apply to the relevant function
  * Note that we use 'unique' field names as described in the xml/schema files
@@ -17,6 +18,7 @@
  *   - version: string
  *   - function: callback (mixed)
  *   - params: array, varies
+ *
  * @return array
  *   API success object
  */
@@ -30,7 +32,11 @@ function civicrm_api3_generic_getfields($apiRequest) {
       CRM_Utils_PseudoConstant::flushConstant($apiRequest['params']['fieldname']);
     }
     if (!empty($apiRequest['params']['option_group_id'])) {
-      $optionGroupName = civicrm_api('option_group', 'getvalue', array('version' => 3, 'id' => $apiRequest['params']['option_group_id'], 'return' => 'name'));
+      $optionGroupName = civicrm_api('option_group', 'getvalue', array(
+        'version' => 3,
+        'id' => $apiRequest['params']['option_group_id'],
+        'return' => 'name',
+      ));
       if (is_string($optionGroupName)) {
         CRM_Utils_PseudoConstant::flushConstant(_civicrm_api_get_camel_name($optionGroupName));
       }
@@ -144,7 +150,7 @@ function civicrm_api3_generic_getfields($apiRequest) {
 }
 
 /**
- * API return function to reformat results as count
+ * API return function to reformat results as count.
  *
  * @param array $apiRequest
  *   Api request as an array. Keys are.
@@ -166,7 +172,7 @@ function civicrm_api3_generic_getcount($apiRequest) {
 }
 
 /**
- * API return function to reformat results as single result
+ * API return function to reformat results as single result.
  *
  * @param array $apiRequest
  *   Api request as an array. Keys are.
@@ -175,7 +181,7 @@ function civicrm_api3_generic_getcount($apiRequest) {
  *   count of results
  */
 function civicrm_api3_generic_getsingle($apiRequest) {
-  // so the first entity is always result['values'][0]
+  // So the first entity is always result['values'][0].
   $apiRequest['params']['sequential'] = 1;
   $result = civicrm_api($apiRequest['entity'], 'get', $apiRequest['params']);
   if ($result['is_error'] !== 0) {
@@ -191,7 +197,7 @@ function civicrm_api3_generic_getsingle($apiRequest) {
 }
 
 /**
- * API return function to reformat results as single value
+ * API return function to reformat results as single value.
  *
  * @param array $apiRequest
  *   Api request as an array. Keys are.
@@ -223,6 +229,8 @@ function civicrm_api3_generic_getvalue($apiRequest) {
 }
 
 /**
+ * Get count of contact references.
+ *
  * @param array $params
  */
 function _civicrm_api3_generic_getrefcount_spec(&$params) {
@@ -231,7 +239,7 @@ function _civicrm_api3_generic_getrefcount_spec(&$params) {
 }
 
 /**
- * API to determine if a record is in-use
+ * API to determine if a record is in-use.
  *
  * @param array $apiRequest
  *   Api request as an array.
@@ -259,7 +267,7 @@ function civicrm_api3_generic_getrefcount($apiRequest) {
 }
 
 /**
- * API wrapper for replace function
+ * API wrapper for replace function.
  *
  * @param array $apiRequest
  *   Api request as an array. Keys are.
@@ -272,7 +280,7 @@ function civicrm_api3_generic_replace($apiRequest) {
 }
 
 /**
- * API wrapper for getoptions function
+ * API wrapper for getoptions function.
  *
  * @param array $apiRequest
  *   Api request as an array.
@@ -281,7 +289,7 @@ function civicrm_api3_generic_replace($apiRequest) {
  *   Array of results
  */
 function civicrm_api3_generic_getoptions($apiRequest) {
-  // Resolve aliases
+  // Resolve aliases.
   $fieldName = _civicrm_api3_api_resolve_alias($apiRequest['entity'], $apiRequest['params']['field']);
   if (!$fieldName) {
     return civicrm_api3_create_error("The field '{$apiRequest['params']['field']}' doesn't exist.");
@@ -304,6 +312,8 @@ function civicrm_api3_generic_getoptions($apiRequest) {
 }
 
 /**
+ * Get metadata.
+ *
  * Function fills the 'options' array on the metadata returned by getfields if
  * 1) the param option 'get_options' is defined - e.g. $params['options']['get_options'] => array('custom_1)
  * (this is passed in as the $fieldsToResolve array)
index 2e19211283198c49d0d3cf51ef0d683fda14ff9b..0d7520dc51bc8e2f680768645422201b1a780ed3 100644 (file)
  */
 
 /**
- * create/update grant
- *
- * This API is used to create new grant or update any of the existing
- * In case of updating existing grant, id of that particular grant must
- * be in $params array.
+ * Create/update grant.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'grant'
+ *   Array per getfields metadata.
  *
  * @return array
  *   grant array
- *   {@getfields grant_create}
  */
 function civicrm_api3_grant_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Grant');
@@ -66,34 +60,29 @@ function _civicrm_api3_grant_create_spec(&$params) {
 }
 
 /**
- * Returns array of grants  matching a set of one or more group properties
+ * Returns array of grants matching a set of one or more group properties.
  *
  * @param array $params
- *   Array of one or more valid.
- *                       property_name=>value pairs. If $params is set
- *                       as null, all grants will be returned
+ *   Array per getfields metadata.
  *
  * @return array
  *   Array of matching grants
- *   {@getfields grant_get}
  */
 function civicrm_api3_grant_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Grant');
 }
 
 /**
- * delete an existing grant
+ * Delete an existing grant.
  *
  * This method is used to delete any existing grant. id of the group
  * to be deleted is required field in $params array
  *
  * @param array $params
- *   Array containing id of the group.
- *                       to be deleted
+ *   Array per getfields metadata.
  *
  * @return array
  *   API Result Array
- *   {@getfields grant_delete}
  */
 function civicrm_api3_grant_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index d4fa3c26b3780ef844c75ad4961058b49bbc4f27..0bbc1640419dffb2dc0f76e50c685b57951e67b6 100644 (file)
  */
 
 /**
- * create/update group
- *
- * This API is used to create new group or update any of the existing
- * In case of updating existing group, id of that particular group must
- * be in $params array. Either id or name is required field in the
- * $params array
+ * Create/update group.
  *
  * @param array $params
  *   Associative array of property.
@@ -48,8 +43,6 @@
  *
  * @return array
  *   API result array
- * @example GroupCreate.php
- * {@getfields group_create}
  */
 function civicrm_api3_group_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Group');
@@ -69,7 +62,7 @@ function _civicrm_api3_group_create_spec(&$params) {
 }
 
 /**
- * Returns array of groups  matching a set of one or more group properties
+ * Returns array of groups matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid.
@@ -78,8 +71,6 @@ function _civicrm_api3_group_create_spec(&$params) {
  *
  * @return array
  *   Array of matching groups
- * @example GroupGet.php
- * {@getfields group_get}
  */
 function civicrm_api3_group_get($params) {
   $options = _civicrm_api3_get_options_from_params($params, TRUE, 'group', 'get');
@@ -95,10 +86,7 @@ function civicrm_api3_group_get($params) {
 }
 
 /**
- * delete an existing group
- *
- * This method is used to delete any existing group. id of the group
- * to be deleted is required field in $params array
+ * Delete an existing group.
  *
  * @param array $params
  *   Array containing id of the group.
@@ -106,9 +94,6 @@ function civicrm_api3_group_get($params) {
  *
  * @return array
  *   API result array
- * @example GroupDelete.php
- * {@getfields group_delete}
- *
  */
 function civicrm_api3_group_delete($params) {
 
index 946df5baf5c807904799af1363219407b2a9aa92..2fcd3400af51e97e824d5503b3af1be3a45c0bf3 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: GroupContact.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 
 /**
- * This API will give list of the groups for particular contact
- * Particular status can be sent in params array
+ * This API will give list of the groups for particular contact.
+ *
+ * Particular status can be sent in params array.
+ *
  * If no status mentioned in params, by default 'added' will be used
  * to fetch the records
  *
  * @param array $params
  *   Name value pair of contact information.
- * {@getfields GroupContact_get}
  *
  * @return array
  *   list of groups, given contact subsribed to
@@ -70,7 +70,8 @@ function civicrm_api3_group_contact_get($params) {
 }
 
 /**
- * Add contact(s) to group(s)
+ * Add contact(s) to group(s).
+ *
  * @param array $params
  *   Input parameters.
  *
@@ -80,7 +81,6 @@ function civicrm_api3_group_contact_get($params) {
  * "contact_id.1" etc. (optional) : another contact to add<br>
  * "group_id.1" etc. (optional) : additional group to add contact(s) to<br>
  * "status" (optional) : one of "Added", "Pending" or "Removed" (default is "Added")
- * {@example GroupContactCreate.php 0}
  *
  * @return array
  *   Information about operation results
@@ -121,11 +121,12 @@ function civicrm_api3_group_contact_create($params) {
 }
 
 /**
+ * Delete group contact record.
  *
  * @param array $params
  *
  * @return array
- *   <type>
+ *
  * @deprecated
  */
 function civicrm_api3_group_contact_delete($params) {
@@ -135,7 +136,8 @@ function civicrm_api3_group_contact_delete($params) {
 }
 
 /**
- * modify metadata
+ * Adjust metadata.
+ *
  * @param array $params
  */
 function _civicrm_api3_group_contact_delete_spec(&$params) {
@@ -144,6 +146,7 @@ function _civicrm_api3_group_contact_delete_spec(&$params) {
 }
 
 /**
+ * Get pending group contacts.
  *
  * @param array $params
  *
@@ -156,6 +159,7 @@ function civicrm_api3_group_contact_pending($params) {
 }
 
 /**
+ * Group contact helper function.
  *
  * @param array $params
  * @param string $op
@@ -225,8 +229,12 @@ function _civicrm_api3_group_contact_common($params, $op = 'Added') {
 }
 
 /**
+ * Update group contact status.
+ *
  * @deprecated - this should be part of create but need to know we aren't missing something
+ *
  * @param array $params
+ *
  * @return bool
  * @throws \API_Exception
  */
@@ -246,6 +254,8 @@ function civicrm_api3_group_contact_update_status($params) {
 }
 
 /**
+ * Deprecated function notices.
+ *
  * @deprecated api notice
  * @return array
  *   Array of deprecated actions
index 5774099d2a3014c8e5304a4a5fb03db66bd84784..9897ea4699f438f4dac31942779a3ec7fb1be4e5 100644 (file)
@@ -33,7 +33,6 @@
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: GroupNesting.php 21624 2009-08-07 22:02:55Z wmorgan $
- *
  */
 
 /**
@@ -41,7 +40,6 @@
  *
  * @param array $params
  *   An array containing at least child_group_id or parent_group_id.
- * {@getfields GroupNesting_get}
  *
  * @return array
  *   list of group nesting records
@@ -53,6 +51,7 @@ function civicrm_api3_group_nesting_get($params) {
 
 /**
  * Creates group nesting record for given parent and child id.
+ *
  * Parent and child groups need to exist.
  *
  * @param array $params
index a21ea3179799bc7cfb266ece401161d25d819de5..451eefe30073f404155188859baf1939813a6d34 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: GroupContact.php 21624 2009-06-04 22:02:55Z mover $
- *
  */
 
 
 /**
- * This API will give list of the groups for particular contact
- * Particualr status can be sent in params array
- * If no status mentioned in params, by default 'added' will be used
- * to fetch the records
+ * Get group organization record/s.
  *
  * @param array $params
  *   Name value pair of contact information.
- * {@getfields GroupOrganization_get}
- * @example GroupOrganizationGet.php
  *
  * @return array
- *   list of groups, given contact subsribed to
+ *   list of groups, given contact subscribed to
  */
 function civicrm_api3_group_organization_get($params) {
   return _civicrm_api3_basic_get('CRM_Contact_DAO_GroupOrganization', $params);
 }
 
 /**
- * @example GroupOrganizationCreate.php
- * {@getfields GroupOrganization_create}
+ * Create group organization record.
  *
  * @param array $params
  *   Array.
  *
  * @return array
- *
  */
 function civicrm_api3_group_organization_create($params) {
 
@@ -91,7 +83,7 @@ function _civicrm_api3_group_organization_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Group Organization
+ * Deletes an existing Group Organization.
  *
  * This API is used for deleting a Group Organization
  *
@@ -100,8 +92,6 @@ function _civicrm_api3_group_organization_create_spec(&$params) {
  *
  * @return array
  *   API Result
- *   {@getfields GroupOrganization_delete}
- * @example GroupOrganizationDelete.php
  */
 function civicrm_api3_group_organization_delete($params) {
 
index 3f922aacda08cdb00b7e72340205dfe950a2f059..b12d4ae515aa2d4937e478b1e9160d2cf9029f16 100644 (file)
@@ -100,13 +100,12 @@ function civicrm_api3_job_delete($params) {
  *   API Result Array
  */
 function civicrm_api3_job_execute($params) {
-  // @noinspection PhpUnusedParameterInspection
 
   $facility = new CRM_Core_JobManager();
   $facility->execute(FALSE);
 
-  // always creates success - results are handled elsewhere
-  return civicrm_api3_create_success();
+  // Always creates success - results are handled elsewhere.
+  return civicrm_api3_create_success(1, $params);
 }
 
 /**
@@ -354,7 +353,7 @@ function civicrm_api3_job_fetch_bounces($params) {
 }
 
 /**
- * Job to get mail and create activities
+ * Job to get mail and create activities.
  *
  * @param array $params
  *
@@ -379,10 +378,10 @@ function civicrm_api3_job_fetch_activities($params) {
 }
 
 /**
- * Process participant statuses
+ * Process participant statuses.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *  Input parameters.
  *
  * @return array
  *   array of properties, if error an array with an error id and error message
@@ -400,8 +399,9 @@ function civicrm_api3_job_process_participant($params) {
 
 
 /**
- * This api checks and updates the status of all membership records for a given domain using the calc_membership_status and
- * update_contact_membership APIs.
+ * This api checks and updates the status of all membership records for a given domain.
+ *
+ * The function uses the calc_membership_status and update_contact_membership APIs.
  *
  * IMPORTANT:
  * Sending renewal reminders has been migrated from this job to the Scheduled Reminders function as of 4.3.
@@ -422,7 +422,7 @@ function civicrm_api3_job_process_membership($params) {
   $lock->release();
 
   if ($result['is_error'] == 0) {
-    return civicrm_api3_create_success($result['messages']);
+    return civicrm_api3_create_success($result['messages'], $params);
   }
   else {
     return civicrm_api3_create_error($result['messages']);
@@ -457,7 +457,6 @@ function civicrm_api3_job_process_respondent($params) {
  *
  * @return array
  *   API Result Array
- *
  */
 function civicrm_api3_job_process_batch_merge($params) {
   $rgid = CRM_Utils_Array::value('rgid', $params);
@@ -477,6 +476,8 @@ function civicrm_api3_job_process_batch_merge($params) {
 }
 
 /**
+ * Metadata for batch merge function.
+ *
  * @param $params
  */
 function _civicrm_api3_job_process_batch_merge_spec(&$params) {
@@ -501,14 +502,14 @@ function _civicrm_api3_job_process_batch_merge_spec(&$params) {
 }
 
 /**
- * Runs handlePaymentCron method in the specified payment processor
+ * Runs handlePaymentCron method in the specified payment processor.
  *
  * @param array $params
  *   Input parameters.
  *
- * Expected @params array keys are:
+ * Expected @params array keys are: INCORRECTLY DOCUMENTED AND SHOULD BE IN THE _spec function
+ * for retrieval via getfields.
  * {string  'processor_name' - the name of the payment processor, eg: Sagepay}
- *
  */
 function civicrm_api3_job_run_payment_cron($params) {
 
@@ -536,7 +537,9 @@ function civicrm_api3_job_run_payment_cron($params) {
 }
 
 /**
- * This api cleans up all the old session entries and temp tables. We recommend that sites run this on an hourly basis
+ * This api cleans up all the old session entries and temp tables.
+ *
+ * We recommend that sites run this on an hourly basis.
  *
  * @param array $params
  *   Sends in various config parameters to decide what needs to be cleaned.
@@ -568,26 +571,30 @@ function civicrm_api3_job_cleanup($params) {
 
 /**
  * Set expired relationships to disabled.
- * @param $params
+ *
+ * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
 function civicrm_api3_job_disable_expired_relationships($params) {
-  /** @noinspection PhpUnusedParameterInspection */
   $result = CRM_Contact_BAO_Relationship::disableExpiredRelationships();
   if (!$result) {
     throw new API_Exception('Failed to disable all expired relationships.');
   }
-  return civicrm_api3_create_success();
+  return civicrm_api3_create_success(1, $params);
 }
 
 /**
- * This api reloads all the smart groups. If the org has a large number of smart groups
- * it is recommended that they use the limit clause to limit the number of smart groups
- * evaluated on a per job basis. Might also help to increase the smartGroupCacheTimeout
- * and use the cache
+ * This api reloads all the smart groups.
+ *
+ * If the org has a large number of smart groups it is recommended that they use the limit clause
+ * to limit the number of smart groups evaluated on a per job basis.
+ *
+ * Might also help to increase the smartGroupCacheTimeout and use the cache.
  *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
index 8e3f152c1ef39d5bf810efcd9b2200e743e06f18..c44c4e1ab5572fa7e5943a79d89f70774013b649 100644 (file)
@@ -27,7 +27,7 @@
 
 
 /**
- * File for the CiviCRM APIv3 group functions
+ * File for the CiviCRM APIv3 line item functions
  *
  * @package CiviCRM_APIv3
  * @subpackage API_LineItem
  */
 
 /**
- * Create or update a line_item
+ * Create or update a line_item.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'line_item'
- * @example LineItemCreate.php Std Create example
+ *   Array of property name/value pairs to insert in new 'line_item'
  *
  * @return array
  *   api result array
@@ -67,7 +65,7 @@ function _civicrm_api3_line_item_create_spec(&$params) {
 }
 
 /**
- * Returns array of line_items  matching a set of one or more group properties
+ * Returns array of line_items  matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid property_name=>value pairs. If $params is set.
@@ -81,7 +79,7 @@ function civicrm_api3_line_item_get($params) {
 }
 
 /**
- * delete an existing line_item
+ * Delete an existing line_item.
  *
  * This method is used to delete any existing line_item. id of the group
  * to be deleted is required field in $params array
index f360e598dc4eb568a3fa7ce4c98ff301030bec79..fb7c5c1d48b75a697ec0c37704d9609be535bb51 100644 (file)
  */
 
 /**
- * Create or update a loc_block
+ * Create or update a loc_block.
  *
  * @param array $params
  *   Associative array of property.
  *                       name/value pairs to insert in new 'loc_block'
- * @example LocBlockCreate.php Std Create example
  *
  * @return array
- *   api result array
- *   {@getfields loc_block_create}
+ *   API result array.
  */
 function civicrm_api3_loc_block_create($params) {
   $entities = array();
@@ -87,15 +85,14 @@ function civicrm_api3_loc_block_create($params) {
 }
 
 /**
- * Returns array of loc_blocks matching a set of one or more properties
+ * Returns array of loc_blocks matching a set of one or more properties.
  *
  * @param array $params
  *   Array of one or more valid property_name=>value pairs. If $params is set.
  *   as null, all loc_blocks will be returned (default limit is 25)
  *
  * @return array
- *   Array of matching loc_blocks
- *   {@getfields loc_block_get}
+ *   API result array.
  */
 function civicrm_api3_loc_block_get($params) {
   $options = _civicrm_api3_get_options_from_params($params);
@@ -123,17 +120,13 @@ function civicrm_api3_loc_block_get($params) {
 }
 
 /**
- * delete an existing loc_block
- *
- * This method is used to delete any existing loc_block.
- * id of the record to be deleted is required field in $params array
+ * Delete an existing loc_block.
  *
  * @param array $params
  *   Array containing id of the record to be deleted.
  *
  * @return array
- *   API result array
- *   {@getfields loc_block_delete}
+ *   API result array.
  */
 function civicrm_api3_loc_block_delete($params) {
   return _civicrm_api3_basic_delete('CRM_Core_DAO_LocBlock', $params);
index 40fbdb62633624938dd951221ad2140b048518e8..31510dc7d986167abb77131515b82e55f3b1c585 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 
 /**
- *  Functions to inform caller that Location is obsolete and Address, Phone, Email, Website should be used
+ * Function to inform caller that Location is obsolete and Address, Phone, Email, Website should be used.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_location_create($params) {
@@ -10,6 +12,8 @@ function civicrm_api3_location_create($params) {
 }
 
 /**
+ * Function to inform caller that Location is obsolete and Address, Phone, Email, Website should be used.
+ *
  * @param array $params
  *
  * @return array
@@ -19,6 +23,8 @@ function civicrm_api3_location_get($params) {
 }
 
 /**
+ * Function to inform caller that Location is obsolete and Address, Phone, Email, Website should be used.
+ *
  * @param array $params
  *
  * @return array
index e03f7dbbe40c8d30a5d46d6a368d91836369eeaa..a2f466e93a993ceb0527d95308d231c54ef19530 100644 (file)
  */
 
 /**
- * Add a Location Type
- *
- * Allowed @params array keys are:
- *
- * @example LocationTypeCreate.php Standard Create Example
+ * Add a Location Type.
  *
  * @param array $params
  *
  * @return array
- *   API result array
- *   {@getfields email_create}
+ *   API result array.
  */
 function civicrm_api3_location_type_create($params) {
   //set display_name equal to name if it's not defined
@@ -71,31 +66,25 @@ function _civicrm_api3_location_type_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Location Type
+ * Deletes an existing Location Type.
  *
  * @param array $params
  *
- * @example LocationTypeDelete.php Standard Delete Example
- *
  * @return array
- *   API result array
- *   {@getfields LocationType_delete}
+ *   API result array.
  */
 function civicrm_api3_location_type_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Retrieve one or more Location Types
- *
- * @example LocationTypeGet.php Standard Get Example
+ * Retrieve one or more Location Types.
  *
  * @param array $params
  *   An associative array of name/value pairs.
  *
  * @return array
- *   api result
- *   {@getfields LocationType_get}
+ *   API result array.
  */
 function civicrm_api3_location_type_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index b4b2d1784a06ee6b09dc4572699bc39b34e24959..37d46c697bcb44f7865ae89e3dcf3f452cfe7cff 100644 (file)
  */
 
 /**
- * Create or update a mail_settings
+ * Create or update a mail_settings.
  *
  * @param array $params
- *   Associative array of property.
+ *   Array of property.
  *                       name/value pairs to insert in new 'mail_settings'
- * @example mail_settingsCreate.php Std Create example
  *
  * @return array
- *   api result array
- *   {@getfields mail_settings_create}
+ *   API result array.
  */
 function civicrm_api3_mail_settings_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -62,7 +60,7 @@ function _civicrm_api3_mail_settings_create_spec(&$params) {
 }
 
 /**
- * Returns array of mail_settings  matching a set of one or more group properties
+ * Returns array of mail_settings  matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid.
@@ -70,26 +68,21 @@ function _civicrm_api3_mail_settings_create_spec(&$params) {
  *                       as null, all mail_settings will be returned
  *
  * @return array
- *   Array of matching mail_settings
- *   {@getfields mail_settings_get}
+ *   API result array.
  */
 function civicrm_api3_mail_settings_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * delete an existing mail_settings
- *
- * This method is used to delete any existing mail_settings. id of the group
- * to be deleted is required field in $params array
+ * Delete an existing mail_settings.
  *
  * @param array $params
  *   Array containing id of the group.
  *                       to be deleted
  *
  * @return array
- *   api result array
- *   {@getfields mail_settings_delete}
+ *   API result array.
  */
 function civicrm_api3_mail_settings_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 653dce5d9bbf687c4f3178637943bb97ad79a5ad..7e36d2a7cb386fe0033cc6a6be885f6745ae0b39 100755 (executable)
  * @subpackage API_Mailing
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
  * Handle a create event.
  *
  * @param array $params
- * @return array API Success Array
+ *
+ * @return array
  *    API Success Array
  * @throws \API_Exception
  * @throws \Civi\API\Exception\UnauthorizedException
@@ -65,7 +65,10 @@ function civicrm_api3_mailing_create($params) {
 }
 
 /**
+ * Get mailing token.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -125,6 +128,7 @@ function civicrm_api3_mailing_delete($params) {
  * Handle a get event.
  *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_mailing_get($params) {
@@ -132,6 +136,8 @@ function civicrm_api3_mailing_get($params) {
 }
 
 /**
+ * Adjust metadata for mailing submit api function.
+ *
  * @param array $spec
  */
 function _civicrm_api3_mailing_submit_spec(&$spec) {
@@ -145,7 +151,10 @@ function _civicrm_api3_mailing_submit_spec(&$spec) {
 }
 
 /**
+ * Mailing submit.
+ *
  * @param array $params
+ *
  * @return array
  * @throws API_Exception
  */
@@ -162,11 +171,11 @@ function civicrm_api3_mailing_submit($params) {
   $updateParams = array();
   $updateParams['id'] = $params['id'];
 
-  // the BAO will autocreate the job
-  $updateParams['api.mailing_job.create'] = 0; // note: exact match to API default
+  // The BAO will auto-create the job - note: exact match to API default.
+  $updateParams['api.mailing_job.create'] = 0;
 
-  // note: we'll pass along scheduling/approval fields, but they may get ignored
-  // if we don't have permission
+  // Note: we'll pass along scheduling/approval fields, but they may get ignored
+  // if we don't have permission.
   if (isset($params['scheduled_date'])) {
     $updateParams['scheduled_date'] = $params['scheduled_date'];
     $updateParams['scheduled_id'] = CRM_Core_Session::getLoggedInContactID();
@@ -211,7 +220,7 @@ function civicrm_api3_mailing_event_bounce($params) {
 }
 
 /**
- * Adjust Metadata for bounce_spec action
+ * Adjust Metadata for bounce_spec action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -230,7 +239,8 @@ function _civicrm_api3_mailing_event_bounce_spec(&$params) {
 }
 
 /**
- * Handle a confirm event
+ * Handle a confirm event.
+ *
  * @deprecated
  *
  * @param array $params
@@ -242,6 +252,8 @@ function civicrm_api3_mailing_event_confirm($params) {
 }
 
 /**
+ * Declare deprecated functions.
+ *
  * @deprecated api notice
  * @return array
  *   Array of deprecated actions
@@ -251,7 +263,7 @@ function _civicrm_api3_mailing_deprecation() {
 }
 
 /**
- * Handle a reply event
+ * Handle a reply event.
  *
  * @param array $params
  *
@@ -278,7 +290,7 @@ function civicrm_api3_mailing_event_reply($params) {
 }
 
 /**
- * Adjust Metadata for event_reply action
+ * Adjust Metadata for event_reply action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -297,7 +309,7 @@ function _civicrm_api3_mailing_event_reply_spec(&$params) {
 }
 
 /**
- * Handle a forward event
+ * Handle a forward event.
  *
  * @param array $params
  *
@@ -321,7 +333,7 @@ function civicrm_api3_mailing_event_forward($params) {
 }
 
 /**
- * Adjust Metadata for event_forward action
+ * Adjust Metadata for event_forward action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -340,7 +352,7 @@ function _civicrm_api3_mailing_event_forward_spec(&$params) {
 }
 
 /**
- * Handle a click event
+ * Handle a click event.
  *
  * @param array $params
  *
@@ -366,7 +378,7 @@ function civicrm_api3_mailing_event_click($params) {
 }
 
 /**
- * Handle an open event
+ * Handle an open event.
  *
  * @param array $params
  *
@@ -391,7 +403,11 @@ function civicrm_api3_mailing_event_open($params) {
 }
 
 /**
+ * Preview mailing.
+ *
  * @param array $params
+ *   Array per getfields metadata.
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -440,6 +456,8 @@ function civicrm_api3_mailing_preview($params) {
 }
 
 /**
+ * Adjust metadata for send test function.
+ *
  * @param array $spec
  */
 function _civicrm_api3_mailing_send_test_spec(&$spec) {
@@ -448,7 +466,10 @@ function _civicrm_api3_mailing_send_test_spec(&$spec) {
 }
 
 /**
+ * Send test mailing.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  * @throws \CiviCRM_API3_Exception
@@ -537,7 +558,7 @@ function civicrm_api3_mailing_send_test($params) {
 }
 
 /**
- * Adjust Metadata for send_mail action
+ * Adjust Metadata for send_mail action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -550,7 +571,10 @@ function _civicrm_api3_mailing_stats_spec(&$params) {
 }
 
 /**
+ * Function which needs to be explained.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -609,10 +633,13 @@ function civicrm_api3_mailing_stats($params) {
 }
 
 /**
- * Fix the reset dates on the email record based on when a mail was last delivered
+ * Fix the reset dates on the email record based on when a mail was last delivered.
+ *
  * We only consider mailings that were completed and finished in the last 3 to 7 days
  * Both the min and max days can be set via the params
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_mailing_update_email_resetdate($params) {
index e7b9496bf5e3e727c71b2564ef60bfcfd8fcc089..8685246a110a27da077123c78adce0bfcec4f559 100755 (executable)
  * @subpackage API_MailingAB
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * Handle a create mailing ab testing
+ * Handle a create mailing ab testing.
  *
  * @param array $params
  *
@@ -64,6 +63,7 @@ function civicrm_api3_mailing_a_b_delete($params) {
  * Handle a get event.
  *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_mailing_a_b_get($params) {
@@ -71,7 +71,7 @@ function civicrm_api3_mailing_a_b_get($params) {
 }
 
 /**
- * Adjust Metadata for submit action
+ * Adjust Metadata for submit action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -93,9 +93,10 @@ function _civicrm_api3_mailing_a_b_submit_spec(&$params) {
 }
 
 /**
- * Send A/B mail to A/B recipients respectively
+ * Send A/B mail to A/B recipients respectively.
  *
  * @param array $params
+ *
  * @return array
  * @throws API_Exception
  */
@@ -162,7 +163,7 @@ function civicrm_api3_mailing_a_b_submit($params) {
 }
 
 /**
- * Adjust Metadata for graph_stats action
+ * Adjust Metadata for graph_stats action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -183,9 +184,10 @@ function _civicrm_api3_mailing_a_b_graph_stats_spec(&$params) {
 }
 
 /**
- * Send graph detail for A/B tests mail
+ * Send graph detail for A/B tests mail.
  *
  * @param array $params
+ *
  * @return array
  * @throws API_Exception
  */
index 4e3634c82eacd7b6cc1ef03c16ab0a4abdb21f22..6e8744a477708bcd067f6186b42dff35942e1201 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_mailing_component
- *
  */
 
 /**
- * Save a mailing_component
- *
- * Allowed @params array keys are:
- * {@getfields mailing_component_create}
- * @example mailing_componentCreate.php
+ * Save a mailing_component.
  *
  * @param array $params
  *
  * @throws API_Exception
  * @return array
- *   Array of newly created mailing_component property values.
+ *   API result array.
  */
 function civicrm_api3_mailing_component_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Get a mailing_component
- *
- * Allowed @params array keys are:
- * {@getfields mailing_component_get}
- * @example mailing_componentCreate.php
+ * Get a mailing_component.
  *
  * @param array $params
  *
  * @return array
- *   Array of retrieved mailing_component property values.
+ *   API result array.
  */
 function civicrm_api3_mailing_component_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Delete a mailing_component
- *
- * Allowed @params array keys are:
- * {@getfields mailing_component_delete}
- * @example mailing_componentCreate.php
+ * Delete a mailing_component.
  *
  * @param array $params
  *
  * @throws API_Exception
  * @return array
- *   Array of deleted values.
+ *   API result array.
  */
 function civicrm_api3_mailing_component_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index f58575e605918af19f388aa0144300f62c7d2ea6..cc8d00841d3a11458451860548fe58712bd7e966 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id$
- *
  */
 
 /**
- * Get all the mailings and details that a contact was involved with
+ * Get all the mailings and details that a contact was involved with.
  *
  * @param array $params
  *   Input parameters - see _spec for details (returned by getfields)
@@ -49,10 +48,11 @@ function civicrm_api3_mailing_contact_get($params) {
   return civicrm_api3_create_success(_civicrm_api3_mailing_contact_getresults($params, FALSE));
 }
 /**
- * This is a wrapper for the functions that return the results from the 'quasi-entity'
- * mailing contact
+ * This is a wrapper for the functions that return the results from the 'quasi-entity' mailing contact.
+ *
  * @param array $params
  * @param bool $count
+ *
  * @throws Exception
  */
 function _civicrm_api3_mailing_contact_getresults($params, $count) {
@@ -70,8 +70,9 @@ function _civicrm_api3_mailing_contact_getresults($params, $count) {
       $count
   );
 }
+
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * @param array $params
  *   Array or parameters determined by getfields.
@@ -91,6 +92,8 @@ function _civicrm_api3_mailing_contact_get_spec(&$params) {
 }
 
 /**
+ * Helper function for mailing contact queries.
+ *
  * @param int $contactID
  * @param $offset
  * @param $limit
@@ -199,6 +202,8 @@ LIMIT %2, %3
 }
 
 /**
+ * Get delivered mailing contacts.
+ *
  * @param int $contactID
  * @param $offset
  * @param $limit
@@ -238,6 +243,8 @@ AND        meb.id IS NULL
 }
 
 /**
+ * Get bounced mailing contact records.
+ *
  * @param int $contactID
  * @param $offset
  * @param $limit
@@ -270,7 +277,7 @@ INNER JOIN civicrm_mailing_event_bounce meb ON meb.event_queue_id = meq.id
 }
 
 /**
- * Get count of all the mailings that a contact was involved with
+ * Get count of all the mailings that a contact was involved with.
  *
  * @param array $params
  *   Input parameters per getfields
index a2bdbba103c544e5c75dc1a501b33608cef9ac5d..ac3bb377fe7acf66c49c00566c29d3eee17e21c9 100644 (file)
  * @subpackage API_MailerGroup
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * Handle a confirm event
+ * Handle a confirm event.
  *
  * @param array $params
- *   Associative array of property.
+ *   Array of property.
  *
  * @throws Exception
  * @return array
@@ -58,7 +57,10 @@ function civicrm_api3_mailing_event_queue_create($params) {
 }
 
 /**
+ * Get mailing event queue record.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_mailing_event_queue_get($params) {
@@ -66,7 +68,10 @@ function civicrm_api3_mailing_event_queue_get($params) {
 }
 
 /**
+ * Delete mailing event queue record.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
index 82cbf2509b8f4d44f4f41735832868b681d4aaa2..ea3c57326d075f85cefff1603d7bfface73a421c 100644 (file)
  * @subpackage API_MailerGroup
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * Subscribe from mailing group
+ * Subscribe from mailing group.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'survey'
+ *   Array per getfields metadata.
  *
  * @throws API_Exception
  * @return array
  *   api result array
- *   {@getfields mailing_event_subscribe_create}
  */
 function civicrm_api3_mailing_event_subscribe_create($params) {
   $email      = $params['email'];
index 6404877fdc9207d68b8386b45a9b0a3a1386f5ad..2a0172f0ef3a2aab0a433582eb34e8fe5d11a0a7 100644 (file)
  * @subpackage API_MailerGroup
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * Unsubscribe from mailing group
+ * Unsubscribe from mailing group.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'survey'
+ *   Array per getfields metadata.
  *
- * @return array  api result array {@getfields mailing_event_unsubscribe_create}
+ * @return array
+ *   Api result array
  */
 function civicrm_api3_mailing_event_unsubscribe_create($params) {
 
index 29c3acc388237d95d1d3c7a29853a853aa6f71be..51f64bb4ae1f67915666dd590209efc43fe6f2b8 100644 (file)
  * @subpackage API_MailerGroup
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
+ * Declare deprecated functions.
+ *
  * @deprecated api notice
  * @return string
  *   to indicate this entire api entity is deprecated
@@ -46,7 +47,8 @@ function _civicrm_api3_mailing_group_deprecation() {
 }
 
 /**
- * Handle an unsubscribe event
+ * Handle an unsubscribe event.
+ *
  * @deprecated
  *
  * @param array $params
@@ -58,7 +60,8 @@ function civicrm_api3_mailing_group_event_unsubscribe($params) {
 }
 
 /**
- * Handle a site-level unsubscribe event
+ * Handle a site-level unsubscribe event.
+ *
  * @deprecated
  *
  * @param array $params
@@ -71,7 +74,8 @@ function civicrm_api3_mailing_group_event_domain_unsubscribe($params) {
 }
 
 /**
- * Handle a resubscription event
+ * Handle a re-subscription event.
+ *
  * @deprecated
  *
  * @param array $params
@@ -83,7 +87,8 @@ function civicrm_api3_mailing_group_event_resubscribe($params) {
 }
 
 /**
- * Handle a subscription event
+ * Handle a subscription event.
+ *
  * @deprecated
  *
  * @param array $params
@@ -95,7 +100,10 @@ function civicrm_api3_mailing_group_event_subscribe($params) {
 }
 
 /**
+ * Create mailing group.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -104,6 +112,8 @@ function civicrm_api3_mailing_group_create($params) {
 }
 
 /**
+ * Get mailing group.
+ *
  * @param array $params
  *
  * @return array
@@ -113,7 +123,10 @@ function civicrm_api3_mailing_group_get($params) {
 }
 
 /**
+ * Delete mailing group.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -122,7 +135,10 @@ function civicrm_api3_mailing_group_delete($params) {
 }
 
 /**
+ * Get metadata for mailing group functions.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_mailing_group_getfields($params) {
index 617d9339a3c900e53845b54274b5dc81d4a823c0..a8604a3efbad60f0d14ce17c7433a3b88908d6c3 100644 (file)
  * @subpackage API_Mailing
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
  * Handle creation of a Mailing Job for a Mailing.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -61,14 +62,13 @@ function _civicrm_api3_mailing_job_create_spec(&$params) {
 }
 
 /**
- * Returns array of Mailing Jobs  matching a set of one or more group properties
+ * Returns array of Mailing Jobs matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid.
  *
  * @return array
  *   API return Array of matching mailing jobs.
- *   {@getfields mailing_job_get}
  */
 function civicrm_api3_mailing_job_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -76,7 +76,9 @@ function civicrm_api3_mailing_job_get($params) {
 
 /**
  * Handle deletion of a Mailing Job for a Mailing.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
index 4a9332b4130f30a5d17f7554b8088521ebd1ae31..f745f20388429bda6df9037d9aaf2e4fa33ca33a 100644 (file)
  * @subpackage API_Mailing
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 
 /**
- * Returns array of Mailing Recipients
+ * Returns array of Mailing Recipients.
  *
  * @param array $params
- *   Array of one or more valid.
+ *   Array per getfields metadata.
  *
  * @return array
  *   API return Array of matching mailing jobs
index f65051686b5e54d0f8014ecd0f5b86a377412dd0..9e99405acd60808d17b3b90ae3a1bce6267b9cdb 100644 (file)
  */
 
 /**
- * Deletes an existing contact membership
- *
- * This API is used for deleting a contact membership
+ * Deletes an existing contact membership.
  *
  * @param array $params
  *   Array array holding id - Id of the contact membership to be deleted.
  *
  * @return array
- *   api result
- *   {@getfields membership_delete}
+ *   API result array.
  */
 function civicrm_api3_membership_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Create a Contact Membership
+ * Create a Contact Membership.
  *
  * This API is used for creating a Membership for a contact.
  * Required parameters : membership_type_id and status_id.
  *
  * @param array $params
- *   An associative array of name/value property values of civicrm_membership.
+ *   Array of name/value property values of civicrm_membership.
  *
  * @return array
- *   Array of newly created membership property values.
- *   {@getfields membership_create}
+ *   API result array.
  */
 function civicrm_api3_membership_create($params) {
   // check params for membership id during update
   if (!empty($params['id']) && !isset($params['skipStatusCal'])) {
-    //don't calculate status on exisiting membership - expect API use to pass them in
-    // or leave unchanged
+    // Don't calculate status on existing membership - expect API use to pass them in
+    // or leave unchanged.
     $params['skipStatusCal'] = 1;
   }
   else {
@@ -165,8 +161,9 @@ function _civicrm_api3_membership_create_spec(&$params) {
     'type' => CRM_Utils_Type::T_INT,
   );
 }
+
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -175,6 +172,10 @@ function _civicrm_api3_membership_create_spec(&$params) {
  */
 function _civicrm_api3_membership_get_spec(&$params) {
   $params['membership_type_id']['api.aliases'] = array('membership_type');
+  $params['active_only'] = array(
+    'title' => 'Only retrieve active memberships',
+    'type' => CRM_Utils_Type::T_BOOLEAN,
+  );
 }
 
 /**
@@ -225,6 +226,8 @@ function civicrm_api3_membership_get($params) {
 }
 
 /**
+ * Perform api v2 custom behaviour.
+ *
  * When we copied apiv3 from api v2 we brought across some custom behaviours - in the case of
  * membership a complicated return array is constructed. The original
  * behaviour made contact_id a required field. We still need to keep this for v3 when contact_id
@@ -252,7 +255,7 @@ function _civicrm_api3_membership_get_customv2behaviour(&$params, $membershipTyp
 
 
 /**
- * non-standard behaviour inherited from v2
+ * Non-standard behaviour inherited from v2.
  *
  * @param array $params
  *   Parameters passed into get function.
@@ -286,7 +289,7 @@ function _civicrm_api3_membership_relationsship_get_customv2behaviour(&$params,
 
   $members = $membershipValues;
 
-  // populating contacts in members array based on their relationship with direct members.
+  // Populating contacts in members array based on their relationship with direct members.
   if (!empty($relationships)) {
     foreach ($relationships as $relTypeId => $membershipId) {
       // As members are not direct members, there should not be
index ed21a65ff6fe6ee929191633c56db2fd12101414..a5d200512df652c259ac1bc3009b005c5a492dca 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: MembershipBlock.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * API to Create or update a Membership Type
+ * API to Create or update a Membership Type.
  *
  * @param array $params
  *   An associative array of name/value property values of civicrm_membership_block.
@@ -80,7 +79,7 @@ function civicrm_api3_membership_block_get($params) {
 }
 
 /**
- * Deletes an existing membership type
+ * Deletes an existing membership type.
  *
  * This API is used for deleting a membership type
  * Required parameters : id of a membership type
index 9f1e9a8305bade58b8204b755f5b5f079c4a023d..2f2e8c0f943d2d657b94944734f864485ffb3733 100644 (file)
  */
 
 /**
- * Add or update a link between contribution and membership
+ * Add or update a link between contribution and membership.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *   Input parameters.
  *
  * @return array
- *   (reference )        membership_payment_id of created or updated record
- *   {@getfields MembershipPayment_create}
- * @example MembershipPaymentCreate.php
+ *   API result array.
  */
 function civicrm_api3_membership_payment_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -64,16 +62,13 @@ function _civicrm_api3_membership_payment_create_spec(&$params) {
 }
 
 /**
- * Retrieve one / all contribution(s) / membership(s) linked to a
- * membership / contrbution.
+ * Retrieve one or more membership payment records.
  *
  * @param array $params
  *   Input parameters.
  *
  * @return array
- *   array of properties, if error an array with an error id and error message
- * @example MembershipPaymentGet
- * {@getfields MembershipPayment_get}
+ *   API result array.
  */
 function civicrm_api3_membership_payment_get($params) {
   return _civicrm_api3_basic_get('CRM_Member_DAO_MembershipPayment', $params);
index 9be467237db26d8f81ef59e26a935d2cb342849a..3e8a7d2e7d4021f2a30066d48d52ad23e043fd5b 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: MembershipStatus.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * Create a Membership Status
- *
- * This API is used for creating a Membership Status
+ * Create a Membership Status.
  *
  * @param array $params
- *   An associative array of name/value property values of civicrm_membership_status.
+ *   Array of name/value property values of civicrm_membership_status.
  *
  * @return array
  *   Array of newly created membership status property values.
- *   {@getfields MembershipStatus_create}
  */
 function civicrm_api3_membership_status_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -69,19 +65,20 @@ function civicrm_api3_membership_status_get($params) {
 }
 
 /**
- * Update an existing membership status
+ * Update an existing membership status.
  *
  * This api is used for updating an existing membership status.
  * Required parameters : id of a membership status
  *
  * @param array $params
- *   An associative array of name/value property values of civicrm_membership_status.
+ *   Array of name/value property values of civicrm_membership_status.
+ *
  * @deprecated - should just use create
  *
  * @return array
  *   Array of updated membership status property values
  */
-function &civicrm_api3_membership_status_update($params) {
+function civicrm_api3_membership_status_update($params) {
 
   civicrm_api3_verify_mandatory($params, NULL, array('id'));
   //don't allow duplicate names.
@@ -112,11 +109,12 @@ function &civicrm_api3_membership_status_update($params) {
 }
 
 /**
- * Deletes an existing membership status
+ * Deletes an existing membership status.
  *
  * This API is used for deleting a membership status
  *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_membership_status_delete($params) {
@@ -126,7 +124,7 @@ function civicrm_api3_membership_status_delete($params) {
 }
 
 /**
- * Derives the Membership Status of a given Membership Reocrd
+ * Derives the Membership Status of a given Membership Record.
  *
  * This API is used for deriving Membership Status of a given Membership
  * record using the rules encoded in the membership_status table.
@@ -137,7 +135,6 @@ function civicrm_api3_membership_status_delete($params) {
  *
  * @return array
  *   Array of status id and status name
- * @public
  */
 function civicrm_api3_membership_status_calc($membershipParams) {
   if (!($membershipID = CRM_Utils_Array::value('membership_id', $membershipParams))) {
index b25d6233e0ba3dba7c8a6c013fdbbbdd631357d6..e5f102197f8a4cf2bf7aea9341434c858efff528 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: MembershipType.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * API to Create or update a Membership Type
+ * API to Create or update a Membership Type.
  *
  * @param array $params
- *   An associative array of name/value property values of civicrm_membership_type.
+ *   Array of name/value property values of civicrm_membership_type.
  *
  * @return array
- *   newly created or updated membership type property values.
+ *   API result array.
  */
 function civicrm_api3_membership_type_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Membership_type');
@@ -73,26 +72,22 @@ function _civicrm_api3_membership_type_create_spec(&$params) {
  * This api is used for finding an existing membership type.
  *
  * @param array $params
- *   An associative array of name/value property values of civicrm_membership_type.
- * {getfields MembershipType_get}
+ *   Array of name/value property values of civicrm_membership_type.
  *
  * @return array
- *   Array of all found membership type property values.
+ *   API result array.
  */
 function civicrm_api3_membership_type_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Deletes an existing membership type
- *
- * This API is used for deleting a membership type
- * Required parameters : id of a membership type
+ * Deletes an existing membership type.
  *
  * @param array $params
  *
- * @return bool
- *   true if success, else false
+ * @return array
+ *   API result array.
  */
 function civicrm_api3_membership_type_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index f676883f47e390950557fa29201b3b7b34e33dcf..1a330542c6d7cf4c334ba19472c7af55140f0855 100644 (file)
  * File for the CiviCRM APIv3 message_template functions
  *
  * @package CiviCRM_SEPA
- *
  */
 
 /**
+ * Create message template.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -58,6 +60,8 @@ function _civicrm_api3_message_template_create_spec(&$params) {
 }
 
 /**
+ * Delete message template.
+ *
  * @param array $params
  *
  * @return bool
@@ -68,19 +72,21 @@ function civicrm_api3_message_template_delete($params) {
 }
 
 /**
+ * Adjust metadata for message_template get action.
+ *
  * @param array $params
  */
 function _civicrm_api3_message_template_get_spec(&$params) {
 }
 
 /**
- * Retrieve one or more message_template
+ * Retrieve one or more message_template.
  *
  * @param array $params
- *   An associative array of name/value pairs.
+ *   Array of name/value pairs.
  *
  * @return array
- *   api result array
+ *   API result array.
  */
 function civicrm_api3_message_template_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -88,6 +94,7 @@ function civicrm_api3_message_template_get($params) {
 
 /**
  * Sends a template.
+ *
  * @param array $params
  */
 function civicrm_api3_message_template_send($params) {
index 0b1e379f68df4a1edd90a09d638d2403e6039df0..0322f11079e8734b9c27741c645a0fd84f9a1086 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Note.php 30879 2010-11-22 15:45:55Z shot $
- *
  */
 
 /**
- * Create Note
+ * Create Note.
  *
  * This API is used for creating a note.
  * Required parameters : entity_id AND note
@@ -69,15 +68,14 @@ function _civicrm_api3_note_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing note
+ * Deletes an existing note.
  *
  * This API is used for deleting a note
  *
  * @param array $params
  *   Including id of the note to be deleted.
- * {@getfields note_delete}
  *
- * @return null
+ * @return array
  */
 function civicrm_api3_note_delete($params) {
 
@@ -86,7 +84,7 @@ function civicrm_api3_note_delete($params) {
 }
 
 /**
- * Retrieve a specific note, given a set of input params
+ * Retrieve a specific note or notes, given a set of input params.
  *
  * @param array $params
  *   Input parameters.
@@ -94,8 +92,6 @@ function civicrm_api3_note_delete($params) {
  * @return array
  *   array of properties,
  *   if error an array with an error id and error message
- *
- *   {@getfields note_get}
  */
 function civicrm_api3_note_get($params) {
 
@@ -103,7 +99,7 @@ function civicrm_api3_note_get($params) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -115,10 +111,10 @@ function _civicrm_api3_note_get_spec(&$params) {
 }
 
 /**
- * Get all descendents of given note
+ * Get all descendants of given note.
  *
  * @param array $params
- *   Associative array; only required 'id' parameter is used.
+ *   array; only required 'id' parameter is used.
  *
  * @return array
  *   Nested associative array beginning with direct children of given note.
index a80e7f5bb5e81aff2200531d155a6adf04bc3ab6..d3a5f495bd2f34314837044d67b575414b59c682 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
 /**
+ * Get option groups.
+ *
  * @param array $params
  *
  * @return array
@@ -10,19 +12,12 @@ function civicrm_api3_option_group_get($params) {
 }
 
 /**
- * create/update survey
- *
- * This API is used to create new survey or update any of the existing
- * In case of updating existing survey, id of that particular survey must
- * be in $params array.
+ * Create/update option group.
  *
  * @param array $params
- *   (reference) Associative array of property.
- *   name/value pairs to insert in new 'survey'
+ *   Array per getfields metadata.
  *
  * @return array
- *   survey array
- *
  */
 function civicrm_api3_option_group_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -52,7 +47,6 @@ function _civicrm_api3_option_group_create_spec(&$params) {
  *
  * @return array
  *   API Result Array
- *   {@getfields OptionGroup_delete}
  */
 function civicrm_api3_option_group_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 3c1e5804a2234ca2fba6d242f9ce7ea6a2b0e1e5..785ec02241d9cbb4f625dda7c435a2d7a0c6eda1 100644 (file)
@@ -1,16 +1,12 @@
 <?php
 
 /**
- * Retrieve one or more OptionValues
+ * Retrieve one or more option values.
  *
  * @param array $params
  *
- * {@example OptionValueGet.php 0}
- * @example OptionValueGet.php
- *
  * @return array
- *   details of found Option Values
- *   {@getfields OptionValue_get}
+ *   Details of found Option Values
  */
 function civicrm_api3_option_value_get($params) {
 
@@ -27,18 +23,13 @@ function civicrm_api3_option_value_get($params) {
 }
 
 /**
- *  Add a OptionValue. OptionValues are used to classify CRM entities (including Contacts, Groups and Actions).
- *
- * Allowed @params array keys are:
- *
- * {@example OptionValueCreate.php}
+ * Add an OptionValue.
  *
  * @param array $params
  *
  * @throws API_Exception
  * @return array
  *   Array of newly created option_value property values.
- *   {@getfields OptionValue_create}
  */
 function civicrm_api3_option_value_create($params) {
   $result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -72,18 +63,15 @@ function _civicrm_api3_option_value_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing OptionValue
+ * Deletes an existing option value.
  *
  * @param array $params
  *
- * {@example OptionValueDelete.php 0}
- *
  * @return array
  *   Api result
- *   {@getfields OptionValue_create}
  */
 function civicrm_api3_option_value_delete($params) {
-  // we will get the option group id before deleting so we can flush pseudoconstants
+  // We will get the option group id before deleting so we can flush pseudoconstants.
   $optionGroupID = civicrm_api('option_value', 'getvalue', array('version' => 3, 'id' => $params['id'], 'return' => 'option_group_id'));
   if (CRM_Core_BAO_OptionValue::del((int) $params['id'])) {
     civicrm_api('option_value', 'getfields', array('version' => 3, 'cache_clear' => 1, 'option_group_id' => $optionGroupID));
index 458863cd6e0a579be91d308741dd69a28b0be4f8..5a5ec3bf07ce68cae35c66025e21b665ac8430dc 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Participant.php 30486 2010-11-02 16:12:09Z shot $
- *
  */
 
 /**
- * Create an Event Participant
- *
- * This API is used for creating a participants in an event.
- * Required parameters : event_id AND contact_id for new creation
- *                     : participant as name/value with participantid for edit
+ * Create an Event Participant.
  *
  * @param array $params
  *   An associative array of name/value property values of civicrm_participant.
  *
  * @return array
- *   apiresult
- *   {@getfields participant_create}
+ *   API result array
  */
 function civicrm_api3_participant_create($params) {
-  //check that event id is not an template - should be done @ BAO layer
+  // Check that event id is not an template - should be done @ BAO layer.
   if (!empty($params['event_id'])) {
     $isTemplate = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'is_template');
     if (!empty($isTemplate)) {
@@ -74,10 +68,13 @@ function civicrm_api3_participant_create($params) {
 }
 
 /**
+ * Create a default participant line item.
+ *
  * @todo this should be done in the BAO not the api
- * Create a default participant line item
+ *
  * @param array $params
  * @param $participant
+ *
  * @throws \CiviCRM_API3_Exception
  */
 function _civicrm_api3_participant_createlineitem(&$params, $participant) {
@@ -155,16 +152,13 @@ function _civicrm_api3_participant_create_spec(&$params) {
 }
 
 /**
- * Retrieve a specific participant, given a set of input params
- * If more than one matching participant exists, return an error, unless
- * the client has requested to return the first found contact
+ * Retrieve a specific participant, given a set of input params.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *   input parameters.
  *
  * @return array
- *   (reference )        array of properties, if error an array with an error id and error message
- *   {@getfields participant_get}
+ *   array of properties, if error an array with an error id and error message
  */
 function civicrm_api3_participant_get($params) {
   $mode = CRM_Contact_BAO_Query::MODE_EVENT;
@@ -183,7 +177,7 @@ function civicrm_api3_participant_get($params) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -196,14 +190,13 @@ function _civicrm_api3_participant_get_spec(&$params) {
 }
 
 /**
- * Deletes an existing contact participant
+ * Deletes an existing contact participant.
  *
  * This API is used for deleting a contact participant
  *
  * @param array $params
  *   Array containing Id of the contact participant to be deleted.
  *
- * {@getfields participant_delete}
  * @throws Exception
  * @return array
  */
index 007254fee11324fc4ee1f418dd117d8f2326f7e3..1720dfb13282344e2ce0e9fb95ba30af903c5905 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Participant.php 30486 2010-11-02 16:12:09Z shot $
- *
  */
 
 /**
- * Create a Event Participant Payment
+ * Create a Event Participant Payment.
  *
  * This API is used for creating a Participant Payment of Event.
  * Required parameters : participant_id, contribution_id.
@@ -76,16 +75,12 @@ function _civicrm_api3_participant_payment_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Participant Payment
- *
- * This API is used for deleting a Participant Payment
+ * Deletes an existing Participant Payment.
  *
  * @param array $params
  *
  * @return array
  *   API result
- * @example ParticipantPaymentDelete.php
- * {@getfields ParticipantPayment_delete}
  */
 function civicrm_api3_participant_payment_delete($params) {
   $participant = new CRM_Event_BAO_ParticipantPayment();
@@ -93,16 +88,13 @@ function civicrm_api3_participant_payment_delete($params) {
 }
 
 /**
- * Retrieve one / all contribution(s) / participant(s) linked to a
- * contribution.
+ * Retrieve one or more participant payment records.
  *
  * @param array $params
  *   Input parameters.
  *
  * @return array
  *   array of properties, if error an array with an error id and error message
- * @example ParticipantPaymentGet
- * {@getfields ParticipantPayment_get}
  */
 function civicrm_api3_participant_payment_get($params) {
   return _civicrm_api3_basic_get('CRM_Event_DAO_ParticipantPayment', $params);
index 9b8870f87641aaa4f46b35b938c0fcffd01ad6af..f08ee8dd7d13a6f85fbc14f6dfe35a930bd5b52f 100644 (file)
  */
 
 /**
- * create/update participant_status
+ * Create/update participant_status.
  *
  * This API is used to create new participant_status or update any of the existing
  * In case of updating existing participant_status, id of that particular participant_status must
  * be in $params array.
  *
  * @param array $params
- *   Associative array of property.
+ *   Array of property.
  *                       name/value pairs to insert in new 'participant_status'
  *
  * @return array
  *   participant_status array
- *   {@getfields ParticipantStatusType_create}
- * @example ParticipantStatusTypeCreate.php
  */
 function civicrm_api3_participant_status_type_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Returns array of participant_statuses  matching a set of one or more group properties
+ * Returns array of participant_statuses matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid.
@@ -63,27 +61,23 @@ function civicrm_api3_participant_status_type_create($params) {
  *
  * @return array
  *   Array of matching participant_statuses
- *   {@getfields ParticipantStatusType_get}
- * @example ParticipantStatusTypeGet.php
  */
 function civicrm_api3_participant_status_type_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * delete an existing participant_status
+ * Delete an existing participant_status.
  *
  * This method is used to delete any existing participant_status. id of the group
  * to be deleted is required field in $params array
  *
  * @param array $params
- *   (reference) array containing id of the group.
+ *   Array containing id of the group.
  *                       to be deleted
  *
  * @return array
  *   api result array
- *   {@getfields ParticipantStatusType_delete}
- * @example ParticipantStatusTypeDelete.php
  */
 function civicrm_api3_participant_status_type_delete($params) {
   if (CRM_Event_BAO_ParticipantStatusType::deleteParticipantStatusType($params['id'])) {
index 81424aad1a2627203402d96051eb8601cda262c0..1ced6d606ee4843864dd8ca5f4bc21d578c3147f 100644 (file)
  */
 
 /**
- * Add/Update a PaymentProcessor
- *
- * Allowed @params array keys are:
- * {@getfields payment_processor_create}
+ * Add/Update a PaymentProcessor.
  *
  * @param array $params
  *
@@ -64,10 +61,9 @@ function _civicrm_api3_payment_processor_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing PaymentProcessor
+ * Deletes an existing PaymentProcessor.
  *
  * @param array $params
- * {@getfields payment_processor_delete}
  *
  * @return array
  *   API result Array
@@ -77,11 +73,10 @@ function civicrm_api3_payment_processor_delete($params) {
 }
 
 /**
- * Retrieve one or more PaymentProcessor
+ * Retrieve one or more PaymentProcessor.
  *
  * @param array $params
- *   An associative array of name/value pairs.
- * {@getfields payment_processor_get}
+ *   Array of name/value pairs.
  *
  * @return array
  *   details of found PaymentProcessor
index 708460ac53198a0a76d3939ab3eb7d83a6c07e37..5d671ebc66c2ce82af0347a52c9098bbe47d5fc8 100644 (file)
  * @subpackage API_Contact
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: PaymentProcessorType.php 30415 2010-10-29 12:02:47Z shot $
- *
- */
-
-/**
- * Include common API util functions
  */
 
 /**
- * create payment_processor type
+ * Create payment_processor type.
  *
  * @param array $params
  *   Associative array of property name/value pairs to insert in new payment_processor type.
@@ -81,8 +76,10 @@ function _civicrm_api3_payment_processor_type_create_spec(&$params) {
 }
 
 /**
- * get all payment_processor types
+ * Get all payment_processor types.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_payment_processor_type_get($params) {
@@ -90,7 +87,7 @@ function civicrm_api3_payment_processor_type_get($params) {
 }
 
 /**
- * Delete a payment_processor type delete
+ * Delete a payment_processor type delete.
  *
  * @param array $params
  *
index 6939e3cf2ff61682e2a6b19654e5b2a3c3de7734..8e30768cf561d8089c1bc1b8b0478ee92f7f2657 100644 (file)
  */
 
 /**
- *  Add an Phone for a contact
- *
- * Allowed @params array keys are:
- * {@getfields phone_create}
- * @example PhoneCreate.php
+ * Add an Phone for a contact.
  *
  * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array
  *   Array of newly created phone property values.
@@ -67,14 +64,13 @@ function _civicrm_api3_phone_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Phone
+ * Delete an existing Phone.
  *
  * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array
  *   Api Result
- *   {@getfields phone_delete}
- * @example PhoneDelete.php
  */
 function civicrm_api3_phone_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 8edc255b9805a4bfe672ae8fa770651445867bb7..afa99b2f7aeeac54714964a2517172fdef72d2ae 100644 (file)
@@ -10,7 +10,7 @@
  * your module under api/v3/Phone/Dial.php.
  *
  * @param array $params
- *   An associative array of name/value pairs.
+ *   Array per getfields metadata.
  *
  * @return array
  *   details of found phones else error
index 1e3c340474e693eae4a702e11c23a96f331fa4af..bee68ca562459d1448a1d824685da36e8e32e0fd 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Pledge.php
- *
- */
-
-/**
- * Include utility functions
  */
 
 /**
- * Creates or updates an Activity. See the example for usage
+ * Create or updates an Pledge.
  *
- * @param array $params
- *   Associative array of property name/value.
- *                             pairs for the activity.
- * {@getfields pledge_create}
+ * @param $params
  *
  * @return array
  *   Array containing 'is_error' to denote success or failure and details of the created pledge
- *
- * @example PledgeCreate.php Standard create example
- *
+ * @throws \API_Exception
  */
 function civicrm_api3_pledge_create($params) {
   _civicrm_api3_pledge_format_params($params, TRUE);
@@ -63,15 +53,12 @@ function civicrm_api3_pledge_create($params) {
 }
 
 /**
- * Delete a pledge
+ * Delete a pledge.
  *
  * @param array $params
  *   Array included 'pledge_id' of pledge to delete.
  *
- * @return bool
- *   true if success, else false
- *   {@getfields pledge_delete}
- * @example PledgeDelete.php
+ * @return array
  */
 function civicrm_api3_pledge_delete($params) {
   if (CRM_Pledge_BAO_Pledge::deletePledge($params['id'])) {
@@ -85,6 +72,8 @@ function civicrm_api3_pledge_delete($params) {
 }
 
 /**
+ * Adjust metadata for pledge delete action.
+ *
  * @param array $params
  */
 function _civicrm_api3_pledge_delete_spec(&$params) {
@@ -93,7 +82,8 @@ function _civicrm_api3_pledge_delete_spec(&$params) {
 }
 
 /**
- * return field specification specific to get requests
+ * Adjust field specification specific to get requests.
+ *
  * @param array $params
  */
 function _civicrm_api3_pledge_get_spec(&$params) {
@@ -110,7 +100,8 @@ function _civicrm_api3_pledge_get_spec(&$params) {
 }
 
 /**
- * return field specification specific to get requests
+ * Adjust field specification specific to get requests.
+ *
  * @param array $params
  */
 function _civicrm_api3_pledge_create_spec(&$params) {
@@ -125,7 +116,7 @@ function _civicrm_api3_pledge_create_spec(&$params) {
 }
 
 /**
- * Retrieve a set of pledges, given a set of input params
+ * Retrieve a set of pledges, given a set of input params.
  *
  * @param array $params
  *   Input parameters. Use interrogate for possible fields.
@@ -150,21 +141,22 @@ function civicrm_api3_pledge_get($params) {
 }
 
 /**
- * Set default to not return test params
+ * Set default to not return test params.
  */
 function _civicrm_api3_pledge_get_defaults() {
   return array('pledge_test' => 0);
 }
 
 /**
- * Legacy function - I removed a bunch of stuff no longer required from here but it still needs
+ * Legacy function to format pledge parameters.
+ *
+ * I removed a bunch of stuff no longer required from here but it still needs
  * more culling
  * take the input parameter list as specified in the data model and
  * convert it into the same format that we use in QF and BAO object
  *
  * @param array $values
  *   The reformatted properties that we can use internally.
- *
  */
 function _civicrm_api3_pledge_format_params(&$values) {
 
index 638da983815be65bceaa01cb7962c30027d95b93..e6c83db083f6f16242b6d5ebc3a70d8c2e6a09ae 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: PledgePayment.php
- *
  */
 
 /**
- * Add or update a plege payment. Pledge Payment API doesn't actually add a pledge
+ * Add or update a pledge payment.
+ *
+ * Pledge Payment API doesn't actually add a pledge
  *  if the request is to 'create' and 'id' is not passed in
  * the oldest pledge with no associated contribution is updated
  *
@@ -46,8 +47,6 @@
  *
  * @param array $params
  *   Input parameters.
- * {@getfields PledgePayment_create}
- * @example PledgePaymentCreate.php
  *
  * @return array
  *   API Result
@@ -92,12 +91,10 @@ function _civicrm_api3_pledge_payment_create_spec(&$params) {
 }
 
 /**
- * Delete a pledge Payment - Note this deletes the contribution not just the link
+ * Delete a pledge Payment - Note this deletes the contribution not just the link.
  *
  * @param array $params
  *   Input parameters.
- * {@getfields PledgePayment_delete}
- * @example PledgePaymentDelete.php
  *
  * @return array
  *   API result
@@ -113,15 +110,13 @@ function civicrm_api3_pledge_payment_delete($params) {
 }
 
 /**
- * Retrieve a set of pledges, given a set of input params
+ * Retrieve a set of pledges, given a set of input params.
  *
  * @param array $params
  *   Input parameters.
- * {@getfields PledgePayment_get}
- * @example PledgePaymentGet.php *
  *
  * @return array
- *   (reference )        array of pledges, if error an array with an error id and error message
+ *   array of pledges, if error an array with an error id and error message
  */
 function civicrm_api3_pledge_payment_get($params) {
 
@@ -129,7 +124,7 @@ function civicrm_api3_pledge_payment_get($params) {
 }
 
 /**
- * Gets field for civicrm_pledge_payment functions
+ * Gets field for civicrm_pledge_payment functions.
  *
  * @param array $params
  *   Modifiable list of fields allowed for the PledgePayment.get action.
index 0e6ce88fe32acb046eaf80976b95d82d5f7c2294..75d004343f4129013d6bf4a4aaeb225e05b9f5c5 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_premium
- *
  */
 
 /**
- * Save a premium
- *
- * Allowed @params array keys are:
- * {@getfields premium_create}
- * @example premiumCreate.php
+ * Save a premium.
  *
  * @param array $params
  *
@@ -51,11 +46,7 @@ function civicrm_api3_premium_create($params) {
 }
 
 /**
- * Get a premium
- *
- * Allowed @params array keys are:
- * {@getfields premium_get}
- * @example premiumCreate.php
+ * Get a premium.
  *
  * @param array $params
  *
@@ -67,11 +58,7 @@ function civicrm_api3_premium_get($params) {
 }
 
 /**
- * Delete a premium
- *
- * Allowed @params array keys are:
- * {@getfields premium_delete}
- * @example premiumCreate.php
+ * Delete a premium.
  *
  * @param array $params
  *
@@ -84,7 +71,8 @@ function civicrm_api3_premium_delete($params) {
 }
 
 /**
- * return field specification specific to get requests
+ * Return field specification specific to get requests.
+ *
  * @param array $params
  */
 function _civicrm_api3_premium_get_spec(&$params) {
@@ -92,7 +80,8 @@ function _civicrm_api3_premium_get_spec(&$params) {
 }
 
 /**
- * return field specification specific to create requests
+ * Return field specification specific to create requests.
+ *
  * @param array $params
  */
 function _civicrm_api3_premium_create_spec(&$params) {
index 530a581fa9abb8061266c91001582582d92ea015..fd9d00e1f197119a23334ac9ddc58445b55a63b5 100644 (file)
  */
 
 /**
- * Create or update a price_field
+ * Create or update a price_field.
  *
  * @param array $params
  *   Associative array of property.
  *                       name/value pairs to insert in new 'price_field'
- * @example PriceFieldCreate.php Std Create example
  *
  * @return array
  *   api result array
- *   {@getfields price_field_create}
  */
 function civicrm_api3_price_field_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -63,7 +61,7 @@ function _civicrm_api3_price_field_create_spec(&$params) {
 }
 
 /**
- * Returns array of price_fields  matching a set of one or more group properties
+ * Returns array of price_fields matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid property_name=>value pairs. If $params is set.
@@ -71,14 +69,13 @@ function _civicrm_api3_price_field_create_spec(&$params) {
  *
  * @return array
  *   Array of matching price_fields
- *   {@getfields price_field_get}
  */
 function civicrm_api3_price_field_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * delete an existing price_field
+ * Delete an existing price_field.
  *
  * This method is used to delete any existing price_field. id of the group
  * to be deleted is required field in $params array
@@ -89,7 +86,6 @@ function civicrm_api3_price_field_get($params) {
  *
  * @return array
  *   API result array
- *   {@getfields price_field_delete}
  */
 function civicrm_api3_price_field_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index c7936d0371ce5fcfdccb04634e59fcdabf9ed2ac..bdf219873e1e671566abb7d91e287090138af7f6 100644 (file)
  */
 
 /**
- * Create or update a price_field_value
+ * Create or update a price_field_value.
  *
  * @param array $params
- *   Associative array of property.
+ *   Array of property.
  *                       name/value pairs to insert in new 'price_field_value'
- * @example PriceFieldValueCreate.php Std Create example
  *
  * @return array
- *   api result array
- *   {@getfields price_field_value_create}
+ *   API result array.
  */
 function civicrm_api3_price_field_value_create($params) {
   $ids = array();
@@ -76,22 +74,21 @@ function _civicrm_api3_price_field_value_create_spec(&$params) {
 }
 
 /**
- * Returns array of price_field_values  matching a set of one or more group properties
+ * Returns array of price_field_values  matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid property_name=>value pairs. If $params is set.
  *   as null, all price_field_values will be returned (default limit is 25)
  *
  * @return array
- *   Array of matching price_field_values
- *   {@getfields price_field_value_get}
+ *   API result array.
  */
 function civicrm_api3_price_field_value_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * delete an existing price_field_value
+ * Delete an existing price_field_value.
  *
  * This method is used to delete any existing price_field_value. id of the group
  * to be deleted is required field in $params array
@@ -101,8 +98,7 @@ function civicrm_api3_price_field_value_get($params) {
  *   to be deleted
  *
  * @return array
- *   API result array
- *   {@getfields price_field_value_delete}
+ *   API result array.
  */
 function civicrm_api3_price_field_value_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 80f75b127e0ea6588022449b8596c553ea72ba06..6a9d356b6fe2e05ac0ab357a99c50f04377242dc 100644 (file)
  */
 
 /**
- * Create or update a price_set
+ * Create or update a price_set.
  *
  * @param array $params
- *   Associative array of property.
+ *   array of property.
  *                       name/value pairs to insert in new 'price_set'
- * @example PriceSetCreate.php Std Create example
  *
  * @return array
  *   api result array
- *   {@getfields price_set_create}
  */
 function civicrm_api3_price_set_create($params) {
   $result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -77,7 +75,7 @@ function _civicrm_api3_price_set_create_spec(&$params) {
 }
 
 /**
- * Returns array of price_sets  matching a set of one or more group properties
+ * Returns array of price_sets matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid property_name=>value pairs. If $params is set.
@@ -85,7 +83,6 @@ function _civicrm_api3_price_set_create_spec(&$params) {
  *
  * @return array
  *   Array of matching price_sets
- *   {@getfields price_set_get}
  */
 function civicrm_api3_price_set_get($params) {
   // hack to make getcount work. - not sure the best approach here
@@ -102,7 +99,7 @@ function civicrm_api3_price_set_get($params) {
 }
 
 /**
- * delete an existing price_set
+ * Delete an existing price_set.
  *
  * This method is used to delete any existing price_set. id of the group
  * to be deleted is required field in $params array
@@ -113,7 +110,6 @@ function civicrm_api3_price_set_get($params) {
  *
  * @return array
  *   API result array
- *   {@getfields price_set_delete}
  */
 function civicrm_api3_price_set_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index c3f4dd27c3bdb77c76861ef56530a40d180b26c0..87a487ed681690285b3d066a58f9ebd20b898251 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_print_label
- *
  */
 
 /**
- * Save a print_label
- *
- * Allowed @params array keys are:
- * {@getfields print_label_create}
- * @example print_labelCreate.php
+ * Save a print_label.
  *
  * @param array $params
  *
@@ -50,11 +45,7 @@ function civicrm_api3_print_label_create($params) {
 }
 
 /**
- * Get a print_label
- *
- * Allowed @params array keys are:
- * {@getfields print_label_get}
- * @example print_labelCreate.php
+ * Get a print_label.
  *
  * @param array $params
  *
@@ -66,11 +57,7 @@ function civicrm_api3_print_label_get($params) {
 }
 
 /**
- * Delete a print_label
- *
- * Allowed @params array keys are:
- * {@getfields print_label_delete}
- * @example print_labelCreate.php
+ * Delete a print_label.
  *
  * @param array $params
  *
index 178d3a676468bb45ed7b036ea2d9475c55836284..28006d0d22eaa4293be7b413160eb2216c2da96e 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_product
- *
  */
 
 /**
- * Save a product
- *
- * Allowed @params array keys are:
- * {@getfields product_create}
- * @example productCreate.php
+ * Save a product.
  *
  * @param array $params
  *
@@ -51,11 +46,7 @@ function civicrm_api3_product_create($params) {
 }
 
 /**
- * Get a product
- *
- * Allowed @params array keys are:
- * {@getfields product_get}
- * @example productCreate.php
+ * Get a product.
  *
  * @param array $params
  *
@@ -67,11 +58,7 @@ function civicrm_api3_product_get($params) {
 }
 
 /**
- * Delete a product
- *
- * Allowed @params array keys are:
- * {@getfields product_delete}
- * @example productCreate.php
+ * Delete a product.
  *
  * @param array $params
  *
index 034b12b36b8083f50173dbdcc19e474a655dd991..82269c5d8885389f5fedd26bd6c47abfe152d482 100644 (file)
@@ -32,7 +32,6 @@
  * @subpackage API_ActivityProfile
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Profile.php 30486 2011-05-20 16:12:09Z rajan $
- *
  */
 
 /**
@@ -138,6 +137,8 @@ function civicrm_api3_profile_get($params) {
 }
 
 /**
+ * Adjust profile get function metadata.
+ *
  * @param array $params
  */
 function _civicrm_api3_profile_get_spec(&$params) {
@@ -149,6 +150,7 @@ function _civicrm_api3_profile_get_spec(&$params) {
 
 /**
  * Submit a set of fields against a profile.
+ *
  * Note choice of submit versus create is discussed CRM-13234 & related to the fact
  * 'profile' is being treated as a data-entry entity
  *
@@ -288,10 +290,13 @@ function civicrm_api3_profile_submit($params) {
 }
 
 /**
+ * Translate field names for BAO.
+ *
  * The api standards expect field names to be lower case but the BAO uses mixed case
  * so we accept 'email-primary' but pass 'email-Primary' to the BAO
  * we could make the BAO handle email-primary but this would alter the fieldname seen by hooks
  * & we would need to consider that change
+ *
  * @param string $fieldName
  *   API field name.
  *
@@ -302,8 +307,10 @@ function _civicrm_api3_profile_translate_fieldnames_for_bao($fieldName) {
   $fieldName = str_replace('url', 'URL', $fieldName);
   return str_replace('primary', 'Primary', $fieldName);
 }
+
 /**
- * metadata for submit action
+ * Metadata for submit action.
+ *
  * @param array $params
  * @param array $apirequest
  */
@@ -328,29 +335,31 @@ function _civicrm_api3_profile_submit_spec(&$params, $apirequest) {
 }
 
 /**
+ * Set profile - deprecated.
+ *
  * @deprecated - calling this function directly is deprecated as 'set' is not a clear action
  * use submit
  * Update Profile field values.
  *
  * @param array $params
- *   Associative array of property name/value.
+ *   Array of property name/value.
  *                             pairs to update profile field values
  *
  * @return array
  *   Updated Contact/ Activity object|CRM_Error
- *
- *
  */
 function civicrm_api3_profile_set($params) {
   return civicrm_api3('profile', 'submit', $params);
 }
 
 /**
+ * Apply profile - deprecated.
+ *
  * @deprecated - appears to be an internal function - should not be accessible via api
  * Provide formatted values for profile fields.
  *
  * @param array $params
- *   Associative array of property name/value.
+ *   Array of property name/value.
  *                             pairs to profile field values
  *
  * @throws API_Exception
@@ -390,6 +399,8 @@ function civicrm_api3_profile_apply($params) {
 
 
 /**
+ * Get pseudo profile 'billing'.
+ *
  * This is a function to help us 'pretend' billing is a profile & treat it like it is one.
  * It gets standard credit card address fields etc
  * Note this is 'better' that the inbuilt version as it will pull in fallback values
@@ -473,8 +484,9 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
 }
 
 /**
- * Here we will build  up getfields type data for all the fields in the profile. Because the integration with the
- * form layer in core is so hard-coded we are not going to attempt to re-use it
+ * Here we will build  up getfields type data for all the fields in the profile.
+ *
+ * Because the integration with the form layer in core is so hard-coded we are not going to attempt to re-use it
  * However, as this function is unit-tested & hence 'locked in' we can aspire to extract sharable
  * code out of the form-layer over time.
  *
index cc336623eee38ed531432ef8e44fa05afee8f758..9e0456e1764bf37c4f502bfb54d2b5644a559acb 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Relationship.php 30486 2010-11-02 16:12:09Z shot $
- *
  */
 
 /**
- * Add or update a relationship
+ * Add or update a relationship.
  *
  * @param array $params
  *   Input parameters.
  *
  * @throws API_Exception
- * @example RelationshipCreate.php Std Create example
  *
  * @return array
  *   API Result Array
- *   {@getfields relationship_create}
  */
 function civicrm_api3_relationship_create($params) {
   _civicrm_api3_handle_relationship_type($params);
@@ -68,15 +65,12 @@ function _civicrm_api3_relationship_create_spec(&$params) {
 }
 
 /**
- * Delete a relationship
+ * Delete a relationship.
  *
  * @param array $params
  *
  * @return array
  *   API Result Array
- *   {@getfields relationship_delete}
- * @example RelationshipDelete.php Delete Example
- *
  */
 function civicrm_api3_relationship_delete($params) {
 
@@ -96,18 +90,17 @@ function civicrm_api3_relationship_delete($params) {
 }
 
 /**
- * get the relationship
+ * Get one or more relationship/s.
  *
  * @param array $params
  *   Input parameters.
+ *
  * @todo  Result is inconsistent depending on whether contact_id is passed in :
  * -  if you pass in contact_id - it just returns all relationships for 'contact_id'
  * -  if you don't pass in contact_id then it does a filter on the relationship table (DAO based search)
  *
  * @return array
  *   API Result Array
- *   {@getfields relationship_get}
- * @example RelationshipGet.php
  */
 function civicrm_api3_relationship_get($params) {
   $options = _civicrm_api3_get_options_from_params($params);
@@ -141,7 +134,7 @@ function civicrm_api3_relationship_get($params) {
 }
 
 /**
- * legacy handling for relationship_type parameter
+ * Legacy handling for relationship_type parameter.
  *
  * @param array $params
  *   Associative array of property name/value.
index 45bd1f4d8a3e8651cf4719b1bff5116fac363315..799292f7ba3e219e04e7f454ab2f07d159f30bc9 100644 (file)
  * @subpackage API_Contact
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: Contact.php 30415 2010-10-29 12:02:47Z shot $
- *
  */
 
 /**
- * create relationship type
+ * Create relationship type.
  *
  * @param array $params
- *   Associative array of property name/value pairs to insert in new relationship type.
+ *   Array per getfields metadata.
  *
  * @return array
  */
@@ -90,11 +89,10 @@ function _civicrm_api3_relationship_type_create_spec(&$params) {
 }
 
 /**
- * get all relationship type
- * retruns  An array of Relationship_type
- * {@getfields RelationshipType_get}
- * @example RelationshipTypeGet.php
+ * Get all relationship types.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_relationship_type_get($params) {
@@ -102,7 +100,7 @@ function civicrm_api3_relationship_type_get($params) {
 }
 
 /**
- * Delete a relationship type delete
+ * Delete a relationship type.
  *
  * @param array $params
  *
@@ -114,9 +112,12 @@ function civicrm_api3_relationship_type_delete($params) {
 }
 
 /**
+ * Get list defaults for relationship types.
+ *
  * @see _civicrm_api3_generic_getlist_defaults
  *
  * @param array $request
+ *
  * @return array
  */
 function _civicrm_api3_relationship_type_getlist_defaults($request) {
index 64e5196ef03a08ffca0a4617e233b2299ccdaf7d..ebf7a44c9681a585ae7ac0c24d4da67e986e84a7 100644 (file)
@@ -1,20 +1,20 @@
 <?php
 
 /**
- * Retrieve a report instance
+ * Retrieve a report instance.
  *
  * @param array $params
  *   Input parameters.
  *
  * @return array
- *   details of found instances
+ *   Details of found instances
  */
 function civicrm_api3_report_instance_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- *  Add or update a report instance.
+ * Add or update a report instance.
  *
  * @param array $params
  *
@@ -39,7 +39,7 @@ function _civicrm_api3_report_instance_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing ReportInstance
+ * Deletes an existing ReportInstance.
  *
  * @param array $params
  *
index 13dd158bd38dc063a2733ac9fba59260e4710d72..78707e8b35623382cf039a8e8ee4cf3b813b13bb 100644 (file)
@@ -1,18 +1,14 @@
 <?php
 
 /**
- * Retrieve a report template
+ * Retrieve a report template.
  *
  * FIXME This is a bare-minimum placeholder
  *
  * @param array $params
  *
- * {@example OptionValueGet.php 0}
- * @example OptionValueGet.php
- *
  * @return array
  *   details of found Option Values
- *   {@getfields OptionValue_get}
  */
 function civicrm_api3_report_template_get($params) {
   require_once 'api/v3/OptionValue.php';
@@ -23,17 +19,14 @@ function civicrm_api3_report_template_get($params) {
 }
 
 /**
- *  Add a OptionValue. OptionValues are used to classify CRM entities (including Contacts, Groups and Actions).
- *
- * Allowed @params array keys are:
+ * Add an OptionValue.
  *
- * {@example OptionValueCreate.php}
+ * OptionValues are used to classify CRM entities (including Contacts, Groups and Actions).
  *
  * @param array $params
  *
  * @return array
  *   Array of newly created option_value property values.
- *   {@getfields OptionValue_create}
  */
 function civicrm_api3_report_template_create($params) {
   require_once 'api/v3/OptionValue.php';
@@ -67,15 +60,12 @@ function _civicrm_api3_report_template_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing ReportTemplate
+ * Deletes an existing ReportTemplate.
  *
  * @param array $params
  *
- * {@example ReportTemplateDelete.php 0}
- *
  * @return array
  *   Api result
- *   {@getfields ReportTemplate_create}
  */
 function civicrm_api3_report_template_delete($params) {
   require_once 'api/v3/OptionValue.php';
@@ -83,7 +73,7 @@ function civicrm_api3_report_template_delete($params) {
 }
 
 /**
- * Retrieve rows from a report template
+ * Retrieve rows from a report template.
  *
  * @param array $params
  *   Input parameters.
@@ -98,6 +88,8 @@ function civicrm_api3_report_template_getrows($params) {
 }
 
 /**
+ * Get report template rows.
+ *
  * @param array $params
  *
  * @return array
@@ -150,6 +142,8 @@ function _civicrm_api3_report_template_getrows($params) {
 }
 
 /**
+ * Get statistics from a given report.
+ *
  * @param array $params
  *
  * @return array
@@ -160,13 +154,10 @@ function civicrm_api3_report_template_getstatistics($params) {
   return civicrm_api3_create_success($stats, $params, 'report_template', 'getstatistics', CRM_Core_DAO::$_nullObject, $metadata);
 }
 /**
- * Retrieve rows from a report template
+ * Adjust metadata for template getrows action.
  *
  * @param array $params
  *   Input parameters.
- *
- * @return void
- *   details of found instances
  */
 function _civicrm_api3_report_template_getrows_spec(&$params) {
   $params['report_id'] = array(
index c1d6b9086a3c00f9908e586138915b85a61743d0..7bf30316c5379212f6c3c8b3f8a30492f222914a 100644 (file)
  * @subpackage API_Settings
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Settings.php
+ */
+
+/**
+ * Get fields for setting api calls.
+ *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_setting_getfields($params) {
@@ -72,7 +78,8 @@ function civicrm_api3_setting_getfields($params) {
 }
 
 /**
- * Alter metadata for getfields functions
+ * Alter metadata for getfields functions.
+ *
  * @param array $params
  */
 function _civicrm_api3_setting_getfields_spec(&$params) {
@@ -82,10 +89,14 @@ function _civicrm_api3_setting_getfields_spec(&$params) {
 }
 
 /**
- * Return default values for settings. We will domain key this as it could vary by domain (ie. urls)
+ * Return default values for settings.
+ *
+ * We will domain key this as it could vary by domain (ie. urls)
  * as we will be creating the option for a function rather than an value to be in the defaults
- * Note that is not in place as yet
+ * Note that is not in place as yet.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \CiviCRM_API3_Exception
  * @throws \Exception
@@ -113,7 +124,7 @@ function civicrm_api3_setting_getdefaults(&$params) {
   return civicrm_api3_create_success($defaults, $params, 'setting', 'getfields');
 }
 /**
- * Metadata for setting create function
+ * Metadata for setting create function.
  *
  * @param array $params
  *   Parameters as passed to the API.
@@ -128,8 +139,10 @@ function _civicrm_api3_setting_getdefaults_spec(&$params) {
 }
 
 /**
- * Revert settings to defaults
+ * Revert settings to defaults.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \Exception
  */
@@ -153,7 +166,8 @@ function civicrm_api3_setting_revert(&$params) {
 }
 
 /**
- * Alter metadata for getfields functions
+ * Alter metadata for getfields functions.
+ *
  * @param array $params
  */
 function _civicrm_api3_setting_revert_spec(&$params) {
@@ -161,15 +175,17 @@ function _civicrm_api3_setting_revert_spec(&$params) {
   $params['component_id'] = array('title' => 'id of relevant component');
   $params['domain_id'] = array(
     'api.default' => 'current_domain',
-    'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain
-      an array or "all" are acceptable values for multiple domains',
+    'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain'
+    . ' an array or "all" are acceptable values for multiple domains',
     'title' => 'Setting Domain',
   );
 }
 
 /**
- * Revert settings to defaults
+ * Revert settings to defaults.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \CiviCRM_API3_Exception
  * @throws \Exception
@@ -193,7 +209,8 @@ function civicrm_api3_setting_fill(&$params) {
 }
 
 /**
- * Alter metadata for getfields functions
+ * Alter metadata for getfields functions.
+ *
  * @param array $params
  */
 function _civicrm_api3_setting_fill_spec(&$params) {
@@ -202,22 +219,19 @@ function _civicrm_api3_setting_fill_spec(&$params) {
   $params['domain_id'] = array(
     'api.default' => 'current_domain',
     'title' => 'Setting Domain',
-    'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain
-      an array or "all" are acceptable values for multiple domains',
+    'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the '
+    . 'current domain, an array or "all" are acceptable values for multiple domains',
   );
 }
 
 /**
- * Create or update a setting
+ * Create or update a setting.
  *
  * @param array $params
- *   Associative array of setting.
- *                       name/value pairs + other vars as applicable - see getfields for more
- * @example SettingCreate.php Std Create example
+ *   Parameters as per getfields.
  *
  * @return array
  *   api result array
- *   {@getfields setting_create}
  */
 function civicrm_api3_setting_create($params) {
   $domains = _civicrm_api3_setting_getDomainArray($params);
@@ -226,7 +240,7 @@ function civicrm_api3_setting_create($params) {
 }
 
 /**
- * Metadata for setting create function
+ * Metadata for setting create function.
  *
  * @param array $params
  *   Parameters as passed to the API.
@@ -245,15 +259,13 @@ function _civicrm_api3_setting_create_spec(&$params) {
 }
 
 /**
- * Returns array of settings matching input parameters
+ * Returns array of settings matching input parameters.
  *
  * @param array $params
- *   Array of one or more valid.
- *                       property_name=>value pairs.
+ *   Array of one or more valid property_name=>value pairs.
  *
  * @return array
  *   Array of matching settings
- *   {@getfields setting_get}
  */
 function civicrm_api3_setting_get($params) {
   $domains = _civicrm_api3_setting_getDomainArray($params);
@@ -261,7 +273,7 @@ function civicrm_api3_setting_get($params) {
   return civicrm_api3_create_success($result, $params, 'setting', 'get');
 }
 /**
- * Metadata for setting create function
+ * Metadata for setting create function.
  *
  * @param array $params
  *   Parameters as passed to the API.
@@ -278,16 +290,17 @@ function _civicrm_api3_setting_get_spec(&$params) {
   );
 }
 /**
- * Returns value for specific parameter. Function requires more fields than 'get' but is intended for
+ * Returns value for specific parameter.
+ *
+ * Function requires more fields than 'get' but is intended for
  * runtime usage & should be quicker
  *
  * @param array $params
- *   (reference) Array of one or more valid.
+ *   Array of one or more valid.
  *                       property_name=>value pairs.
  *
  * @return array
- *   Array of matching settings
- *   {@getfields setting_get}
+ *   API result array.
  */
 function civicrm_api3_setting_getvalue($params) {
   $config = CRM_Core_Config::singleton();
@@ -305,7 +318,7 @@ function civicrm_api3_setting_getvalue($params) {
 }
 
 /**
- * Metadata for setting create function
+ * Metadata for setting create function.
  *
  * @param array $params
  *   Parameters as passed to the API.
@@ -336,13 +349,17 @@ function _civicrm_api3_setting_getvalue_spec(&$params) {
 }
 
 /**
- * Converts domain input into an array. If an array is passed in this is used, if 'all' is passed
+ * Converts domain input into an array.
+ *
+ * If an array is passed in this is used, if 'all' is passed
  * in this is converted to 'all arrays'
  *
  * Really domain_id should always be set but doing an empty check because at the moment
  * using crm-editable will pass an id & default won't be applied
- * we did talk about id being a pseudonym for domain_id in this api so applying it here
+ * we did talk about id being a pseudonym for domain_id in this api so applying it here.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \Exception
  */
index 0e049ca49e11eded7e0cbf117f861aee107b31ec..79840a91f76dab8a61bae1dedebc8aaf5be6a363 100644 (file)
  *
  * @package CiviCRM_APIv3
  * @subpackage API_sms_provider
- *
  */
 
 /**
- * Save an sms_provider
- *
- * Allowed @params array keys are:
- * {@getfields sms_provider_create}
- * @example sms_providerCreate.php
+ * Save an sms_provider.
  *
  * @param array $params
  *
@@ -50,11 +45,7 @@ function civicrm_api3_sms_provider_create($params) {
 }
 
 /**
- * Get an sms_provider
- *
- * Allowed @params array keys are:
- * {@getfields sms_provider_get}
- * @example sms_providerCreate.php
+ * Get an sms_provider.
  *
  * @param array $params
  *
@@ -66,11 +57,7 @@ function civicrm_api3_sms_provider_get($params) {
 }
 
 /**
- * Delete an sms_provider
- *
- * Allowed @params array keys are:
- * {@getfields sms_provider_delete}
- * @example sms_providerCreate.php
+ * Delete an sms_provider.
  *
  * @param array $params
  *
index 1f088337cb032a1f2b0436c07aa93283b7d2fc70..f270127a2188e9c0bac80df0d2b06afd568ed782 100644 (file)
 
 
 /**
- * Create or update a survey
+ * Create or update a survey.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'survey'
- * @example SurveyCreate.php Std Create example
+ *   Array per getfields metadata.
  *
  * @return array
  *   api result array
- *   {@getfields survey_create}
  */
 function civicrm_api3_survey_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Survey');
@@ -63,7 +60,7 @@ function _civicrm_api3_survey_create_spec(&$params) {
 }
 
 /**
- * Returns array of surveys  matching a set of one or more group properties
+ * Returns array of surveys  matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid.
@@ -72,14 +69,13 @@ function _civicrm_api3_survey_create_spec(&$params) {
  *
  * @return array
  *   API result Array of matching surveys
- *   {@getfields survey_get}
  */
 function civicrm_api3_survey_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Survey');
 }
 
 /**
- * delete an existing survey
+ * Delete an existing survey.
  *
  * This method is used to delete any existing survey. id of the group
  * to be deleted is required field in $params array
@@ -90,7 +86,6 @@ function civicrm_api3_survey_get($params) {
  *
  * @return array
  *   api result array
- *   {@getfields survey_delete}
  */
 function civicrm_api3_survey_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 86da40035e528eeb974cad4bc1bdfb880e7d2f38..82bc9d1bd0d6f8a519d3b95bebec01f6ee51b56c 100644 (file)
@@ -33,6 +33,8 @@
  */
 
 /**
+ * Notify caller of deprecated function.
+ *
  * @deprecated api notice
  * @return string
  *   to indicate this entire api entity is deprecated
@@ -42,10 +44,12 @@ function _civicrm_api3_survey_respondant_deprecation() {
 }
 
 /**
- * Get the list of signatories
+ * Get the list of signatories.
+ *
  * @deprecated - api currently not supported
+ *
  * @param array $params
- *   (reference ) input parameters.
+ *   input parameters.
  *
  * @return array
  */
@@ -76,7 +80,10 @@ function civicrm_api3_survey_respondant_get(&$params) {
 }
 
 /**
+ * Count survey respondents.
+ *
  * @deprecated - api currently not supported
+ *
  * @param array $params
  * @return array
  */
index b9eb6c7e7e437838fe278f74601fd448c653dfa0..92f8c0659112099326fd1e902138f6cab8297ee2 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Domain.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * Flush all system caches
+ * Flush all system caches.
  *
  * @param array $params
  *   Input parameters.
@@ -55,7 +54,7 @@ function civicrm_api3_system_flush($params) {
 }
 
 /**
- * Adjust Metadata for Flush action
+ * Adjust Metadata for Flush action.
  *
  * The metadata is used for setting defaults, documentation & validation.
  *
@@ -68,12 +67,13 @@ function _civicrm_api3_system_flush_spec(&$params) {
 }
 
 /**
- * System.Check API specification (optional)
+ * System.Check API specification (optional).
+ *
  * This is used for documentation and validation.
  *
  * @param array $spec
  *   Description of fields supported by this API call.
- * @return void
+ *
  * @see http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
  */
 function _civicrm_api3_system_check_spec(&$spec) {
@@ -81,9 +81,10 @@ function _civicrm_api3_system_check_spec(&$spec) {
 }
 
 /**
- * System.Check API
+ * System.Check API.
  *
  * @param array $params
+ *
  * @return array
  *   API result descriptor; return items are alert codes/messages
  * @see civicrm_api3_create_success
@@ -101,13 +102,15 @@ function civicrm_api3_system_check($params) {
 }
 
 /**
+ * Log entry to system log table.
+ *
  * @param array $params
  *
  * @return array
  */
 function civicrm_api3_system_log($params) {
   $log = new CRM_Utils_SystemLogger();
-  // this part means fields with separate db storage are accepted as params which kind of seems more intuitive to me
+  // This part means fields with separate db storage are accepted as params which kind of seems more intuitive to me
   // because I felt like not doing this required a bunch of explanation in the spec function - but perhaps other won't see it as helpful?
   if (!isset($params['context'])) {
     $params['context'] = array();
@@ -123,7 +126,8 @@ function civicrm_api3_system_log($params) {
 }
 
 /**
- * Metadata for log function
+ * Metadata for log function.
+ *
  * @param array $params
  */
 function _civicrm_api3_system_log_spec(&$params) {
@@ -158,9 +162,10 @@ function _civicrm_api3_system_log_spec(&$params) {
 }
 
 /**
- * System.Get API
+ * System.Get API.
  *
  * @param array $params
+ *
  * @return array
  */
 function civicrm_api3_system_get($params) {
index 403ea7a885c874108d9448473d5ab3d82fe92795..94a84e766a4d80f57cbfdbd54d0c30656831f9bd 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: SystemLog.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
+ * Delete system log record.
+ *
  * @param array $params
  *
  * @return array
@@ -46,9 +47,11 @@ function civicrm_api3_system_log_delete($params) {
 }
 
 /**
- * Create system log
+ * Create system log record.
+ *
  * It's arguable whether this function should exist as it fits our crud pattern and adding it meets our SyntaxConformance test requirements
  * but it just wraps system.log which is more consistent with the PSR3 implemented.
+ *
  * @param array $params
  *
  * @return array
@@ -58,9 +61,9 @@ function civicrm_api3_system_log_create($params) {
 }
 
 /**
- * @param array $params
+ * Adjust system log create metadata.
  *
- * @return void
+ * @param array $params
  */
 function _civicrm_api3_system_log_create_spec(&$params) {
   require_once 'api/v3/System.php';
@@ -68,6 +71,8 @@ function _civicrm_api3_system_log_create_spec(&$params) {
 }
 
 /**
+ * Get system log record.
+ *
  * @param array $params
  *
  * @return array
index cc8036ba5445bf416d8c2be81b4e3c544f8ff167..d9b0e2ca0982c5e592e91be73519407255e2f750 100644 (file)
  *
  * Tags are used to classify CRM entities (including Contacts, Groups and Actions).
  *
- * Allowed @params array keys are:
- *
- * {@example TagCreate.php}
- *
  * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array
- *   Array of newly created tag property values.
- *   {@getfields tag_create}
  */
 function civicrm_api3_tag_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -86,14 +81,11 @@ function civicrm_api3_tag_delete($params) {
  * This api is used for finding an existing tag.
  * Either id or name of tag are required parameters for this api.
  *
- * @example TagGet.php
- *
  * @param array $params
- *   An associative array of name/value pairs.
+ *   Array per getfields metadata.
  *
  * @return array
  *   details of found tags else error
- *   {@getfields tag_get}
  */
 function civicrm_api3_tag_get($params) {
 
index 75daf73c28bb0b03748eb937b9e1f9a77214b044..38790df84138faa1c60a8f20d875843b73302b2f 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: UFField.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
  * Defines 'uf field' within a group.
  *
  * @param array $params
- *   Array Associative array of property name/value pairs to create new uf field.
+ *   Array per getfields metadata.
  *
  * @throws API_Exception
  *
@@ -106,12 +105,9 @@ function civicrm_api3_uf_field_create($params) {
 }
 
 /**
- * Gets field for civicrm_uf_field create
+ * Adjust metadata for civicrm_uf_field create.
  *
  * @param array $params
- *
- * @return void
- *   fields valid for other functions
  */
 function _civicrm_api3_uf_field_create_spec(&$params) {
   $params['option.autoweight'] = array(
@@ -125,24 +121,19 @@ function _civicrm_api3_uf_field_create_spec(&$params) {
 }
 
 /**
- * Returns array of uf groups (profiles)  matching a set of one or more group properties
+ * Returns array of uf groups (profiles) matching a set of one or more group properties.
  *
  * @param array $params
- *   (reference) Array of one or more valid.
- *                       property_name=>value pairs. If $params is set
- *                       as null, all surveys will be returned
+ *   Array per getfields metadata.
  *
  * @return array
- *   (reference) Array
- *   {@getfields UFField_get
- * @example UFFieldGet.php
  */
 function civicrm_api3_uf_field_get($params) {
   return _civicrm_api3_basic_get('CRM_Core_BAO_UFField', $params);
 }
 
 /**
- * Delete uf field
+ * Delete uf field.
  *
  * @param array $params
  *
@@ -167,7 +158,8 @@ function civicrm_api3_uf_field_delete($params) {
 }
 
 /**
- * field id accepted for backward compatibility - unset required on id
+ * Field id accepted for backward compatibility - unset required on id.
+ *
  * @param array $params
  */
 function _civicrm_api3_uf_field_delete_spec(&$params) {
index c08a63b15de5c0861f272613270beacb1e1859f1..2ff2ac65dd11e87ea1d89c9f87c1a14f1f95eb76 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: UFGroup.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
+ * Adjust metadata for create action.
+ *
  * @param array $params
  */
 function _civicrm_api3_uf_group_create_spec(&$params) {
@@ -44,36 +45,36 @@ function _civicrm_api3_uf_group_create_spec(&$params) {
   $params['title']['api.required'] = 1;
   $params['is_active']['api.default'] = 1;
   $params['is_update_dupe']['api.default'] = 1;
-  $params['created_id']['api.default'] = 'user_contact_id';//the current user
+  // Default to the logged in user.
+  $params['created_id']['api.default'] = 'user_contact_id';
   $params['created_date']['api.default'] = 'now';
 }
+
 /**
- * Use this API to create a new group. See the CRM Data Model for uf_group property definitions
+ * Use this API to create a new group.
+ *
+ * See the CRM Data Model for uf_group property definitions
  *
  * @param array $params
- *   Array Associative array of property name/value pairs to insert in group.
+ *   Array per getfields metadata.
  *
  * @return array
  *   API result array
- *   {@getfields UFGroup_create}
- * @example UFGroupCreate.php
  */
 function civicrm_api3_uf_group_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Returns array of uf groups (profiles)  matching a set of one or more group properties
+ * Returns array of uf groups (profiles) matching a set of one or more group properties.
  *
  * @param array $params
- *   (reference) Array of one or more valid.
+ *   Array of one or more valid.
  *                       property_name=>value pairs. If $params is set
  *                       as null, all surveys will be returned
  *
  * @return array
  *   Array of matching profiles
- *   {@getfields UFGroup_get}
- * @example UFGroupGet.php
  */
 function civicrm_api3_uf_group_get($params) {
 
@@ -81,11 +82,10 @@ function civicrm_api3_uf_group_get($params) {
 }
 
 /**
- * Delete uf group
+ * Delete uf group.
  *
  * @param array $params
  *
- *
  * @return array
  */
 function civicrm_api3_uf_group_delete($params) {
index 8dd21ffa80db38614cc634baa9c99c4e8a9b2e8e..1623d0c699f6d0b9ffe0ca1ba7ec0179286bfbb2 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: UFJoin.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * takes an associative array and creates a uf join in the database
+ * Takes an associative array and creates a uf join in the database.
  *
  * @param array $params
- *   Assoc array of name/value pairs.
+ *   Array per getfields metadata.
  *
  * @return array
  *   CRM_Core_DAO_UFJoin Array
@@ -57,6 +56,7 @@ function civicrm_api3_uf_join_create($params) {
  *
  * @param array $params
  *   Array or parameters determined by getfields.
+ *
  * @todo - suspect module, weight don't need to be required - need to test
  */
 function _civicrm_api3_uf_join_create_spec(&$params) {
@@ -66,13 +66,14 @@ function _civicrm_api3_uf_join_create_spec(&$params) {
 }
 
 /**
- * Get CiviCRM UF_Joins (ie joins between CMS user records & CiviCRM user record
+ * Get CiviCRM UF_Joins (ie joins between CMS user records & CiviCRM user record.
  *
  * @param array $params
- *   (reference) an assoc array of name/value pairs.
+ *   Array of name/value pairs.
  *
  * @return array
- *   CiviCRM Result Array or null
+ *   API result array.
+ *
  * @todo Delete function missing
  */
 function civicrm_api3_uf_join_get($params) {
index 447c34f2df7c64d46bd9a8c08819caa1ae782924..c4d69b6420f446eb46872726e99dfb5c36c02ee6 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: UFGroup.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * get the contact_id given a uf_id or vice versa
+ * Get the contact_id given a uf_id or vice versa.
  *
  * @param array $params
  *
@@ -48,16 +47,13 @@ function civicrm_api3_uf_match_get($params) {
 }
 
 /**
- * Create or update a UF Match record
+ * Create or update a UF Match record.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'survey'
- * @example UFMatch.php Std Create example
+ *   Array per getfields metadata.
  *
  * @return array
- *   api result array
- *   {@getfields uf_match_create}
+ *   Api result array
  */
 function civicrm_api3_uf_match_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -78,16 +74,12 @@ function _civicrm_api3_uf_match_create_spec(&$params) {
 }
 
 /**
- * Create or update a survey
+ * Delete a UF Match record.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'survey'
- * @example UFMatch.php Std Create example
  *
  * @return array
- *   api result array
- *   {@getfields uf_match_create}
+ *   Api result array.
  */
 function civicrm_api3_uf_match_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index be2141465780fe35fb7d6ebdf04824906b0b674a..ca4f07606c6459ec586b47c539c4a82004d9c1f3 100644 (file)
  */
 
 /**
- *  Add an Website for a contact
- *
- * Allowed @params array keys are:
- * {@getfields website_create}
- * @example WebsiteCreate.php
- * {@example WebsiteCreate.php}
+ * Add an Website for a contact.
  *
  * @param array $params
  *
  * @return array
- *   Array of newly created website property values.
+ *   API result array.
  * @todo convert to using basic create - BAO function non-std
  */
 function civicrm_api3_website_create($params) {
@@ -71,10 +66,12 @@ function _civicrm_api3_website_create_spec(&$params) {
 }
 
 /**
- * Deletes an existing Website
+ * Deletes an existing Website.
+ *
  * @todo convert to using Basic delete - BAO function non standard
+ *
  * @param array $params
- * {@getfields website_delete}
+ *
  * @return array
  *   API result
  * @throws \API_Exception
@@ -97,15 +94,12 @@ function civicrm_api3_website_delete($params) {
 }
 
 /**
- * Retrieve one or more websites
+ * Retrieve one or more websites.
  *
  * @param array $params
- * {@example WebsiteGet.php 0}
- * @example WebsiteGet.php
  *
  * @return array
  *   details of found websites
- *
  */
 function civicrm_api3_website_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'website');
index 6b14d8b1f7dda95dbd790138ea07a2d8ba009ecd..231436139642f0b3b406a9c4bcab25f62dd22211 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: Domain.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * Get CiviCRM Word Replacement details
- * {@getfields word_replacement_create}
+ * Get CiviCRM Word Replacement details.
+ *
  * @param array $params
+ *
  * @return array
  * @throws \API_Exception
  */
@@ -53,13 +53,11 @@ function civicrm_api3_word_replacement_get($params) {
 
 
 /**
- * Create a new Word Replacement
+ * Create a new Word Replacement.
  *
  * @param array $params
  *
  * @return array
- *
- *   {@getfields word_replacement_create}
  */
 function civicrm_api3_word_replacement_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -78,16 +76,13 @@ function _civicrm_api3_word_replacement_create_spec(&$params) {
 }
 
 /**
- * delete an existing word_replacement
- *
+ * Delete an existing word_replacement.
  *
  * @param array $params
- *   Array containing id of the word_replacement.
- *   to be deleted
+ *   Array containing id of the word_replacement to be deleted.
  *
  * @return array
- *   api result array
- *
+ *   API result array
  */
 function civicrm_api3_word_replacement_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 0e1cde62b9e5d4f3e5554e0b2fd3cab098b5b454..6f5f3782b03229872a4e67e71b5583eb385125ca 100644 (file)
  *
  * @copyright CiviCRM LLC (c) 2004-2014
  * @version $Id: utils.php 30879 2010-11-22 15:45:55Z shot $
- *
  */
 
 /**
- * Initialize CiviCRM - should be run at the start of each API function
+ * Initialize CiviCRM - should be run at the start of each API function.
  */
 function _civicrm_api3_initialize() {
   require_once 'CRM/Core/ClassLoader.php';
@@ -46,7 +45,7 @@ function _civicrm_api3_initialize() {
 }
 
 /**
- * Wrapper Function for civicrm_verify_mandatory to make it simple to pass either / or fields for checking
+ * Wrapper Function for civicrm_verify_mandatory to make it simple to pass either / or fields for checking.
  *
  * @param array $params
  *   Array of fields to check.
@@ -64,7 +63,7 @@ function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions
 }
 
 /**
- * check mandatory fields are included
+ * Check mandatory fields are included.
  *
  * @param array $params
  *   Array of fields to check.
@@ -126,9 +125,11 @@ function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = array()
 }
 
 /**
+ * Create error array.
  *
- * @param $msg
+ * @param string $msg
  * @param array $data
+ *
  * @return array
  */
 function civicrm_api3_create_error($msg, $data = array()) {
@@ -137,7 +138,8 @@ function civicrm_api3_create_error($msg, $data = array()) {
   // we will show sql to privileged user only (not sure of a specific
   // security hole here but seems sensible - perhaps should apply to the trace as well?)
   if (isset($data['sql']) && CRM_Core_Permission::check('Administer CiviCRM')) {
-    $data['debug_information'] = $data['sql']; // Isn't this redundant?
+    // Isn't this redundant?
+    $data['debug_information'] = $data['sql'];
   }
   else {
     unset($data['sql']);
@@ -146,7 +148,7 @@ function civicrm_api3_create_error($msg, $data = array()) {
 }
 
 /**
- * Format array in result output styple
+ * Format array in result output style.
  *
  * @param array|int $values values generated by API operation (the result)
  * @param array $params
@@ -199,7 +201,24 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
       $allFields = array_keys($apiFields['values']);
     }
     $paramFields = array_keys($params);
-    $undefined = array_diff($paramFields, $allFields, array_keys($_COOKIE), array('action', 'entity', 'debug', 'version', 'check_permissions', 'IDS_request_uri', 'IDS_user_agent', 'return', 'sequential', 'rowCount', 'option_offset', 'option_limit', 'custom', 'option_sort', 'options', 'prettyprint'));
+    $undefined = array_diff($paramFields, $allFields, array_keys($_COOKIE), array(
+      'action',
+      'entity',
+      'debug',
+      'version',
+      'check_permissions',
+      'IDS_request_uri',
+      'IDS_user_agent',
+      'return',
+      'sequential',
+      'rowCount',
+      'option_offset',
+      'option_limit',
+      'custom',
+      'option_sort',
+      'options',
+      'prettyprint',
+      ));
     if ($undefined) {
       $result['undefined_fields'] = array_merge($undefined);
     }
@@ -235,20 +254,22 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
     $result['values'] = $values;
   }
   if (!empty($params['options']['metadata'])) {
-    // we've made metadata an array but only supporting 'fields' atm
+    // We've made metadata an array but only supporting 'fields' atm.
     if (in_array('fields', (array) $params['options']['metadata']) && $action !== 'getfields') {
-      $fields = civicrm_api3($entity, 'getfields', array('action' => substr($action, 0, 3) == 'get' ? 'get' : 'create'));
+      $fields = civicrm_api3($entity, 'getfields', array(
+        'action' => substr($action, 0, 3) == 'get' ? 'get' : 'create',
+      ));
       $result['metadata']['fields'] = $fields['values'];
     }
   }
-  // Report deprecations
+  // Report deprecations.
   $deprecated = _civicrm_api3_deprecation_check($entity, $result);
-  // Always report "update" action as deprecated
+  // Always report "update" action as deprecated.
   if (!is_string($deprecated) && ($action == 'getactions' || $action == 'update')) {
     $deprecated = ((array) $deprecated) + array('update' => 'The "update" action is deprecated. Use "create" with an id instead.');
   }
   if ($deprecated) {
-    // Metadata-level deprecations or wholesale entity deprecations
+    // Metadata-level deprecations or wholesale entity deprecations.
     if ($entity == 'entity' || $action == 'getactions' || is_string($deprecated)) {
       $result['deprecated'] = $deprecated;
     }
@@ -261,8 +282,10 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
 }
 
 /**
- * Load the DAO of the entity
+ * Load the DAO of the entity.
+ *
  * @param $entity
+ *
  * @return bool
  */
 function _civicrm_api3_load_DAO($entity) {
@@ -275,11 +298,13 @@ function _civicrm_api3_load_DAO($entity) {
 }
 
 /**
- * return the DAO of the function or Entity
+ * Return the DAO of the function or Entity.
+ *
  * @param string $name
  *   Either a function of the api (civicrm_{entity}_create or the entity name.
  *   return the DAO name to manipulate this function
  *   eg. "civicrm_api3_contact_create" or "Contact" will return "CRM_Contact_BAO_Contact"
+ *
  * @return mixed|string
  */
 function _civicrm_api3_get_DAO($name) {
@@ -343,11 +368,13 @@ function _civicrm_api3_get_DAO($name) {
 }
 
 /**
- * return the DAO of the function or Entity
+ * Return the DAO of the function or Entity.
+ *
  * @param string $name
  *   Is either a function of the api (civicrm_{entity}_create or the entity name.
  *   return the DAO name to manipulate this function
  *   eg. "civicrm_contact_create" or "Contact" will return "CRM_Contact_BAO_Contact"
+ *
  * @return mixed
  */
 function _civicrm_api3_get_BAO($name) {
@@ -366,7 +393,8 @@ function _civicrm_api3_get_BAO($name) {
 }
 
 /**
- *  Recursive function to explode value-separated strings into arrays
+ * Recursive function to explode value-separated strings into arrays.
+ *
  * @param $values
  */
 function _civicrm_api3_separate_values(&$values) {
@@ -376,7 +404,8 @@ function _civicrm_api3_separate_values(&$values) {
       _civicrm_api3_separate_values($value);
     }
     elseif (is_string($value)) {
-      if ($key == 'case_type_id') {// this is to honor the way case API was originally written
+      // This is to honor the way case API was originally written.
+      if ($key == 'case_type_id') {
         $value = trim(str_replace($sp, ',', $value), ',');
       }
       elseif (strpos($value, $sp) !== FALSE) {
@@ -387,12 +416,14 @@ function _civicrm_api3_separate_values(&$values) {
 }
 
 /**
- * This is a legacy wrapper for api_store_values which will check the suitable fields using getfields
- * rather than DAO->fields
+ * This is a legacy wrapper for api_store_values.
  *
- * Getfields has handling for how to deal with uniquenames which dao->fields doesn't
+ * It checks suitable fields using getfields rather than DAO->fields.
+ *
+ * Getfields has handling for how to deal with unique names which dao->fields doesn't
  *
  * Note this is used by BAO type create functions - eg. contribution
+ *
  * @param string $entity
  * @param array $params
  * @param array $values
@@ -403,6 +434,7 @@ function _civicrm_api3_filter_fields_for_bao($entity, &$params, &$values) {
   _civicrm_api3_store_values($fields, $params, $values);
 }
 /**
+ * Store values.
  *
  * @param array $fields
  * @param array $params
@@ -424,7 +456,9 @@ function _civicrm_api3_store_values(&$fields, &$params, &$values) {
 }
 
 /**
- * The API supports 2 types of get requestion. The more complex uses the BAO query object.
+ * Get function for query object api.
+ *
+ * The API supports 2 types of get request. The more complex uses the BAO query object.
  *  This is a generic function for those functions that call it
  *
  *  At the moment only called by contact we should extend to contribution &
@@ -433,6 +467,7 @@ function _civicrm_api3_store_values(&$fields, &$params, &$values) {
  *
  * Ideally this would be merged with _civicrm_get_query_object but we need to resolve differences in what the
  * 2 variants call
+ *
  * @param $entity
  * @param array $params
  *   As passed into api get or getcount function.
@@ -528,13 +563,15 @@ function _civicrm_api3_get_using_query_object($entity, $params, $additional_opti
 }
 
 /**
- * get dao query object based on input params
+ * Get dao query object based on input params.
+ *
  * Ideally this would be merged with _civicrm_get_using_query_object but we need to resolve differences in what the
  * 2 variants call
  *
  * @param array $params
  * @param string $mode
  * @param string $entity
+ *
  * @return array
  *   [CRM_Core_DAO|CRM_Contact_BAO_Query]
  */
@@ -569,7 +606,8 @@ function _civicrm_api3_get_query_object($params, $mode, $entity) {
 }
 
 /**
- * Function transfers the filters being passed into the DAO onto the params object
+ * Function transfers the filters being passed into the DAO onto the params object.
+ *
  * @param CRM_Core_DAO $dao
  * @param array $params
  * @param bool $unique
@@ -635,21 +673,24 @@ function _civicrm_api3_dao_set_filter(&$dao, $params, $unique = TRUE, $entity) {
   }
   if (!empty($options['return']) && is_array($options['return']) && empty($options['is_count'])) {
     $dao->selectAdd();
-    $options['return']['id'] = TRUE;// ensure 'id' is included
+    // Ensure 'id' is included.
+    $options['return']['id'] = TRUE;
     $allfields = _civicrm_api3_get_unique_name_array($dao);
     $returnMatched = array_intersect(array_keys($options['return']), $allfields);
     foreach ($returnMatched as $returnValue) {
       $dao->selectAdd($returnValue);
     }
 
-    $unmatchedFields = array_diff(// not already matched on the field names
+    // Not already matched on the field names.
+    $unmatchedFields = array_diff(
       array_keys($options['return']),
       $returnMatched
     );
 
     $returnUniqueMatched = array_intersect(
       $unmatchedFields,
-      array_flip($allfields)// but a match for the field keys
+      // But a match for the field keys.
+      array_flip($allfields)
     );
     foreach ($returnUniqueMatched as $uniqueVal) {
       $dao->selectAdd($allfields[$uniqueVal]);
@@ -659,7 +700,8 @@ function _civicrm_api3_dao_set_filter(&$dao, $params, $unique = TRUE, $entity) {
 }
 
 /**
- * Apply filters (e.g. high, low) to DAO object (prior to find)
+ * Apply filters (e.g. high, low) to DAO object (prior to find).
+ *
  * @param string $filterField
  *   Field name of filter.
  * @param string $filterValue
@@ -688,12 +730,13 @@ function _civicrm_api3_apply_filters_to_dao($filterField, $filterValue, &$dao) {
 
 /**
  * Get sort, limit etc options from the params - supporting old & new formats.
- * get returnproperties for legacy
+ *
+ * Get returnProperties for legacy
  *
  * @param array $params
  *   Params array as passed into civicrm_api.
  * @param bool $queryObject
- *   Is this supporting a queryobject api (e.g contact) - if so we support more options.
+ *   Is this supporting a queryObject api (e.g contact) - if so we support more options.
  *   for legacy report & return a unique fields array
  *
  * @param string $entity
@@ -794,7 +837,7 @@ function _civicrm_api3_get_options_from_params(&$params, $queryObject = FALSE, $
 }
 
 /**
- * Apply options (e.g. sort, limit, order by) to DAO object (prior to find)
+ * Apply options (e.g. sort, limit, order by) to DAO object (prior to find).
  *
  * @param array $params
  *   Params array as passed into civicrm_api.
@@ -816,7 +859,9 @@ function _civicrm_api3_apply_options_to_dao(&$params, &$dao, $entity) {
 }
 
 /**
- * build fields array. This is the array of fields as it relates to the given DAO
+ * Build fields array.
+ *
+ * This is the array of fields as it relates to the given DAO
  * returns unique fields as keys by default but if set but can return by DB fields
  *
  * @param CRM_Core_DAO $bao
@@ -842,7 +887,9 @@ function _civicrm_api3_build_fields_array(&$bao, $unique = TRUE) {
 }
 
 /**
- * build fields array. This is the array of fields as it relates to the given DAO
+ * Build fields array.
+ *
+ * This is the array of fields as it relates to the given DAO
  * returns unique fields as keys by default but if set but can return by DB fields
  *
  * @param CRM_Core_DAO $bao
@@ -858,7 +905,7 @@ function _civicrm_api3_get_unique_name_array(&$bao) {
 }
 
 /**
- * Converts an DAO object to an array
+ * Converts an DAO object to an array.
  *
  * @param CRM_Core_DAO $dao
  *   Object to convert.
@@ -908,6 +955,8 @@ function _civicrm_api3_dao_to_array($dao, $params = NULL, $uniqueFields = TRUE,
 }
 
 /**
+ * Determine if custom fields need to be retrieved.
+ *
  * We currently retrieve all custom fields or none at this level so if we know the entity
  * && it can take custom fields & there is the string 'custom' in their return request we get them all, they are filtered on the way out
  * @todo filter so only required fields are queried
@@ -923,14 +972,14 @@ function _civicrm_api3_custom_fields_are_required($entity, $params) {
     return FALSE;
   }
   $options = _civicrm_api3_get_options_from_params($params);
-  //we check for possibility of 'custom' => 1 as well as specific custom fields
+  // We check for possibility of 'custom' => 1 as well as specific custom fields.
   $returnString = implode('', $options['return']) . implode('', array_keys($options['return']));
   if (stristr($returnString, 'custom')) {
     return TRUE;
   }
 }
 /**
- * Converts an object to an array
+ * Converts an object to an array.
  *
  * @param object $dao
  *   (reference) object to convert.
@@ -949,9 +998,11 @@ function _civicrm_api3_object_to_array(&$dao, &$values, $uniqueFields = FALSE) {
 }
 
 /**
- * Wrapper for _civicrm_object_to_array when api supports unique fields
+ * Wrapper for _civicrm_object_to_array when api supports unique fields.
+ *
  * @param $dao
  * @param $values
+ *
  * @return array
  */
 function _civicrm_api3_object_to_array_unique_fields(&$dao, &$values) {
@@ -959,6 +1010,7 @@ function _civicrm_api3_object_to_array_unique_fields(&$dao, &$values) {
 }
 
 /**
+ * Format custom parameters.
  *
  * @param array $params
  * @param array $values
@@ -997,6 +1049,8 @@ function _civicrm_api3_custom_format_params($params, &$values, $extends, $entity
 }
 
 /**
+ * Format parameters for create action.
+ *
  * @param array $params
  * @param $entity
  */
@@ -1013,7 +1067,9 @@ function _civicrm_api3_format_params_for_create(&$params, $entity) {
 }
 
 /**
- * we can't rely on downstream to add separators to checkboxes so we'll check here. We should look at pushing to BAO function
+ * We can't rely on downstream to add separators to checkboxes so we'll check here.
+ *
+ * We should look at pushing to BAO function
  * and / or validate function but this is a safe place for now as it has massive test coverage & we can keep the change very specific
  * note that this is specifically tested in the GRANT api test case so later refactoring should use that as a checking point
  *
@@ -1031,20 +1087,19 @@ function _civicrm_api3_format_params_for_create(&$params, $entity) {
  * @todo - we are probably skipping handling disabled options as presumably getoptions is not giving us them. This should be non-regressive but might
  * be fixed in future
  *
- * @param $checkboxFieldValue
- * @param $customFieldLabel
- * @param $entity
- *
+ * @param mixed $checkboxFieldValue
+ * @param string $customFieldLabel
+ * @param string $entity
  */
 function formatCheckBoxField(&$checkboxFieldValue, $customFieldLabel, $entity) {
 
   if (is_string($checkboxFieldValue) && stristr($checkboxFieldValue, CRM_Core_DAO::VALUE_SEPARATOR)) {
-    // we can assume it's pre-formatted
+    // We can assume it's pre-formatted.
     return;
   }
   $options = civicrm_api($entity, 'getoptions', array('field' => $customFieldLabel, 'version' => 3));
   if (!empty($options['is_error'])) {
-    //the check is precautionary - can probably be removed later
+    // The check is precautionary - can probably be removed later.
     return;
   }
 
@@ -1108,14 +1163,15 @@ function formatCheckBoxField(&$checkboxFieldValue, $customFieldLabel, $entity) {
 }
 
 /**
+ * This function ensures that we have the right input parameters.
+ *
  * @deprecated
- * This function ensures that we have the right input parameters
  *
  * This function is only called when $dao is passed into verify_mandatory.
  * The practice of passing $dao into verify_mandatory turned out to be
- * unsatisfactory as the required fields @ the dao level is so diffent to the abstract
+ * unsatisfactory as the required fields @ the dao level is so different to the abstract
  * api level. Hence the intention is to remove this function
- * & the associated param from viery_mandatory
+ * & the associated param from verify_mandatory
  *
  * @param array $params
  *   Associative array of property name/value.
@@ -1126,7 +1182,7 @@ function formatCheckBoxField(&$checkboxFieldValue, $customFieldLabel, $entity) {
  * @daoName string DAO to check params agains
  *
  * @return bool
- *   Sshould the missing fields be returned as an array (core error created as default)
+ *   Should the missing fields be returned as an array (core error created as default)
  *   true if all fields present, depending on $result a core error is created of an array of missing fields is returned
  */
 function _civicrm_api3_check_required_fields($params, $daoName, $return = FALSE) {
@@ -1174,7 +1230,7 @@ function _civicrm_api3_check_required_fields($params, $daoName, $return = FALSE)
 }
 
 /**
- * Function to do a 'standard' api get - when the api is only doing a $bao->find then use this
+ * Function to do a 'standard' api get - when the api is only doing a $bao->find then use this.
  *
  * @param string $bao_name
  *   Name of BAO.
@@ -1198,7 +1254,7 @@ function _civicrm_api3_basic_get($bao_name, &$params, $returnAsSuccess = TRUE, $
 }
 
 /**
- * Function to do a 'standard' api create - when the api is only doing a $bao::create then use this
+ * Function to do a 'standard' api create - when the api is only doing a $bao::create then use this.
  *
  * @param string $bao_name
  *   Name of BAO Class.
@@ -1263,7 +1319,9 @@ function _civicrm_api3_basic_create($bao_name, &$params, $entity = NULL) {
  * @param array $params
  *
  * @throws API_Exception
- * @return CRM_Core_DAO|NULL an instance of the BAO
+ *
+ * @return CRM_Core_DAO|NULL
+ *   An instance of the BAO
  */
 function _civicrm_api3_basic_create_fallback($bao_name, &$params) {
   $dao_name = get_parent_class($bao_name);
@@ -1288,8 +1346,9 @@ function _civicrm_api3_basic_create_fallback($bao_name, &$params) {
 }
 
 /**
- * Function to do a 'standard' api del - when the api is only doing a $bao::del then use this
- * if api::del doesn't exist it will try DAO delete method
+ * Function to do a 'standard' api del.
+ *
+ * When the api is only doing a $bao::del then use this if api::del doesn't exist it will try DAO delete method.
  *
  * @param string $bao_name
  * @param array $params
@@ -1327,7 +1386,10 @@ function _civicrm_api3_basic_delete($bao_name, &$params) {
 }
 
 /**
- * Get custom data for the given entity & Add it to the returnArray as 'custom_123' = 'custom string' AND 'custom_123_1' = 'custom string'
+ * Get custom data for the given entity & Add it to the returnArray.
+ *
+ * This looks like 'custom_123' = 'custom string' AND
+ * 'custom_123_1' = 'custom string'
  * Where 123 is field value & 1 is the id within the custom group data table (value ID)
  *
  * @param array $returnArray
@@ -1376,11 +1438,14 @@ function _civicrm_api3_custom_data_get(&$returnArray, $entity, $entity_id, $grou
 }
 
 /**
- * Validate fields being passed into API. This function relies on the getFields function working accurately
+ * Validate fields being passed into API.
+ *
+ * This function relies on the getFields function working accurately
  * for the given API. If error mode is set to TRUE then it will also check
  * foreign keys
  *
  * As of writing only date was implemented.
+ *
  * @param string $entity
  * @param string $action
  * @param array $params
@@ -1389,6 +1454,7 @@ function _civicrm_api3_custom_data_get(&$returnArray, $entity, $entity_id, $grou
  *   Response from getfields all variables are the same as per civicrm_api.
  * @param bool $errorMode
  *   ErrorMode do intensive post fail checks?.
+ *
  * @throws Exception
  */
 function _civicrm_api3_validate_fields($entity, $action, &$params, $fields, $errorMode = FALSE) {
@@ -1449,6 +1515,7 @@ function _civicrm_api3_validate_fields($entity, $action, &$params, $fields, $err
 
 /**
  * Validate date fields being passed into API.
+ *
  * It currently converts both unique fields and DB field names to a mysql date.
  * @todo - probably the unique field handling & the if exists handling is now done before this
  * function is reached in the wrapper - can reduce this code down to assume we
@@ -1463,6 +1530,7 @@ function _civicrm_api3_validate_fields($entity, $action, &$params, $fields, $err
  *   Uniquename of field being checked.
  * @param array $fieldInfo
  *   Array of fields from getfields function.
+ *
  * @throws Exception
  */
 function _civicrm_api3_validate_date(&$params, &$fieldName, &$fieldInfo) {
@@ -1487,8 +1555,9 @@ function _civicrm_api3_validate_date(&$params, &$fieldName, &$fieldInfo) {
 }
 
 /**
- * convert date into BAO friendly date
- * we accept 'whatever strtotime accepts'
+ * Convert date into BAO friendly date.
+ *
+ * We accept 'whatever strtotime accepts'
  *
  * @param string $dateValue
  * @param string $fieldName
@@ -1519,6 +1588,7 @@ function _civicrm_api3_getValidDate($dateValue, $fieldName, $fieldType) {
  *   Uniquename of field being checked.
  * @param array $fieldInfo
  *   Array of fields from getfields function.
+ *
  * @throws \API_Exception
  */
 function _civicrm_api3_validate_constraint(&$fieldValue, &$fieldName, &$fieldInfo) {
@@ -1539,6 +1609,7 @@ function _civicrm_api3_validate_constraint(&$fieldValue, &$fieldName, &$fieldInf
  *   Params from civicrm_api.
  * @param string $fieldName
  *   Uniquename of field being checked.
+ *
  * @throws Exception
  */
 function _civicrm_api3_validate_unique_key(&$params, &$fieldName) {
@@ -1571,7 +1642,8 @@ function _civicrm_api3_validate_unique_key(&$params, &$fieldName) {
  * @param array $params
  *   Params from civicrm_api, including:.
  *   - 'values': an array of records to save
- *   - all other items: keys which identify new/pre-existing records
+ *   - all other items: keys which identify new/pre-existing records.
+ *
  * @return array|int
  */
 function _civicrm_api3_generic_replace($entity, $params) {
@@ -1637,9 +1709,11 @@ function _civicrm_api3_generic_replace($entity, $params) {
 }
 
 /**
+ * Replace base parameters.
+ *
  * @param array $params
  *
- * @return mixed
+ * @return array
  */
 function _civicrm_api3_generic_replace_base_params($params) {
   $baseParams = $params;
@@ -1650,7 +1724,7 @@ function _civicrm_api3_generic_replace_base_params($params) {
 }
 
 /**
- * returns fields allowable by api
+ * Returns fields allowable by api.
  *
  * @param $entity
  *   String Entity to query.
@@ -1661,7 +1735,13 @@ function _civicrm_api3_generic_replace_base_params($params) {
  * @return array
  */
 function _civicrm_api_get_fields($entity, $unique = FALSE, &$params = array()) {
-  $unsetIfEmpty = array('dataPattern', 'headerPattern', 'default', 'export', 'import');
+  $unsetIfEmpty = array(
+    'dataPattern',
+    'headerPattern',
+    'default',
+    'export',
+    'import',
+  );
   $dao = _civicrm_api3_get_DAO($entity);
   if (empty($dao)) {
     return array();
@@ -1704,10 +1784,13 @@ function _civicrm_api_get_fields($entity, $unique = FALSE, &$params = array()) {
 }
 
 /**
- * Return an array of fields for a given entity - this is the same as the BAO function but
- * fields are prefixed with 'custom_' to represent api params
+ * Return an array of fields for a given entity.
+ *
+ * This is the same as the BAO function but fields are prefixed with 'custom_' to represent api params.
+ *
  * @param $entity
  * @param array $params
+ *
  * @return array
  */
 function _civicrm_api_get_custom_fields($entity, &$params) {
@@ -1740,8 +1823,10 @@ function _civicrm_api_get_custom_fields($entity, &$params) {
 }
 
 /**
- * Translate the custom field data_type attribute into a std 'type'
+ * Translate the custom field data_type attribute into a std 'type'.
+ *
  * @param $dataType
+ *
  * @return int
  */
 function _getStandardTypeFromCustomDataType($dataType) {
@@ -1764,10 +1849,12 @@ function _getStandardTypeFromCustomDataType($dataType) {
 
 
 /**
- * Fill params array with alternate (alias) values where a field has an alias and that is filled & the main field isn't
+ * Fill params array with alternate (alias) values where a field has an alias and that is filled & the main field isn't.
+ *
  * If multiple aliases the last takes precedence
  *
  * Function also swaps unique fields for non-unique fields & vice versa.
+ *
  * @param $apiRequest
  * @param $fields
  */
@@ -1807,7 +1894,8 @@ function _civicrm_api3_swap_out_aliases(&$apiRequest, $fields) {
 
 /**
  * Validate integer fields being passed into API.
- * It currently converts the incoming value 'user_contact_id' into the id of the currently logged in user
+ *
+ * It currently converts the incoming value 'user_contact_id' into the id of the currently logged in user.
  *
  * @param array $params
  *   Params from civicrm_api.
@@ -1816,6 +1904,7 @@ function _civicrm_api3_swap_out_aliases(&$apiRequest, $fields) {
  * @param array $fieldInfo
  *   Array of fields from getfields function.
  * @param string $entity
+ *
  * @throws API_Exception
  */
 function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $entity) {
@@ -1864,14 +1953,15 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent
 }
 
 /**
- * Determine a contact ID using a string expression
+ * Determine a contact ID using a string expression.
  *
  * @param string $contactIdExpr
  *   E.g. "user_contact_id" or "@user:username".
+ *
  * @return int|NULL|'unknown-user'
  */
 function _civicrm_api3_resolve_contactID($contactIdExpr) {
-  //if value = 'user_contact_id' replace value with logged in user id
+  // If value = 'user_contact_id' replace value with logged in user id.
   if ($contactIdExpr == "user_contact_id") {
     return CRM_Core_Session::getLoggedInContactID();
   }
@@ -1894,7 +1984,8 @@ function _civicrm_api3_resolve_contactID($contactIdExpr) {
 }
 
 /**
- * Validate html (check for scripting attack)
+ * Validate html (check for scripting attack).
+ *
  * @param array $params
  * @param string $fieldName
  * @param array $fieldInfo
@@ -1915,6 +2006,7 @@ function _civicrm_api3_validate_html(&$params, &$fieldName, $fieldInfo) {
 
 /**
  * Validate string fields being passed into API.
+ *
  * @param array $params
  *   Params from civicrm_api.
  * @param string $fieldName
@@ -1922,6 +2014,7 @@ function _civicrm_api3_validate_html(&$params, &$fieldName, $fieldInfo) {
  * @param array $fieldInfo
  *   Array of fields from getfields function.
  * @param string $entity
+ *
  * @throws API_Exception
  * @throws Exception
  */
@@ -1971,12 +2064,13 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti
 }
 
 /**
- * Validate & swap out any pseudoconstants / options
+ * Validate & swap out any pseudoconstants / options.
  *
  * @param mixed $fieldValue
  * @param string $entity : api entity name
  * @param string $fieldName : field name used in api call (not necessarily the canonical name)
  * @param array $fieldInfo : getfields meta-data
+ *
  * @throws \API_Exception
  */
 function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldName, $fieldInfo) {
@@ -1984,20 +2078,24 @@ function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldNam
 
   if (!$options) {
     if (strtolower($entity) == 'profile' && !empty($fieldInfo['entity'])) {
-      // we need to get the options from the entity the field relates to
+      // We need to get the options from the entity the field relates to.
       $entity = $fieldInfo['entity'];
     }
-    $options = civicrm_api($entity, 'getoptions', array('version' => 3, 'field' => $fieldInfo['name'], 'context' => 'validate'));
+    $options = civicrm_api($entity, 'getoptions', array(
+      'version' => 3,
+      'field' => $fieldInfo['name'],
+      'context' => 'validate',
+    ));
     $options = CRM_Utils_Array::value('values', $options, array());
   }
 
-  // If passed a value-separated string, explode to an array, then re-implode after matching values
+  // If passed a value-separated string, explode to an array, then re-implode after matching values.
   $implode = FALSE;
   if (is_string($fieldValue) && strpos($fieldValue, CRM_Core_DAO::VALUE_SEPARATOR) !== FALSE) {
     $fieldValue = CRM_Utils_Array::explodePadded($fieldValue);
     $implode = TRUE;
   }
-  // If passed multiple options, validate each
+  // If passed multiple options, validate each.
   if (is_array($fieldValue)) {
     foreach ($fieldValue as &$value) {
       if (!is_array($value)) {
@@ -2017,11 +2115,12 @@ function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldNam
 }
 
 /**
- * Validate & swap a single option value for a field
+ * Validate & swap a single option value for a field.
  *
  * @param string $value field value
  * @param array $options array of options for this field
  * @param string $fieldName field name used in api call (not necessarily the canonical name)
+ *
  * @throws API_Exception
  */
 function _civicrm_api3_api_match_pseudoconstant_value(&$value, $options, $fieldName) {
@@ -2048,7 +2147,7 @@ function _civicrm_api3_api_match_pseudoconstant_value(&$value, $options, $fieldN
 }
 
 /**
- * Returns the canonical name of a field
+ * Returns the canonical name of a field.
  *
  * @param $entity
  *   api entity name (string should already be standardized - no camelCase).
@@ -2088,8 +2187,11 @@ function _civicrm_api3_api_resolve_alias($entity, $fieldName) {
 }
 
 /**
+ * Check if the function is deprecated.
+ *
  * @param string $entity
  * @param array $result
+ *
  * @return string|array|null
  */
 function _civicrm_api3_deprecation_check($entity, $result = array()) {
@@ -2107,11 +2209,14 @@ function _civicrm_api3_deprecation_check($entity, $result = array()) {
 }
 
 /**
+ * Get the actual field value.
+ *
  * In some case $params[$fieldName] holds Array value in this format Array([operator] => [value])
  * So this function returns the actual field value
  *
  * @param array $params
  * @param string $fieldName
+ *
  * @return mixed
  */
 function _civicrm_api3_field_value_check(&$params, $fieldName) {
index 08344100cb96e201fac5fe99a289fe16b5b793ae..5f36ceef306195fbdb8170f739ae9ec4950870c3 100644 (file)
@@ -27,6 +27,9 @@
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
+/**
+ * Class CRM_Contribute_BAO_ContributionRecurTest
+ */
 class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase {
   protected $_params = array();
 
index 24a507d3331bc1ce72abaa23540a730b7e55d9f4..8db28afb1bd8f074527ddcc858edd34fac7157c7 100644 (file)
@@ -78,6 +78,9 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase {
     CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_contact WHERE MATCH(first_name,last_name) AGAINST ("joe")');
   }
 
+  /**
+   * @return mixed
+   */
   public function supportsFts() {
     return version_compare(CRM_Core_DAO::singleValueQuery('SELECT VERSION()'), '5.6.0', '>=');
   }
index cb30579421c78e519b648a7f914c227e3dfa7c8b..8be75f956ffb5f91bda4b0a363e6bf5a5409c810 100644 (file)
@@ -7,6 +7,9 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  */
 class CRM_Core_MenuTest extends CiviUnitTestCase {
 
+  /**
+   * @return array
+   */
   public function pathArguments() {
     $cases = array(); // array(0 => string $input, 1 => array $expectedOutput)
     //$cases[] = array(NULL, array());
index 746a8eff77596112873118c0ba27dce2af46e0ac..a5f1866808aca9b09eefa3abe25e96f3b8161810 100644 (file)
@@ -6,6 +6,14 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Class CRM_Core_Page_RedirectTest
  */
 class CRM_Core_Page_RedirectTest extends CiviUnitTestCase {
+  /**
+   * Get example data.
+   *
+   * @return array
+   */
+  /**
+   * @return array
+   */
   public function examples() {
     $cases = array();
     // $cases[] = array(string $requestPath, string $requestArgs, string $pageArgs, string $expectedUrl)
index f3be84e769bcbb2a8faa198efd2b3fe886f9bec4..24260ab9f66ec1f79857857456099e03f8b23358 100644 (file)
@@ -27,6 +27,9 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
     $this->cids = array();
   }
 
+  /**
+   * @return array
+   */
   public function dataCreateStyle() {
     return array(
       array('sql-insert'),
@@ -34,6 +37,9 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
     );
   }
 
+  /**
+   * @return array
+   */
   public function dataCreateAndCommitStyles() {
     return array(
       array('sql-insert', 'implicit-commit'),
@@ -423,18 +429,34 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
     } // else: implicit-commit
   }
 
+  /**
+   * @param $arg1
+   * @param $arg2
+   */
   public function _preCommit($arg1, $arg2) {
     $this->callbackLog[] = array('_preCommit', $arg1, $arg2);
   }
 
+  /**
+   * @param $arg1
+   * @param $arg2
+   */
   public function _postCommit($arg1, $arg2) {
     $this->callbackLog[] = array('_postCommit', $arg1, $arg2);
   }
 
+  /**
+   * @param $arg1
+   * @param $arg2
+   */
   public function _preRollback($arg1, $arg2) {
     $this->callbackLog[] = array('_preRollback', $arg1, $arg2);
   }
 
+  /**
+   * @param $arg1
+   * @param $arg2
+   */
   public function _postRollback($arg1, $arg2) {
     $this->callbackLog[] = array('_postRollback', $arg1, $arg2);
   }
index 73dfa8aa46bf3501ccf9bb0a04352a87b69886cc..afe8ed133374215aa336f7dfe5ffbfa87118eafc 100644 (file)
@@ -100,6 +100,9 @@ function hooktestb_civicrm_testRunHooks_inner() {
   $test->log[] = 'b-inner';
 }
 
+/**
+ * @return array
+ */
 function hooktesta_civicrm_testRunHooks_merge() {
   return array('from-module-a1', 'from-module-a2');
 }
@@ -113,10 +116,16 @@ function hooktestc_civicrm_testRunHooks_merge() {
   return array();
 }
 
+/**
+ * @return null
+ */
 function hooktestd_civicrm_testRunHooks_merge() {
   return NULL;
 }
 
+/**
+ * @return array
+ */
 function hookteste_civicrm_testRunHooks_merge() {
   return array('from-module-e');
 }
index 390c6d320bc2627f1d454aa45b2378704d54ce73..2e47bd1fb31418dddb68f0ba64fa24ea64eda205 100644 (file)
@@ -11,6 +11,9 @@ class CRM_Utils_HtmlToTextTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
+  /**
+   * @return array
+   */
   public function htmlToTextExamples() {
     $cases = array(); // array(0 => string $html, 1 => string $text)
 
index e92a8ad94fede3317eeb276a1faf4d2c795600d2..bd71876df004a873cc51c9f626a079043dabc71b 100644 (file)
@@ -123,6 +123,9 @@ class CRM_Utils_StringTest extends CiviUnitTestCase {
     $this->assertEquals($expected, $actual);
   }
 
+  /**
+   * @return array
+   */
   public function booleanDataProvider() {
     $cases = array(); // array(0 => $input, 1 => $expectedOutput)
     $cases[] = array(TRUE, TRUE);
index e2ef226c9796fe955c404be48c8141b4fcae576d..dd42564094b082ecf9ab3a07d36c0dfe5bfa8dc0 100644 (file)
@@ -2,7 +2,15 @@
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
+/**
+ * Class CRM_Utils_TimeTest
+ */
 class CRM_Utils_TimeTest extends CiviUnitTestCase {
+  /**
+   * Equal cases.
+   *
+   * @return array
+   */
   public function equalCases() {
     $cases = array(); // array(0 => $timeA, 1 => $timeB, 2 => $threshold, 3 => $expectedResult)
     $cases[] = array('2012-04-01 12:00:00', '2012-04-01 12:00:00', 0, 1);
@@ -16,10 +24,13 @@ class CRM_Utils_TimeTest extends CiviUnitTestCase {
   }
 
   /**
+   * Test equals.
+   *
    * @param string $timeA
    * @param string $timeB
    * @param int $threshold
    * @param bool $expectedResult
+   *
    * @dataProvider equalCases
    */
   public function testEquals($timeA, $timeB, $threshold, $expectedResult) {
index 2977d01a851ea4a3a3ee717eed47c6d5c6c8f8b9..367d98f4b0f469b5a096ba851c1b252f2a55e42e 100644 (file)
@@ -2,6 +2,9 @@
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
+/**
+ * Class CRM_Utils_versionCheckTest
+ */
 class CRM_Utils_versionCheckTest extends CiviUnitTestCase {
 
   /**
index e10579f5612407e00acad7c7ec33cee69213ec85..355193688c89d7d5a9cb5aceca86ed44d9ab9ffb 100644 (file)
@@ -103,6 +103,9 @@ class DynamicFKAuthorizationTest extends \CiviUnitTestCase {
     \CRM_Core_DAO_AllCoreTables::init(TRUE);
   }
 
+  /**
+   * @return array
+   */
   public function okDataProvider() {
     $cases = array();
 
@@ -121,6 +124,9 @@ class DynamicFKAuthorizationTest extends \CiviUnitTestCase {
     return $cases;
   }
 
+  /**
+   * @return array
+   */
   public function badDataProvider() {
     $cases = array();
 
index bf07cabdc72accbb38da0ac116dfe817b6d673c5..5e73953dabcb0f7019391d851d0cae88d3aa90b4 100644 (file)
@@ -7,6 +7,11 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  */
 class TransactionSubscriberTest extends \CiviUnitTestCase {
 
+  /**
+   * Get transaction options.
+   *
+   * @return array
+   */
   public function transactionOptions() {
     $r = array();
     // $r[] = array(string $entity, string $action, array $params, bool $isTransactional, bool $isForceRollback, bool $isNested);
@@ -78,15 +83,18 @@ class TransactionSubscriberTest extends \CiviUnitTestCase {
   }
 
   /**
-   * Ensure that API parameters "is_transactional" and "force_rollback" are parsed correctly
+   * Ensure that API parameters "is_transactional" and "force_rollback" are parsed correctly.
+   *
    * @dataProvider transactionOptions
+   *
    * @param $version
    * @param $entity
    * @param $action
-   * @param $params
-   * @param $isTransactional
-   * @param $isForceRollback
-   * @param $isNested
+   * @param array $params
+   * @param bool $isTransactional
+   * @param bool $isForceRollback
+   * @param bool $isNested
+   *
    * @throws \API_Exception
    */
   public function testTransactionOptions($version, $entity, $action, $params, $isTransactional, $isForceRollback, $isNested) {
index 49bbc75c78ff7cc7afb7e3d2b4beb220e2d7cfd1..904f638e2716bd364ae53daace916ae6e69f4f82 100644 (file)
@@ -3,6 +3,11 @@ namespace Civi\CCase;
 
 require_once 'CiviTest/CiviCaseTestCase.php';
 
+/**
+ * Class SequenceListenerTest
+ *
+ * @package Civi\CCase
+ */
 class SequenceListenerTest extends \CiviCaseTestCase {
 
   public function setUp() {
@@ -101,6 +106,11 @@ class SequenceListenerTest extends \CiviCaseTestCase {
     );
   }
 
+  /**
+   * @param $expected
+   * @param $actual
+   * @param int $tolerance
+   */
   public function assertApproxTime($expected, $actual, $tolerance = 1) {
     $diff = abs(strtotime($expected) - strtotime($actual));
     $this->assertTrue($diff <= $tolerance, sprintf("Check approx time equality. expected=[%s] actual=[%s] tolerance=[%s]",
index 6c279a332bd33248b3bc315957fa39eca699e756..998eb914b83613739c3abbc4f463ac1e68ce37ec 100644 (file)
@@ -103,6 +103,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     }
   }
 
+  /**
+   * @return string
+   */
   protected function prepareTestSession() {
     $result = parent::prepareTestSession();
 
index 26f40ea2e68aeb00569ec671c8fdd021b19af72d..50376eb32995d1e6cedd5d850576f5d32c984175 100755 (executable)
@@ -749,7 +749,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   }
 
   /**
-   * Assert that two numbers are approximately equal
+   * Assert that two numbers are approximately equal.
    *
    * @param int|float $expected
    * @param int|float $actual
@@ -764,9 +764,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   }
 
   /**
+   * Assert attributes are equal.
+   *
    * @param $expectedValues
    * @param $actualValues
-   * @param null $message
+   * @param string $message
    *
    * @throws PHPUnit_Framework_AssertionFailedError
    */
@@ -808,8 +810,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   }
 
   /**
-   * Check that api returned 'is_error' => 0
-   * else provide full message
+   * Check that api returned 'is_error' => 0.
+   *
    * @param array $apiResult
    *   Api result.
    * @param string $prefix
@@ -831,8 +833,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   }
 
   /**
-   * Check that api returned 'is_error' => 1
-   * else provide full message
+   * Check that api returned 'is_error' => 1.
    *
    * @param array $apiResult
    *   Api result.
@@ -861,7 +862,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   }
 
   /**
-   * Check that a deleted item has been deleted
+   * Check that a deleted item has been deleted.
+   *
    * @param $entity
    * @param $id
    */
@@ -2242,9 +2244,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
 
   /**
    * Create test generated example in api/v3/examples.
+   *
    * To turn this off (e.g. on the server) set
    * define(DONT_DOCUMENT_TEST_CONFIG ,1);
    * in your settings file
+   *
    * @param array $params
    *   Array as passed to civicrm_api function.
    * @param array $result
index 18c643125b3e084178098310e43e6bb99d5ac9b2..6a00ca98aec637248e80f317d91435c137d5fdab 100644 (file)
@@ -100,21 +100,26 @@ class Custom extends CiviUnitTestCase {
 
   /**
    * Helper function to delete custom field
+   *
    * @deprecated use function on parent class
+   *
+   * @param $params
    */
   public static function deleteField($params) {
-    require_once 'CRM/Core/BAO/CustomField.php';
     CRM_Core_BAO_CustomField::deleteField($params);
   }
 
   /**
    * Helper function to delete custom group
+   *
    * @deprecated use function on parent class
+   *
+   * @param $params
+   *
    * @return bool
    *   true if Group deleted, false otherwise
    */
   public static function deleteGroup($params) {
-    require_once 'CRM/Core/BAO/CustomGroup.php';
     $deleteCustomGroup = CRM_Core_BAO_CustomGroup::deleteGroup($params, TRUE);
     return $deleteCustomGroup;
   }
index cd4ab3f6d79c2833be329350a68d19be9d61183a..13fd85aaa73572c61ce1856750ff6d767fcd8b4d 100644 (file)
@@ -32,6 +32,9 @@
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
 
+/**
+ * Class WebTest_Activity_AddRecurringActivityTest
+ */
 class WebTest_Activity_AddRecurringActivityTest extends CiviSeleniumTestCase {
 
   protected function setUp() {
index e65a33f6e0ac5a6a5ec0222ad508b788fab457fd..a6448fd1c1dcf2f5eeb1bde83be950e97a149e0a 100644 (file)
@@ -32,6 +32,9 @@
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
 
+/**
+ * Class WebTest_Event_AddRecurringEventTest
+ */
 class WebTest_Event_AddRecurringEventTest extends CiviSeleniumTestCase {
 
   protected function setUp() {
index a835ab9c2d5155e7051f145ff5e1e71e4f51556d..0efbb6762795d21b13b1fcddc7323787125d4720 100644 (file)
@@ -35,6 +35,9 @@ class WebTest_Pledge_StandaloneAddTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
+  /**
+   * @return array
+   */
   public function testStandalonePledgeAdd() {
     $this->webtestLogin();
 
index e403dd2debc05f7ebbea6c02bca41223d86df2b4..7fca8f8abb4b9b361fab0c4eb8e6d472cfaf8ea2 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
- *  File for the TestActionSchedule class
+ * @file
+ * File for the TestActionSchedule class
  *
  *  (PHP 5)
  *
@@ -37,24 +38,21 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
   protected $_entity = 'action_schedule';
   protected $_apiversion = 3;
 
-
   /**
-   *  Test setup for every test
-   *
-   *  Connect to the database, truncate the tables that will be used
-   *  and redirect stdin to a temporary file
+   * Test setup for every test.
    */
   public function setUp() {
-    //  Connect to the database
     parent::setUp();
     $this->useTransaction(TRUE);
   }
 
+  /**
+   * Test simple create action schedule.
+   */
   public function testSimpleActionScheduleCreate() {
     $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
-    $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
     $scheduledStatus = CRM_Core_OptionGroup::getValue('activity_status', 'Scheduled', 'name');
     $mappingId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionMapping', 'activity_type', 'id', 'entity_value');
     $activityTypeId = CRM_Core_OptionGroup::getValue('activity_type', "Meeting", 'name');
@@ -71,14 +69,14 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
       'mapping_id' => $mappingId,
     );
     $actionSchedule = $this->callAPISuccess('action_schedule', 'create', $params);
-    $this->assertTrue(is_numeric($actionSchedule['id']), "In line " . __LINE__);
-    $this->assertTrue($actionSchedule['id'] > 0, "In line " . __LINE__);
+    $this->assertTrue(is_numeric($actionSchedule['id']));
+    $this->assertTrue($actionSchedule['id'] > 0);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
     $this->assertEquals($oldCount + 1, $newCount);
   }
 
   /**
-   * Check if required fields are not passed
+   * Check if required fields are not passed.
    */
   public function testActionScheduleCreateWithoutRequired() {
     $params = array(
@@ -89,7 +87,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   /**
-   *
+   * Test create with scheduled dates.
    */
   public function testActionScheduleWithScheduledDatesCreate() {
     $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
@@ -123,8 +121,8 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
       'subject' => 'Test subject',
     );
     $actionSchedule = $this->callAPISuccess('action_schedule', 'create', $params);
-    $this->assertTrue(is_numeric($actionSchedule['id']), "In line " . __LINE__);
-    $this->assertTrue($actionSchedule['id'] > 0, "In line " . __LINE__);
+    $this->assertTrue(is_numeric($actionSchedule['id']));
+    $this->assertTrue($actionSchedule['id'] > 0);
     $this->assertEquals($actionSchedule['values'][$actionSchedule['id']]['start_action_offset'][0], $params['start_action_offset']);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
     $this->assertEquals($oldCount + 1, $newCount);
index e4be275731958e4788f5e7bcfdeaa86c04b0e5fc..baf8446be59233cc3ba1058344212a43ebd0f030 100644 (file)
@@ -34,15 +34,20 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
   protected $_apiversion = 3;
   protected $_entity = 'loc_block';
 
+  /**
+   * Set up.
+   */
   public function setUp() {
     parent::setUp();
     $this->useTransaction(TRUE);
   }
 
+  /**
+   * Test creating location block.
+   */
   public function testCreateLocBlock() {
     $email = $this->callAPISuccess('email', 'create', array(
       'contact_id' => 'null',
-      'location_type_id' => 1,
       'email' => 'test@loc.block',
     ));
     $phone = $this->callAPISuccess('phone', 'create', array(
@@ -63,11 +68,14 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
     $description = 'Create locBlock with existing entities';
     $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, 'simpleCreate');
     $id = $result['id'];
-    $this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
-    $this->assertNotNull($result['values'][$id]['id'], 'In line ' . __LINE__);
+    $this->assertEquals(1, $result['count']);
+    $this->assertNotNull($result['values'][$id]['id']);
     $this->getAndCheck($params, $id, $this->_entity);
   }
 
+  /**
+   * Test creating location block entities.
+   */
   public function testCreateLocBlockEntities() {
     $params = array(
       'email' => array(
@@ -90,25 +98,25 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
     $description = "Create entities and locBlock in 1 api call";
     $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, 'createEntities');
     $id = $result['id'];
-    $this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
+    $this->assertEquals(1, $result['count']);
 
-    // Now check our results using the return param 'all'
+    // Now check our results using the return param 'all'.
     $getParams = array(
       'id' => $id,
       'return' => 'all',
     );
-    // Can't use callAPISuccess with getsingle
+    // Can't use callAPISuccess with getsingle.
     $result = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__, 'Get entities and location block in 1 api call', 'getEntities', 'get');
     $result = array_pop($result['values']);
-    $this->assertNotNull($result['email_id'], 'In line ' . __LINE__);
-    $this->assertNotNull($result['phone_id'], 'In line ' . __LINE__);
-    $this->assertNotNull($result['phone_2_id'], 'In line ' . __LINE__);
-    $this->assertNotNull($result['address_id'], 'In line ' . __LINE__);
-    $this->assertEquals($params['email']['email'], $result['email']['email'], 'In line ' . __LINE__);
-    $this->assertEquals($params['phone_2']['phone'], $result['phone_2']['phone'], 'In line ' . __LINE__);
-    $this->assertEquals($params['address']['street_address'], $result['address']['street_address'], 'In line ' . __LINE__);
-    // Delete block
-    $result = $this->callAPISuccess($this->_entity, 'delete', array('id' => $id));
+    $this->assertNotNull($result['email_id']);
+    $this->assertNotNull($result['phone_id']);
+    $this->assertNotNull($result['phone_2_id']);
+    $this->assertNotNull($result['address_id']);
+    $this->assertEquals($params['email']['email'], $result['email']['email']);
+    $this->assertEquals($params['phone_2']['phone'], $result['phone_2']['phone']);
+    $this->assertEquals($params['address']['street_address'], $result['address']['street_address']);
+
+    $this->callAPISuccess($this->_entity, 'delete', array('id' => $id));
   }
 
 }
index e4b9d0df570a03735150d53bdae0ad09890543ad..1f6aca9861d9097c5611b5e22a42eb5c92baba27 100644 (file)
@@ -29,7 +29,6 @@ require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php';
 
 /**
  * Class contains api test cases for "civicrm_note"
- *
  */
 class api_v3_NoteTest extends CiviUnitTestCase {
 
@@ -42,7 +41,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
   public function setUp() {
 
     $this->_apiversion = 3;
-    //  Connect to the database
+    // Connect to the database.
     parent::setUp();
     $this->useTransaction(TRUE);
 
@@ -63,7 +62,8 @@ class api_v3_NoteTest extends CiviUnitTestCase {
   ///////////////// civicrm_note_get methods
 
   /**
-   * Check retrieve note with empty parameter array
+   * Check retrieve note with empty parameter array.
+   *
    * Error expected
    */
   public function testGetWithEmptyParams() {
@@ -71,18 +71,19 @@ class api_v3_NoteTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check retrieve note with missing patrameters
+   * Check retrieve note with missing parameters.
+   *
    * Error expected
    */
   public function testGetWithoutEntityId() {
     $params = array(
       'entity_table' => 'civicrm_contact',
     );
-    $note = $this->callAPISuccess('note', 'get', $params);
+    $this->callAPISuccess('note', 'get', $params);
   }
 
   /**
-   * Check civicrm_note_get
+   * Check civicrm_note get.
    */
   public function testGet() {
     $entityId = $this->_noteID;
@@ -90,44 +91,45 @@ class api_v3_NoteTest extends CiviUnitTestCase {
       'entity_table' => 'civicrm_contact',
       'entity_id' => $entityId,
     );
-    $result = $this->callAPIAndDocument('note', 'get', $params, __FUNCTION__, __FILE__);
+    $this->callAPIAndDocument('note', 'get', $params, __FUNCTION__, __FILE__);
   }
 
-
-  ///////////////// civicrm_note_create methods
-
   /**
-   * Check create with empty parameter array
+   * Check create with empty parameter array.
+   *
    * Error Expected
    */
   public function testCreateWithEmptyNoteField() {
     $this->_params['note'] = "";
-    $result = $this->callAPIFailure('note', 'create', $this->_params,
-      'Mandatory key(s) missing from params array: note');
+    $this->callAPIFailure('note', 'create', $this->_params,
+      'Mandatory key(s) missing from params array: note'
+    );
   }
 
   /**
-   * Check create with partial params
+   * Check create with partial params.
+   *
    * Error expected
    */
   public function testCreateWithoutEntityId() {
     unset($this->_params['entity_id']);
-    $result = $this->callAPIFailure('note', 'create', $this->_params,
+    $this->callAPIFailure('note', 'create', $this->_params,
       'Mandatory key(s) missing from params array: entity_id');
   }
 
   /**
-   * Check create with partially empty params
+   * Check create with partially empty params.
+   *
    * Error expected
    */
   public function testCreateWithEmptyEntityId() {
     $this->_params['entity_id'] = "";
-    $result = $this->callAPIFailure('note', 'create', $this->_params,
+    $this->callAPIFailure('note', 'create', $this->_params,
       'Mandatory key(s) missing from params array: entity_id');
   }
 
   /**
-   * Check civicrm_note_create
+   * Check civicrm note create.
    */
   public function testCreate() {
 
@@ -166,7 +168,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check civicrm_note_create - tests used of default set to now
+   * Check civicrm_note_create - tests used of default set to .
    */
   public function testCreateWithoutModifiedDate() {
     unset($this->_params['modified_date']);
@@ -178,20 +180,19 @@ class api_v3_NoteTest extends CiviUnitTestCase {
     ));
   }
 
-
-  ///////////////// civicrm_note_update methods
-
   /**
-   * Check update with empty parameter array
+   * Check update with empty parameter array.
+   *
    * Please don't copy & paste this - is of marginal value
    * better to put time into the function on Syntax Conformance class that tests this
    */
   public function testUpdateWithEmptyParams() {
-    $note = $this->callAPIFailure('note', 'create', array());
+    $this->callAPIFailure('note', 'create', array());
   }
 
   /**
-   * Check update with missing parameter (contact id)
+   * Check update with missing parameter (contact id).
+   *
    * Error expected
    */
   public function testUpdateWithoutContactId() {
@@ -199,13 +200,13 @@ class api_v3_NoteTest extends CiviUnitTestCase {
       'entity_id' => $this->_contactID,
       'entity_table' => 'civicrm_contact',
     );
-    $note = $this->callAPIFailure('note', 'create', $params,
+    $this->callAPIFailure('note', 'create', $params,
       'Mandatory key(s) missing from params array: note'
     );
   }
 
   /**
-   * Check civicrm_note_update
+   * Check civicrm_note update.
    */
   public function testUpdate() {
     $params = array(
@@ -215,7 +216,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
       'subject' => 'Hello World',
     );
 
-    //Update Note
+    // Update Note.
     $this->callAPISuccess('note', 'create', $params);
     $note = $this->callAPISuccess('Note', 'Get', array());
     $this->assertEquals($note['id'], $this->_noteID, 'in line ' . __LINE__);
@@ -225,30 +226,29 @@ class api_v3_NoteTest extends CiviUnitTestCase {
     $this->assertEquals('Note1', $note['values'][$this->_noteID]['note'], 'in line ' . __LINE__);
   }
 
-  ///////////////// civicrm_note_delete methods
-
-
   /**
-   * Check delete with empty parametes array
-   * Error expected
+   * Check delete with empty parameters array.
+   *
+   * Error expected.
    */
   public function testDeleteWithEmptyParams() {
-    $deleteNote = $this->callAPIFailure('note', 'delete', array(), 'Mandatory key(s) missing from params array: id');
+    $this->callAPIFailure('note', 'delete', array(), 'Mandatory key(s) missing from params array: id');
   }
 
   /**
-   * Check delete with wrong id
+   * Check delete with wrong id.
+   *
    * Error expected
    */
   public function testDeleteWithWrongID() {
     $params = array(
       'id' => 0,
     );
-    $deleteNote = $this->callAPIFailure('note', 'delete', $params, 'Mandatory key(s) missing from params array: id');
+    $this->callAPIFailure('note', 'delete', $params, 'Mandatory key(s) missing from params array: id');
   }
 
   /**
-   * Check civicrm_note_delete
+   * Check civicrm_note delete.
    */
   public function testDelete() {
     $additionalNote = $this->noteCreate($this->_contactID);
@@ -257,17 +257,17 @@ class api_v3_NoteTest extends CiviUnitTestCase {
       'id' => $additionalNote['id'],
     );
 
-    $result = $this->callAPIAndDocument('note', 'delete', $params, __FUNCTION__, __FILE__);
+    $this->callAPIAndDocument('note', 'delete', $params, __FUNCTION__, __FILE__);
   }
 
 }
 
 /**
- *  Test civicrm_activity_create() using example code
+ * Test civicrm note create() using example code.
  */
 function testNoteCreateExample() {
   require_once 'api/v3/examples/Note/Create.php';
-  $result = UF_match_get_example();
-  $expectedResult = UF_match_get_expectedresult();
+  $result = Note_get_example();
+  $expectedResult = Note_get_expectedresult();
   $this->assertEquals($result, $expectedResult);
 }
index 3d87b19f71886b61542f22ac69a567a53eb1ba8f..d6434bca3683b94043d12e2414a82128103f5c71 100644 (file)
@@ -39,13 +39,20 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
 
   public $DBResetRequired = TRUE;
 
+  /**
+   * @var int
+   */
+  protected $priceFieldID;
+
+  /**
+   * Setup function.
+   */
   public function setUp() {
     parent::setUp();
-    // put stuff here that should happen before all tests in this unit
-    $priceSetparams = array(
-      #     [domain_id] =>
+    // Put stuff here that should happen before all tests in this unit.
+    $priceSetParams = array(
       'name' => 'default_goat_priceset',
-      'title' => 'Goat accomodation',
+      'title' => 'Goat accommodation',
       'is_active' => 1,
       'help_pre' => "Where does your goat sleep",
       'help_post' => "thank you for your time",
@@ -55,10 +62,10 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_reserved' => 1,
     );
 
-    $price_set = $this->callAPISuccess('price_set', 'create', $priceSetparams);
+    $price_set = $this->callAPISuccess('price_set', 'create', $priceSetParams);
     $this->priceSetID = $price_set['id'];
 
-    $priceFieldparams = array(
+    $priceFieldParams = array(
       'price_set_id' => $this->priceSetID,
       'name' => 'grassvariety',
       'label' => 'Grass Variety',
@@ -66,18 +73,18 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_enter_qty' => 1,
       'is_active' => 1,
     );
-    $priceField = $this->callAPISuccess('price_field', 'create', $priceFieldparams);
+    $priceField = $this->callAPISuccess('price_field', 'create', $priceFieldParams);
     $this->priceFieldID = $priceField['id'];
     $this->_params = array(
       'price_field_id' => $this->priceFieldID,
-      'name' => 'ryegrass',
+      'name' => 'rye grass',
       'label' => 'juicy and healthy',
       'amount' => 1,
     );
 
     $membershipOrgId = $this->organizationCreate(NULL);
     $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $membershipOrgId));
-    $priceSetparams1 = array(
+    $priceSetParams1 = array(
       'name' => 'priceset',
       'title' => 'Priceset with Multiple Terms',
       'is_active' => 1,
@@ -86,9 +93,9 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_quick_config' => 1,
       'is_reserved' => 1,
     );
-    $price_set1 = $this->callAPISuccess('price_set', 'create', $priceSetparams1);
+    $price_set1 = $this->callAPISuccess('price_set', 'create', $priceSetParams1);
     $this->priceSetID1 = $price_set1['id'];
-    $priceFieldparams1 = array(
+    $priceFieldParams1 = array(
       'price_set_id' => $this->priceSetID1,
       'name' => 'memtype',
       'label' => 'memtype',
@@ -96,10 +103,15 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_enter_qty' => 1,
       'is_active' => 1,
     );
-    $priceField1 = $this->callAPISuccess('price_field', 'create', $priceFieldparams1);
+    $priceField1 = $this->callAPISuccess('price_field', 'create', $priceFieldParams1);
     $this->priceFieldID1 = $priceField1['id'];
   }
 
+  /**
+   * Tear down function.
+   *
+   * @throws \Exception
+   */
   public function tearDown() {
     $tablesToTruncate = array(
       'civicrm_contact',