INFRA 32 - Batch #17
[civicrm-core.git] / CRM / Price / BAO / PriceSet.php
index 40e5bb9f028454ef1739bfb69208035faa33266c..d03b8b2c7b5ad60dffb2d1afe149ab06a9d4fd32 100644 (file)
@@ -43,7 +43,6 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet {
    * Static field for default price set details
    *
    * @var array
-   * @static
    */
   static $_defaultPriceSet = NULL;
 
@@ -60,8 +59,7 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet {
    * @param array $params
    *   (reference) an assoc array of name/value pairs.
    *
-   * @return CRM_Price_DAO_PriceSet object
-   * @static
+   * @return CRM_Price_DAO_PriceSet
    */
   public static function create(&$params) {
     if (empty($params['id']) && empty($params['name'])) {
@@ -86,8 +84,7 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet {
    * @param array $defaults
    *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return CRM_Price_DAO_PriceSet object
-   * @static
+   * @return CRM_Price_DAO_PriceSet
    */
   public static function retrieve(&$params, &$defaults) {
     return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceSet', $params, $defaults);
@@ -104,7 +101,6 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet {
    *
    * @return Object
    *   DAO object on sucess, null otherwise
-   * @static
    */
   public static function setIsActive($id, $isActive) {
     return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceSet', $id, 'is_active', $isActive);
@@ -119,7 +115,6 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet {
    * @return array
    *   default price set
    *
-   * @static
    */
   public static function getDefaultPriceSet($entity = 'contribution') {
     if (!empty(self::$_defaultPriceSet[$entity])) {
@@ -165,7 +160,6 @@ WHERE       ps.name = '{$entityName}'
    * @return string
    *   title
    *
-   * @static
    */
   public static function getTitle($id) {
     return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $id, 'title');
@@ -285,11 +279,10 @@ WHERE     ct.id = cp.financial_type_id AND
    * @param int $id
    *   Price Set id.
    *
-   * @return boolean
+   * @return bool
    *   false if fields exist for this set, true if the
-   * set could be deleted
+   *   set could be deleted
    *
-   * @static
    */
   public static function deleteSet($id) {
     // remove from all inactive forms
@@ -375,7 +368,7 @@ WHERE     ct.id = cp.financial_type_id AND
    * @param null $isQuickConfig
    * @param null $setName
    *
-   * @return integer|false
+   * @return int|false
    *   price_set_id, or false if none found
    */
   public static function getFor($entityTable, $entityId, $usedFor = NULL, $isQuickConfig = NULL, &$setName = NULL) {
@@ -413,9 +406,8 @@ WHERE     ct.id = cp.financial_type_id AND
    *                      array may contain either option id or
    *                      price field id
    *
-   * @return integer|NULL
+   * @return int|NULL
    *   price set id on success, null  otherwise
-   * @static
    */
   public static function getSetId(&$params) {
     $fid = NULL;
@@ -911,7 +903,7 @@ WHERE  id = %1";
     $className = CRM_Utils_System::getClassName($form);
     if (in_array($className, array(
       'CRM_Contribute_Form_Contribution',
-      'CRM_Member_Form_Membership'
+      'CRM_Member_Form_Membership',
     ))) {
       $validFieldsOnly = FALSE;
     }
@@ -1092,9 +1084,8 @@ WHERE  id = %1";
    *   Price Set id.
    *
    * @return array
-   *   of the field ids
+   *   Array of the field ids
    *
-   * @static
    */
   public static function getFieldIds($id) {
     $priceField = new CRM_Price_DAO_PriceField();
@@ -1113,7 +1104,6 @@ WHERE  id = %1";
    *   The price set id to copy.
    *
    * @return CRM_Price_DAO_PriceSet
-   * @static
    */
   public static function copy($id) {
     $maxId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_price_set");
@@ -1182,7 +1172,6 @@ WHERE  id = %1";
    * @param bool $onlyActive
    *
    * @return int|null|string
-   * @static
    */
   public static function getPricesetCount($sid, $onlyActive = TRUE) {
     $count = 0;
@@ -1292,7 +1281,6 @@ GROUP BY     mt.member_of_contact_id";
    *
    * @return array
    *   associate array of frequency interval and unit
-   * @static
    */
   public static function getRecurDetails($priceSetId) {
     $query = 'SELECT mt.duration_interval, mt.duration_unit
@@ -1322,12 +1310,11 @@ GROUP BY     mt.member_of_contact_id";
    *
    * @param int $id
    *   Id of the database record.
-   * @param bool $isQuickConfigValue we want to set the is_quick_config field.
+   * @param bool $isQuickConfig we want to set the is_quick_config field.
    *   Value we want to set the is_quick_config field.
    *
    * @return Object
    *   DAO object on sucess, null otherwise
-   * @static
    */
   public static function setIsQuickConfig($id, $isQuickConfig) {
     return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceSet', $id, 'is_quick_config', $isQuickConfig);
@@ -1337,12 +1324,10 @@ GROUP BY     mt.member_of_contact_id";
    * Check if price set id provides option for
    * user to select both auto-renew and non-auto-renew memberships
    *
-   * @static
    */
   public static function checkMembershipPriceSet($id) {
-    $query =
-      "
-SELECT      pfv.id, pfv.price_field_id, pfv.name, pfv.membership_type_id, pf.html_type, mt.auto_renew
+    $query
+      = "SELECT      pfv.id, pfv.price_field_id, pfv.name, pfv.membership_type_id, pf.html_type, mt.auto_renew
 FROM        civicrm_price_field_value pfv
 LEFT JOIN   civicrm_price_field pf ON pf.id = pfv.price_field_id
 LEFT JOIN   civicrm_price_set ps ON ps.id = pf.price_set_id
@@ -1421,8 +1406,14 @@ WHERE       ps.id = %1
     }
   }
 
-  /*
+  /**
    * Function to set tax_amount and tax_rate in LineItem
+   *
+   * @param array $field
+   * @param array $lineItem
+   * @param int $optionValueId
+   *
+   * @return array
    */
   public static function setLineItem($field, $lineItem, $optionValueId) {
     if ($field['html_type'] == 'Text') {