# easy-code-manager/1.2/framework/ServicesClientAPI/Store.class.php

FluentSnippets – High-Performance Code Snippets, Header &amp; Footer Code, Custom CSS &amp; PHP Code Manager, version 1.2. 245 lines.

- Page: https://pluginprobe.com/plugins/easy-code-manager/1.2/code/framework/ServicesClientAPI/Store.class.php
- Raw: https://pluginprobe.com/plugins/easy-code-manager/1.2/raw/framework/ServicesClientAPI/Store.class.php
- Modified: 2018-10-25T11:18:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-code-manager/1.2/code/framework/ServicesClientAPI/Store.class.php#L10-L20`.

```php
<?php
/**
* 
*/

/**
* 
*/
class CJTStore extends CJTServicesClientModule 
{
	
    /**
    * put your comment there...
    * 
    * @var mixed
    */
    private $attrs;
    
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	private $baseName;
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	private $itemName;
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	private $license;
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	private $pluginFile;

	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	private $slug;

    /**
    * put your comment there...
    * 
    * @param mixed $servicesClient
    * @param mixed $itemName
    * @param mixed $license
    * @param mixed $attrs
    * @param mixed $pluginFile
    * @return CJTStore
    */
	public function __construct($servicesClient, 
                                $itemName, 
                                $license, 
                                $attrs, 
                                $pluginFile) 
    {
        
		# Initialize module base class
		parent::__construct($servicesClient);
        
		# Initialize 
		$this->pluginFile = $pluginFile;
		$this->baseName = plugin_basename($pluginFile);
		$this->slug = basename($this->baseName, '.php');
		$this->license = $license;
        $this->attrs = $attrs;
		$this->itemName = $itemName;
        
	}

	/**
	* put your comment there...
	* 
	* @param mixed $ownerName
	* @return mixed
	*/
	public function activateLicense($ownerName) 
    {
		return (int) $this->makeCall(__FUNCTION__, compact('ownerName'))->getResponseData();
	}

	/**
	* put your comment there...
	* 
	* @param mixed $ownerName
	* @return mixed
	*/
	public function checkLicense($ownerName) 
    {
		return (int) $this->makeCall(__FUNCTION__, compact('ownerName'))->getResponseData();
	}

	/**
	* put your comment there...
	* 
	* @param mixed $ownerName
	* @return mixed
	*/
	public function deactivateLicense($ownerName) 
    {
		return (int) $this->makeCall(__FUNCTION__, compact('ownerName'))->getResponseData();
	}

    /**
    * put your comment there...
    * 
    */
    public function getAttrs() 
    {
        return $this->attrs;
    }
    
	/**
	* put your comment there...
	* 
	*/
	public function getBaseName() 
    {
		return $this->baseName;
	}

	/**
	* put your comment there...
	* 
	*/
	public function getItemName() 
    {
		return $this->itemName;
	}

	/**
	* put your comment there...
	* 
	*/
	public function getPluginInformation() 
    {
		# Check if there is update available for current extension
		$info = $this->jsonDecode($this->makeCall(__FUNCTION__)->getResponseData());
        
		# Return result
		return $info;
	}

	/**
	* put your comment there...
	* 
	*/
	public function getPluginUpdate() 
    {
        
		# Check if there is update available for current extension                            
		$pluginUpdate = $this->jsonDecode($this->makeCall(__FUNCTION__)->getResponseData());
        
		# Return result
		return $pluginUpdate;
	}

	/**
	* put your comment there...
	* 
	*/
	public function getLicense() 
    {
		return $this->license;
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function getPluginFile() 
    {
		return $this->pluginFile;
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function getSlug() 
    {
		return $this->slug;
	}

	/**
	* put your comment there...
	* 
	*/
	public function hasUpdate() 
    {
        
		# Get Last release version
		$pluginUpdate = $this->getPluginInformation();
		$version = $pluginUpdate['currentVersion'];
        
		# Get Plugin current version
		$pluginData = get_plugin_data($this->getPluginFile());
        
		# Return version details if there is new version/ otherwise return false
		$result = (version_compare($version, $pluginData['Version']) == 1) ? $pluginUpdate : false;
        
		return $result;
	}

	/**
	* put your comment there...
	* 
	* @param mixed $method
	* @param mixed $params
	* @param mixed $postData
	* @return CJTServicesClientModule
	*/
	public function makeCall(   $method,
                                $params = null, 
                                $postData = null, 
                                $bodyEncoding = CJTServicesClient::BODY_ENCODING_JSON) 
    {
        
		# Always include the following parameters
		$params = array_merge(array
        ( 
		    'itemIdentifier' => $this->getItemName(), 
            'license' => $this->getLicense() ,
            'itemAttrs' => $this->getAttrs(),
            
        ), $params ? $params : array());
		
        // Make API Call throuh Module base layer
		return parent::makeCall($method, $params, $postData, $bodyEncoding);
	}

}
```
