* Static field for default price set details
*
* @var array
- * @static
*/
static $_defaultPriceSet = NULL;
* (reference) an assoc array of name/value pairs.
*
* @return CRM_Price_DAO_PriceSet
- * @static
*/
public static function create(&$params) {
if (empty($params['id']) && empty($params['name'])) {
* (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Price_DAO_PriceSet
- * @static
*/
public static function retrieve(&$params, &$defaults) {
return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceSet', $params, $defaults);
*
* @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);
* @return array
* default price set
*
- * @static
*/
public static function getDefaultPriceSet($entity = 'contribution') {
if (!empty(self::$_defaultPriceSet[$entity])) {
* @return string
* title
*
- * @static
*/
public static function getTitle($id) {
return CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $id, 'title');
* @param int $id
* Price Set id.
*
- * @return boolean
+ * @return bool
* false if fields exist for this set, true if the
* set could be deleted
*
- * @static
*/
public static function deleteSet($id) {
// remove from all inactive forms
*
* @return int|NULL
* price set id on success, null otherwise
- * @static
*/
public static function getSetId(&$params) {
$fid = NULL;
$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;
}
* @return array
* Array of the field ids
*
- * @static
*/
public static function getFieldIds($id) {
$priceField = new CRM_Price_DAO_PriceField();
* 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");
* @param bool $onlyActive
*
* @return int|null|string
- * @static
*/
public static function getPricesetCount($sid, $onlyActive = TRUE) {
$count = 0;
*
* @return array
* associate array of frequency interval and unit
- * @static
*/
public static function getRecurDetails($priceSetId) {
$query = 'SELECT mt.duration_interval, mt.duration_unit
*
* @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);
* 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