Your IP : 216.73.216.231


Current Path : /home/digilove/public_html/components/com_marketplace/models/
Upload File :
Current File : /home/digilove/public_html/components/com_marketplace/models/profilesave.php

<?php
/**
 * Marketplace - Component Marketplace 
 * ******************************************************************
 *
 * PHP version 7.0
 *
 * @category   Component
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 * ******************************************************************
 */
// no direct access

defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.model');

// import the tables
JTable::addIncludePath(JPATH_SITE.'/components/com_marketplace/tables');

if (!class_exists('MarketplaceModelProfilesave')) {
    /**
     * MarketplaceModelProfilesave class
     * 
     * @category Component
     * @package  Joomla
     * @author   WebKul software private limited <support@webkul.com>
     * @license  http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
     * @link     Technical Support:  webkul.uvdesk.com
     */
    class MarketplaceModelProfilesave extends JModelLegacy
    {
        var $customerTable = null;
        /**
         * __construct function
         */
        function __construct()
        {
            parent::__construct();
            $this->customerTable = JTable::getInstance('seller', 'Table');
        }
        /**
         * SaveItem function
         *
         * @param [type] $data var
         * 
         * @return void
         */
        function saveItem($data)
        {
            if (!$this->customerTable->bind($data)) {
                $this->setError($this->customerTable->getError());
                return false;
            }

            if (!$this->customerTable->store()) {
                $this->setError($this->customerTable->getError());
                return false;
            }
            JPluginHelper::importPlugin('system');
            $dispatcher =JDispatcher::getInstance();
            $addonData=$dispatcher->trigger(
                'onSellerAfterProfileSave',
                array($data)
            );
            return true;
        }
        /**
         * GetItem function
         *
         * @param [type] $sid var
         * @param [type] $get var
         * 
         * @return void
         */
        function getItem($sid,$get)
        {
            $db = JFactory::getDBO();
            $query = $db->getQuery(true);
            $query->select($db->quoteName($get))
                ->from($db->quoteName('#__marketplace_sellerprofile'))
                ->where($db->quoteName("seller_id")."=". $db->quote($sid));
            $db->setQuery($query);
            try{
                $data= $db->loadResult();
            }catch(Exception $e){
                JFactory::getApplication()->enqueueMessage(
                    $e->getMessage(),
                    'error'
                );
                return false;
            }
            return $data;
        }
    }
}