Skip to content

Commit 36b3a69

Browse files
committed
Merge pull request #305 from magento-goinc/MAGETWO-35590
[GoInc] Private content rendering + Bugs + Define Public Api
2 parents 17728c9 + 482e2bf commit 36b3a69

File tree

332 files changed

+4492
-3494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+4492
-3494
lines changed

app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
*/
1616
class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer
1717
{
18-
/**
19-
* @var Configuration
20-
*/
21-
protected $_configurationHelper = null;
22-
2318
/**
2419
* Bundle catalog product configuration
2520
*
@@ -67,54 +62,6 @@ public function __construct(
6762
$this->_isScopePrivate = true;
6863
}
6964

70-
/**
71-
* @return void
72-
*/
73-
protected function _construct()
74-
{
75-
parent::_construct();
76-
$this->_configurationHelper = $this->_bundleProductConfiguration;
77-
}
78-
79-
/**
80-
* Get bundled selections (slections-products collection)
81-
*
82-
* Returns array of options objects.
83-
* Each option object will contain array of selections objects
84-
*
85-
* @param bool $useCache
86-
* @return array
87-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
88-
*/
89-
protected function _getBundleOptions($useCache = true)
90-
{
91-
return $this->_configurationHelper->getBundleOptions($this->getItem());
92-
}
93-
94-
/**
95-
* Obtain final price of selection in a bundle product
96-
*
97-
* @param \Magento\Catalog\Model\Product $selectionProduct
98-
* @return float
99-
*/
100-
protected function _getSelectionFinalPrice($selectionProduct)
101-
{
102-
$helper = $this->_bundleProductConfiguration;
103-
$result = $helper->getSelectionFinalPrice($this->getItem(), $selectionProduct);
104-
return $result;
105-
}
106-
107-
/**
108-
* Get selection quantity
109-
*
110-
* @param int $selectionId
111-
* @return float
112-
*/
113-
protected function _getSelectionQty($selectionId)
114-
{
115-
return $this->_configurationHelper->getSelectionQty($this->getProduct(), $selectionId);
116-
}
117-
11865
/**
11966
* Overloaded method for getting list of bundle options
12067
* Caches result in quote item, because it can be used in cart 'recent view' and on same page in cart checkout
@@ -123,7 +70,7 @@ protected function _getSelectionQty($selectionId)
12370
*/
12471
public function getOptionList()
12572
{
126-
return $this->_configurationHelper->getOptions($this->getItem());
73+
return $this->_bundleProductConfiguration->getOptions($this->getItem());
12774
}
12875

12976
/**
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Bundle\CustomerData;
7+
8+
/**
9+
* Bundle item renderer
10+
*/
11+
class BundleItem extends \Magento\Checkout\CustomerData\DefaultItem
12+
{
13+
/**
14+
* Gift card catalog product configuration
15+
*
16+
* @var \Magento\Bundle\Helper\Catalog\Product\Configuration
17+
*/
18+
protected $bundleConfiguration;
19+
20+
/**
21+
* @param \Magento\Catalog\Model\Product\Image\View $productImageView
22+
* @param \Magento\Msrp\Helper\Data $msrpHelper
23+
* @param \Magento\Framework\UrlInterface $urlBuilder
24+
* @param \Magento\Catalog\Helper\Product\Configuration $configurationHelper
25+
* @param \Magento\Checkout\Helper\Data $checkoutHelper
26+
* @param \Magento\Bundle\Helper\Catalog\Product\Configuration $bundleConfiguration
27+
*/
28+
public function __construct(
29+
\Magento\Catalog\Model\Product\Image\View $productImageView,
30+
\Magento\Msrp\Helper\Data $msrpHelper,
31+
\Magento\Framework\UrlInterface $urlBuilder,
32+
\Magento\Catalog\Helper\Product\Configuration $configurationHelper,
33+
\Magento\Checkout\Helper\Data $checkoutHelper,
34+
\Magento\Bundle\Helper\Catalog\Product\Configuration $bundleConfiguration
35+
) {
36+
parent::__construct($productImageView, $msrpHelper, $urlBuilder, $configurationHelper, $checkoutHelper);
37+
$this->bundleConfiguration = $bundleConfiguration;
38+
}
39+
40+
/**
41+
* {@inheritdoc}
42+
*/
43+
protected function getOptionList()
44+
{
45+
return $this->bundleConfiguration->getOptions($this->item);
46+
}
47+
}

app/code/Magento/Bundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"magento/framework": "0.74.0-beta8",
1919
"magento/module-quote": "0.74.0-beta8",
2020
"magento/module-media-storage": "0.74.0-beta8",
21+
"magento/module-msrp": "0.74.0-beta8",
2122
"magento/magento-composer-installer": "*"
2223
},
2324
"suggest": {

app/code/Magento/Bundle/etc/frontend/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@
1616
</argument>
1717
</arguments>
1818
</type>
19+
<type name="Magento\Checkout\CustomerData\ItemPoolInterface">
20+
<arguments>
21+
<argument name="itemMap" xsi:type="array">
22+
<item name="bundle" xsi:type="string">Magento\Bundle\CustomerData\BundleItem</item>
23+
</argument>
24+
</arguments>
25+
</type>
1926
</config>

app/code/Magento/Bundle/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/code/Magento/CacheInvalidate/Model/Observer.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\CacheInvalidate\Model;
77

8+
use Magento\Framework\Cache\InvalidateLogger;
9+
810
/**
911
* Class Observer
1012
*/
@@ -27,21 +29,29 @@ class Observer
2729
*/
2830
protected $_curlAdapter;
2931

32+
/**
33+
* @var InvalidateLogger
34+
*/
35+
private $logger;
36+
3037
/**
3138
* Constructor
3239
*
3340
* @param \Magento\PageCache\Model\Config $config
3441
* @param \Magento\PageCache\Helper\Data $helper
3542
* @param \Magento\Framework\HTTP\Adapter\Curl $curlAdapter
43+
* @param InvalidateLogger $logger
3644
*/
3745
public function __construct(
3846
\Magento\PageCache\Model\Config $config,
3947
\Magento\PageCache\Helper\Data $helper,
40-
\Magento\Framework\HTTP\Adapter\Curl $curlAdapter
48+
\Magento\Framework\HTTP\Adapter\Curl $curlAdapter,
49+
InvalidateLogger $logger
4150
) {
4251
$this->_config = $config;
4352
$this->_helper = $helper;
4453
$this->_curlAdapter = $curlAdapter;
54+
$this->logger = $logger;
4555
}
4656

4757
/**
@@ -95,5 +105,7 @@ protected function sendPurgeRequest($tagsPattern)
95105
$this->_curlAdapter->write('', $this->_helper->getUrl('*'), '1.1', $headers);
96106
$this->_curlAdapter->read();
97107
$this->_curlAdapter->close();
108+
109+
$this->logger->execute(compact('tagsPattern'));
98110
}
99111
}

app/code/Magento/CacheInvalidate/Test/Unit/Model/ObserverTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class ObserverTest extends \PHPUnit_Framework_TestCase
2222
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\PageCache\Helper\Data */
2323
protected $_helperMock;
2424

25+
/** @var \PHPUnit_Framework_MockObject_MockObject */
26+
protected $logger;
27+
2528
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Object\ */
2629
protected $_observerObject;
2730

@@ -45,10 +48,12 @@ public function setUp()
4548
'',
4649
false
4750
);
51+
$this->logger = $this->getMock('Magento\Framework\Cache\InvalidateLogger', [], [], '', false);
4852
$this->_model = new \Magento\CacheInvalidate\Model\Observer(
4953
$this->_configMock,
5054
$this->_helperMock,
51-
$this->_curlMock
55+
$this->_curlMock,
56+
$this->logger
5257
);
5358
$this->_observerMock = $this->getMock(
5459
'Magento\Framework\Event\Observer',

app/code/Magento/Catalog/Api/AttributeSetManagementInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Catalog\Api;
88

9+
/**
10+
* @api
11+
*/
912
interface AttributeSetManagementInterface
1013
{
1114
/**

app/code/Magento/Catalog/Api/AttributeSetRepositoryInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Catalog\Api;
88

9+
/**
10+
* @api
11+
*/
912
interface AttributeSetRepositoryInterface
1013
{
1114
/**

app/code/Magento/Catalog/Api/CategoryAttributeOptionManagementInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* Interface RepositoryInterface must be implemented in new model
11+
* @api
1112
*/
1213
interface CategoryAttributeOptionManagementInterface
1314
{

app/code/Magento/Catalog/Api/CategoryAttributeRepositoryInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* Interface RepositoryInterface must be implemented in new model
11+
* @api
1112
*/
1213
interface CategoryAttributeRepositoryInterface extends \Magento\Framework\Api\MetadataServiceInterface
1314
{

app/code/Magento/Catalog/Api/CategoryLinkManagementInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Magento\Catalog\Api;
88

9+
/**
10+
* @api
11+
*/
912
interface CategoryLinkManagementInterface
1013
{
1114
/**

app/code/Magento/Catalog/Api/CategoryLinkRepositoryInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Magento\Catalog\Api;
88

9+
/**
10+
* @api
11+
*/
912
interface CategoryLinkRepositoryInterface
1013
{
1114
/**

app/code/Magento/Catalog/Api/CategoryManagementInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Magento\Catalog\Api;
99

10+
/**
11+
* @api
12+
*/
1013
interface CategoryManagementInterface
1114
{
1215
/**

app/code/Magento/Catalog/Api/CategoryRepositoryInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Magento\Catalog\Api;
99

10+
/**
11+
* @api
12+
*/
1013
interface CategoryRepositoryInterface
1114
{
1215
/**

app/code/Magento/Catalog/Api/Data/CategoryAttributeInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Catalog\Api\Data;
88

9+
/**
10+
* @api
11+
*/
912
interface CategoryAttributeInterface extends \Magento\Catalog\Api\Data\EavAttributeInterface
1013
{
1114
const ENTITY_TYPE_CODE = 'catalog_category';

app/code/Magento/Catalog/Api/Data/CategoryAttributeSearchResultsInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Catalog\Api\Data;
88

9+
/**
10+
* @api
11+
*/
912
interface CategoryAttributeSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
1013
{
1114
/**

app/code/Magento/Catalog/Api/Data/CategoryInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace Magento\Catalog\Api\Data;
1010

11+
/**
12+
* @api
13+
*/
1114
interface CategoryInterface extends \Magento\Framework\Api\CustomAttributesDataInterface
1215
{
1316
/**

app/code/Magento/Catalog/Api/Data/CategoryProductLinkInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\Api\ExtensibleDataInterface;
1010

11+
/**
12+
* @api
13+
*/
1114
interface CategoryProductLinkInterface extends ExtensibleDataInterface
1215
{
1316
/**

app/code/Magento/Catalog/Api/Data/CategoryTreeInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Magento\Catalog\Api\Data;
99

10+
/**
11+
* @api
12+
*/
1013
interface CategoryTreeInterface
1114
{
1215
/**

app/code/Magento/Catalog/Api/Data/EavAttributeInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Catalog\Api\Data;
88

9+
/**
10+
* @api
11+
*/
912
interface EavAttributeInterface extends \Magento\Eav\Api\Data\AttributeInterface
1013
{
1114
const IS_WYSIWYG_ENABLED = 'is_wysiwyg_enabled';

app/code/Magento/Catalog/Api/Data/ProductAttributeInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Catalog\Api\Data;
88

9+
/**
10+
* @api
11+
*/
912
interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttributeInterface
1013
{
1114
const ENTITY_TYPE_CODE = 'catalog_product';

app/code/Magento/Catalog/Api/Data/ProductAttributeMediaGalleryEntryInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
use Magento\Framework\Api\ExtensibleDataInterface;
1111

12+
/**
13+
* @api
14+
*/
1215
interface ProductAttributeMediaGalleryEntryInterface extends ExtensibleDataInterface
1316
{
1417
const ID = 'id';

app/code/Magento/Catalog/Api/Data/ProductAttributeSearchResultsInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Catalog\Api\Data;
88

9+
/**
10+
* @api
11+
*/
912
interface ProductAttributeSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
1013
{
1114
/**

0 commit comments

Comments
 (0)