/**
  * Delete price set for the given entity and id
  *
  * @param string $entityTable
  * @param integer $entityId
  */
 public static function removeFrom($entityTable, $entityId)
 {
     $dao = new CRM_Price_DAO_SetEntity();
     $dao->entity_table = $entityTable;
     $dao->entity_id = $entityId;
     return $dao->delete();
 }
Example #2
0
 /**
  * returns the list of fields that can be exported
  *
  * @access public
  * return array
  */
 function &export($prefix = false)
 {
     if (!self::$_export) {
         self::$_export = array();
         $fields =& self::fields();
         foreach ($fields as $name => $field) {
             if (CRM_Utils_Array::value('export', $field)) {
                 if ($prefix) {
                     self::$_export['price_set_entity'] =& $fields[$name];
                 } else {
                     self::$_export[$name] =& $fields[$name];
                 }
             }
         }
     }
     return self::$_export;
 }
Example #3
0
 /**
  * Find a price_set_id associatied with the given table and id
  *
  * @param string $entityTable
  * @param integer $entityId
  * @return integer|false price_set_id, or false if none found
  */
 public static function getFor($entityTable, $entityId)
 {
     if (!$entityTable || !$entityId) {
         return false;
     }
     require_once 'CRM/Price/DAO/SetEntity.php';
     $dao = new CRM_Price_DAO_SetEntity();
     $dao->entity_table = $entityTable;
     $dao->entity_id = $entityId;
     $dao->find(true);
     return isset($dao->price_set_id) ? $dao->price_set_id : false;
 }