Skip to content

Commit

Permalink
Merge pull request #305 from magento-goinc/MAGETWO-35590
Browse files Browse the repository at this point in the history
[GoInc] Private content rendering + Bugs + Define Public Api
  • Loading branch information
monkeysee committed May 16, 2015
2 parents 17728c9 + 482e2bf commit 36b3a69
Show file tree
Hide file tree
Showing 332 changed files with 4,492 additions and 3,494 deletions.
55 changes: 1 addition & 54 deletions app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
*/
class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer
{
/**
* @var Configuration
*/
protected $_configurationHelper = null;

/**
* Bundle catalog product configuration
*
Expand Down Expand Up @@ -67,54 +62,6 @@ public function __construct(
$this->_isScopePrivate = true;
}

/**
* @return void
*/
protected function _construct()
{
parent::_construct();
$this->_configurationHelper = $this->_bundleProductConfiguration;
}

/**
* Get bundled selections (slections-products collection)
*
* Returns array of options objects.
* Each option object will contain array of selections objects
*
* @param bool $useCache
* @return array
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getBundleOptions($useCache = true)
{
return $this->_configurationHelper->getBundleOptions($this->getItem());
}

/**
* Obtain final price of selection in a bundle product
*
* @param \Magento\Catalog\Model\Product $selectionProduct
* @return float
*/
protected function _getSelectionFinalPrice($selectionProduct)
{
$helper = $this->_bundleProductConfiguration;
$result = $helper->getSelectionFinalPrice($this->getItem(), $selectionProduct);
return $result;
}

/**
* Get selection quantity
*
* @param int $selectionId
* @return float
*/
protected function _getSelectionQty($selectionId)
{
return $this->_configurationHelper->getSelectionQty($this->getProduct(), $selectionId);
}

/**
* Overloaded method for getting list of bundle options
* Caches result in quote item, because it can be used in cart 'recent view' and on same page in cart checkout
Expand All @@ -123,7 +70,7 @@ protected function _getSelectionQty($selectionId)
*/
public function getOptionList()
{
return $this->_configurationHelper->getOptions($this->getItem());
return $this->_bundleProductConfiguration->getOptions($this->getItem());
}

/**
Expand Down
47 changes: 47 additions & 0 deletions app/code/Magento/Bundle/CustomerData/BundleItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Bundle\CustomerData;

/**
* Bundle item renderer
*/
class BundleItem extends \Magento\Checkout\CustomerData\DefaultItem
{
/**
* Gift card catalog product configuration
*
* @var \Magento\Bundle\Helper\Catalog\Product\Configuration
*/
protected $bundleConfiguration;

/**
* @param \Magento\Catalog\Model\Product\Image\View $productImageView
* @param \Magento\Msrp\Helper\Data $msrpHelper
* @param \Magento\Framework\UrlInterface $urlBuilder
* @param \Magento\Catalog\Helper\Product\Configuration $configurationHelper
* @param \Magento\Checkout\Helper\Data $checkoutHelper
* @param \Magento\Bundle\Helper\Catalog\Product\Configuration $bundleConfiguration
*/
public function __construct(
\Magento\Catalog\Model\Product\Image\View $productImageView,
\Magento\Msrp\Helper\Data $msrpHelper,
\Magento\Framework\UrlInterface $urlBuilder,
\Magento\Catalog\Helper\Product\Configuration $configurationHelper,
\Magento\Checkout\Helper\Data $checkoutHelper,
\Magento\Bundle\Helper\Catalog\Product\Configuration $bundleConfiguration
) {
parent::__construct($productImageView, $msrpHelper, $urlBuilder, $configurationHelper, $checkoutHelper);
$this->bundleConfiguration = $bundleConfiguration;
}

/**
* {@inheritdoc}
*/
protected function getOptionList()
{
return $this->bundleConfiguration->getOptions($this->item);
}
}
1 change: 1 addition & 0 deletions app/code/Magento/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"magento/framework": "0.74.0-beta8",
"magento/module-quote": "0.74.0-beta8",
"magento/module-media-storage": "0.74.0-beta8",
"magento/module-msrp": "0.74.0-beta8",
"magento/magento-composer-installer": "*"
},
"suggest": {
Expand Down
7 changes: 7 additions & 0 deletions app/code/Magento/Bundle/etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@
</argument>
</arguments>
</type>
<type name="Magento\Checkout\CustomerData\ItemPoolInterface">
<arguments>
<argument name="itemMap" xsi:type="array">
<item name="bundle" xsi:type="string">Magento\Bundle\CustomerData\BundleItem</item>
</argument>
</arguments>
</type>
</config>

This file was deleted.

14 changes: 13 additions & 1 deletion app/code/Magento/CacheInvalidate/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\CacheInvalidate\Model;

use Magento\Framework\Cache\InvalidateLogger;

/**
* Class Observer
*/
Expand All @@ -27,21 +29,29 @@ class Observer
*/
protected $_curlAdapter;

/**
* @var InvalidateLogger
*/
private $logger;

/**
* Constructor
*
* @param \Magento\PageCache\Model\Config $config
* @param \Magento\PageCache\Helper\Data $helper
* @param \Magento\Framework\HTTP\Adapter\Curl $curlAdapter
* @param InvalidateLogger $logger
*/
public function __construct(
\Magento\PageCache\Model\Config $config,
\Magento\PageCache\Helper\Data $helper,
\Magento\Framework\HTTP\Adapter\Curl $curlAdapter
\Magento\Framework\HTTP\Adapter\Curl $curlAdapter,
InvalidateLogger $logger
) {
$this->_config = $config;
$this->_helper = $helper;
$this->_curlAdapter = $curlAdapter;
$this->logger = $logger;
}

/**
Expand Down Expand Up @@ -95,5 +105,7 @@ protected function sendPurgeRequest($tagsPattern)
$this->_curlAdapter->write('', $this->_helper->getUrl('*'), '1.1', $headers);
$this->_curlAdapter->read();
$this->_curlAdapter->close();

$this->logger->execute(compact('tagsPattern'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class ObserverTest extends \PHPUnit_Framework_TestCase
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\PageCache\Helper\Data */
protected $_helperMock;

/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $logger;

/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Object\ */
protected $_observerObject;

Expand All @@ -45,10 +48,12 @@ public function setUp()
'',
false
);
$this->logger = $this->getMock('Magento\Framework\Cache\InvalidateLogger', [], [], '', false);
$this->_model = new \Magento\CacheInvalidate\Model\Observer(
$this->_configMock,
$this->_helperMock,
$this->_curlMock
$this->_curlMock,
$this->logger
);
$this->_observerMock = $this->getMock(
'Magento\Framework\Event\Observer',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Catalog\Api;

/**
* @api
*/
interface AttributeSetManagementInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Catalog\Api;

/**
* @api
*/
interface AttributeSetRepositoryInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* Interface RepositoryInterface must be implemented in new model
* @api
*/
interface CategoryAttributeOptionManagementInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* Interface RepositoryInterface must be implemented in new model
* @api
*/
interface CategoryAttributeRepositoryInterface extends \Magento\Framework\Api\MetadataServiceInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace Magento\Catalog\Api;

/**
* @api
*/
interface CategoryLinkManagementInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace Magento\Catalog\Api;

/**
* @api
*/
interface CategoryLinkRepositoryInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Api/CategoryManagementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

namespace Magento\Catalog\Api;

/**
* @api
*/
interface CategoryManagementInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Api/CategoryRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

namespace Magento\Catalog\Api;

/**
* @api
*/
interface CategoryRepositoryInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Catalog\Api\Data;

/**
* @api
*/
interface CategoryAttributeInterface extends \Magento\Catalog\Api\Data\EavAttributeInterface
{
const ENTITY_TYPE_CODE = 'catalog_category';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Catalog\Api\Data;

/**
* @api
*/
interface CategoryAttributeSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Api/Data/CategoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

namespace Magento\Catalog\Api\Data;

/**
* @api
*/
interface CategoryInterface extends \Magento\Framework\Api\CustomAttributesDataInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

use Magento\Framework\Api\ExtensibleDataInterface;

/**
* @api
*/
interface CategoryProductLinkInterface extends ExtensibleDataInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Api/Data/CategoryTreeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

namespace Magento\Catalog\Api\Data;

/**
* @api
*/
interface CategoryTreeInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Api/Data/EavAttributeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Catalog\Api\Data;

/**
* @api
*/
interface EavAttributeInterface extends \Magento\Eav\Api\Data\AttributeInterface
{
const IS_WYSIWYG_ENABLED = 'is_wysiwyg_enabled';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Catalog\Api\Data;

/**
* @api
*/
interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttributeInterface
{
const ENTITY_TYPE_CODE = 'catalog_product';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

use Magento\Framework\Api\ExtensibleDataInterface;

/**
* @api
*/
interface ProductAttributeMediaGalleryEntryInterface extends ExtensibleDataInterface
{
const ID = 'id';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Magento\Catalog\Api\Data;

/**
* @api
*/
interface ProductAttributeSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
{
/**
Expand Down
Loading

0 comments on commit 36b3a69

Please sign in to comment.