| Current Path : /home/rtorresani/www/generated/code/Amasty/Rewards/Api/RuleRepositoryInterface/ |
| Current File : //home/rtorresani/www/generated/code/Amasty/Rewards/Api/RuleRepositoryInterface/Proxy.php |
<?php
namespace Amasty\Rewards\Api\RuleRepositoryInterface;
/**
* Proxy class for @see \Amasty\Rewards\Api\RuleRepositoryInterface
*/
class Proxy implements \Amasty\Rewards\Api\RuleRepositoryInterface, \Magento\Framework\ObjectManager\NoninterceptableInterface
{
/**
* Object Manager instance
*
* @var \Magento\Framework\ObjectManagerInterface
*/
protected $_objectManager = null;
/**
* Proxied instance name
*
* @var string
*/
protected $_instanceName = null;
/**
* Proxied instance
*
* @var \Amasty\Rewards\Api\RuleRepositoryInterface
*/
protected $_subject = null;
/**
* Instance shareability flag
*
* @var bool
*/
protected $_isShared = null;
/**
* Proxy constructor
*
* @param \Magento\Framework\ObjectManagerInterface $objectManager
* @param string $instanceName
* @param bool $shared
*/
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName = '\\Amasty\\Rewards\\Api\\RuleRepositoryInterface', $shared = true)
{
$this->_objectManager = $objectManager;
$this->_instanceName = $instanceName;
$this->_isShared = $shared;
}
/**
* @return array
*/
public function __sleep()
{
return ['_subject', '_isShared', '_instanceName'];
}
/**
* Retrieve ObjectManager from global scope
*/
public function __wakeup()
{
$this->_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
}
/**
* Clone proxied instance
*/
public function __clone()
{
$this->_subject = clone $this->_getSubject();
}
/**
* Get proxied instance
*
* @return \Amasty\Rewards\Api\RuleRepositoryInterface
*/
protected function _getSubject()
{
if (!$this->_subject) {
$this->_subject = true === $this->_isShared
? $this->_objectManager->get($this->_instanceName)
: $this->_objectManager->create($this->_instanceName);
}
return $this->_subject;
}
/**
* {@inheritdoc}
*/
public function save(\Amasty\Rewards\Api\Data\RuleInterface $rule)
{
return $this->_getSubject()->save($rule);
}
/**
* {@inheritdoc}
*/
public function get($ruleId)
{
return $this->_getSubject()->get($ruleId);
}
/**
* {@inheritdoc}
*/
public function delete(\Amasty\Rewards\Api\Data\RuleInterface $rule)
{
return $this->_getSubject()->delete($rule);
}
/**
* {@inheritdoc}
*/
public function deleteById($ruleId)
{
return $this->_getSubject()->deleteById($ruleId);
}
/**
* {@inheritdoc}
*/
public function getRulesByAction($action, $websiteId, $customerGroupId)
{
return $this->_getSubject()->getRulesByAction($action, $websiteId, $customerGroupId);
}
}