Relation.php 828 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Model\Quote\Address;
  7. use Magento\Framework\Model\ResourceModel\Db\VersionControl\RelationInterface;
  8. class Relation implements RelationInterface
  9. {
  10. /**
  11. * Process object relations
  12. *
  13. * @param \Magento\Framework\Model\AbstractModel $object
  14. * @return void
  15. */
  16. public function processRelation(\Magento\Framework\Model\AbstractModel $object)
  17. {
  18. /**
  19. * @var $object \Magento\Quote\Model\Quote\Address
  20. */
  21. if ($object->itemsCollectionWasSet()) {
  22. $object->getItemsCollection()->save();
  23. }
  24. if ($object->shippingRatesCollectionWasSet()) {
  25. $object->getShippingRatesCollection()->save();
  26. }
  27. }
  28. }