Advertisement
Guest User

payoptionconfig.php

a guest
Jun 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * @version 3.2.5
  5. * @package Joomla 3.x
  6. * @subpackage DT Register
  7. * @copyright Copyright (C) 2006 DTH Development
  8. * @copyright contact dthdev@dthdevelopment.com
  9. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  10. */
  11.  
  12. defined( '_JEXEC' ) or die( 'Restricted access' );
  13.  
  14. class DtregisterModelPayoptionconfig extends DtrModel {
  15.  
  16.    function __construct($config = array()){
  17.      
  18.        parent::__construct($config);
  19.        
  20.        $this->table = DtrTable::getInstance('Payoptionconfig','DtrTable');  // new TableDuser($this->getDBO());
  21.  
  22.      }
  23.    
  24. }
  25.  
  26. class DtrTablePayoptionconfig extends DtrTable{
  27.  
  28.    var $payment_id;
  29.  
  30.    var $key;
  31.  
  32.    var $value;
  33.  
  34.    var $id;
  35.  
  36.    function __construct( $db = null ) {
  37.  
  38.         $db = JFactory::getDBO();
  39.  
  40.         $this->db =$db;
  41.  
  42.         parent::__construct( '#__dtregister_payment_config', 'id', $db );
  43.  
  44.   }
  45.  
  46.   function removeByPaymentid(){
  47.  
  48.      $query = "delete from ".$this->getTableName()." where payment_id = ".$this->db->Quote($this->payment_id)." ";
  49.  
  50.      $this->db->setQuery($query);
  51.  
  52.      $this->db->query();
  53.  
  54.   }
  55.  
  56.   function saveAll($data){
  57.  
  58.      $config_data = array();
  59.  
  60.       if (is_array($data))
  61.       foreach($data as $key=>$value){
  62.  
  63.           if(is_array($value)){
  64.  
  65.              $value = implode(",",$value);
  66.  
  67.           }
  68.  
  69.          $config_data[] = array('key'=>$key,'value'=>$value);
  70.  
  71.      }
  72.  
  73.      dtpr($config_data);
  74.  
  75.      parent::saveAll($config_data);
  76.  
  77.   }
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement