| Current Path : /home/rtorresani/www/generated/code/Magento/Quote/Api/CartManagementInterface/ |
| Current File : //home/rtorresani/www/generated/code/Magento/Quote/Api/CartManagementInterface/Proxy.php |
<?php
namespace Magento\Quote\Api\CartManagementInterface;
/**
* Proxy class for @see \Magento\Quote\Api\CartManagementInterface
*/
class Proxy implements \Magento\Quote\Api\CartManagementInterface, \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 \Magento\Quote\Api\CartManagementInterface
*/
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 = '\\Magento\\Quote\\Api\\CartManagementInterface', $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 \Magento\Quote\Api\CartManagementInterface
*/
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 createEmptyCart()
{
return $this->_getSubject()->createEmptyCart();
}
/**
* {@inheritdoc}
*/
public function createEmptyCartForCustomer($customerId)
{
return $this->_getSubject()->createEmptyCartForCustomer($customerId);
}
/**
* {@inheritdoc}
*/
public function getCartForCustomer($customerId)
{
return $this->_getSubject()->getCartForCustomer($customerId);
}
/**
* {@inheritdoc}
*/
public function assignCustomer($cartId, $customerId, $storeId)
{
return $this->_getSubject()->assignCustomer($cartId, $customerId, $storeId);
}
/**
* {@inheritdoc}
*/
public function placeOrder($cartId, ?\Magento\Quote\Api\Data\PaymentInterface $paymentMethod = null)
{
return $this->_getSubject()->placeOrder($cartId, $paymentMethod);
}
}