0

I have a quote item:

/**
 * @var \Magento\Quote\Model\QuoteFactory
 */
protected $_cartFactory;

public function __construct(
    ...
    \Magento\Checkout\Model\CartFactory $cartFactory,
    ...
) {
    ...
    $this->_cartFactory = $cartFactory;
    ...
}

...   
/** @var \Magento\Checkout\Model\Cart $cart */
$cart = $this->_cartFactory->create();

/** @var \Magento\Quote\Model\Quote $quote */
$quote = $cart->getQuote();

How can I figure out, which attributes are available/accessible for $quote? I know for example that I can call $quote->getTotals() because I found it somewhere in another code.

How do I know all attributes which I can access?

I tried:

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/shipping.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);

$data= $quote->getData();
$logger->info("Data: ");
$logger->info($data);

But it does not print anything and my site stops working.

1 Answer 1

1

There is no way. It only works by using xdebug or extensions like ChromePhp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.