/**
  *
  * @param type $query_params
  * @param boolean $allow_blocking if TRUE, matched objects will only be deleted if there is no related model info
  * that blocks it (ie, there' sno other data that depends on this data); if false, deletes regardless of other objects
  * which may depend on it. Its generally advisable to always leave this as TRUE, otherwise you could easily corrupt your DB
  * @return boolean
  */
 public function delete_permanently($query_params = array(), $allow_blocking = true)
 {
     $would_be_deleted_price_types = $this->get_all_deleted_and_undeleted($query_params);
     $would_be_deleted_price_type_ids = array_keys($would_be_deleted_price_types);
     $ID = $query_params[0][$this->get_primary_key_field()->get_name()];
     //check if any prices use this price type
     $prc_query_params = array(array('PRT_ID' => array('IN', $would_be_deleted_price_type_ids)));
     if ($prices = $this->get_all_related($ID, 'Price', $prc_query_params)) {
         $prices_names_and_ids = array();
         foreach ($prices as $price) {
             /* @var $price EE_Price */
             $prices_names_and_ids[] = $price->name() . "(" . $price->ID() . ")";
         }
         $msg = sprintf(__('The Price Type(s) could not be deleted because there are existing Prices that currently use this Price Type.  If you still wish to delete this Price Type, then either delete those Prices or change them to use other Price Types.The prices are: %s', 'event_espresso'), implode(",", $prices_names_and_ids));
         EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
         return FALSE;
     }
     return parent::delete_permanently($query_params);
 }