*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
- * Business object for managing price sets
- *
+ * Business object for managing price sets.
*/
class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set extends CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set {
}
/**
- * Calculate the default price set id.
- * assigned to the contribution/membership etc
+ * Calculate the default price set id assigned to the contribution/membership etc.
*
* @param string $entity
*
* @return int
* priceSetID
- *
*/
public static function getDefaultPriceSet($entity = 'contribution') {
if ($entity == 'contribution') {
*
* @return string
* title
- *
*/
public static function getTitle($id) {
return CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set', $id, 'title');
* @return bool
* false if fields exist for this set, true if the
* set could be deleted
- *
*/
public static function deleteSet($id) {
// remove from all inactive forms
}
/**
- * Find a price_set_id associatied with the given table, id and usedFor
+ * Find a price_set_id associated with the given details.
+ *
* Used For value for events:1, contribution:2, membership:3
*
* @param string $entityTable
}
/**
+ * Initialise set.
+ *
* @param CRM_Core_Form $form
* @param int $id
* @param string $entityTable
}
/**
- * @param $fields
+ * Process amount.
+ *
+ * @param array $fields
* @param array $params
- * @param $lineItem
+ * @param array $lineItem
*/
public static function processAmount(&$fields, &$params, &$lineItem) {
// using price set
}
/**
- * check the current Membership
- * having end date null.
+ * Check the current Membership.
+ *
+ * @param array $options
+ * @param int $userid
+ *
+ * @return bool
*/
public static function checkCurrentMembership(&$options, $userid) {
if (!$userid || empty($options)) {
- return;
+ return FALSE;
}
static $_contact_memberships = array();
$checklifetime = FALSE;
}
/**
- * Set daefult the price set fields.
+ * Set default the price set fields.
*
* @param CRM_Core_Form $form
- * @param $defaults
+ * @param array $defaults
*
* @return array
*/
*
* @return array
* Array of the field ids
- *
*/
public static function getFieldIds($id) {
$priceField = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field();
}
/**
- * Copy a price set, including all the fields
+ * Copy a price set, including all the fields.
*
* @param int $id
* The price set id to copy.
}
/**
- * check price set permission.
+ * Check price set permission.
*
* @param int $sid
* The price set id.
}
/**
- * Get the sum of participant count.
- * for all fields of given price set.
+ * Get the sum of participant count for all fields of given price set.
*
* @param int $sid
* The price set id.
}
/**
- * @param $ids
+ * Get membership count.
+ *
+ * @param array $ids
*
* @return array
*/
}
/**
+ * Get event price set for domain.
+ *
* @return object
*/
public static function eventPriceSetDomainID() {