Skip to content

Commit

Permalink
Merge branch 'develop' into MAGETWO-31478
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Logvin committed Feb 10, 2015
2 parents 7a37456 + fd9337c commit c43555d
Show file tree
Hide file tree
Showing 240 changed files with 6,273 additions and 2,603 deletions.
8 changes: 4 additions & 4 deletions app/code/Magento/Bundle/Model/Source/Option/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Magento\Bundle\Model\Source\Option;

use Magento\Framework\Api\AttributeDataBuilder;
use Magento\Framework\Api\AttributeValueFactory;
use Magento\Framework\Api\MetadataServiceInterface;

class Type extends \Magento\Framework\Model\AbstractExtensibleModel implements
Expand All @@ -24,7 +24,7 @@ class Type extends \Magento\Framework\Model\AbstractExtensibleModel implements
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param MetadataServiceInterface $metadataService
* @param AttributeDataBuilder $customAttributeBuilder
* @param AttributeValueFactory $customAttributeFactory
* @param array $options
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
Expand All @@ -34,7 +34,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
MetadataServiceInterface $metadataService,
AttributeDataBuilder $customAttributeBuilder,
AttributeValueFactory $customAttributeFactory,
array $options,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
Expand All @@ -45,7 +45,7 @@ public function __construct(
$context,
$registry,
$metadataService,
$customAttributeBuilder,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ProductAttributeDataBuilder extends \Magento\Framework\Api\Builder
/**
* @param ObjectFactory $objectFactory
* @param MetadataServiceInterface $metadataService
* @param \Magento\Framework\Api\AttributeDataBuilder $attributeValueBuilder
* @param \Magento\Framework\Api\AttributeValueFactory $attributeValueFactory
* @param \Magento\Framework\Reflection\DataObjectProcessor $objectProcessor
* @param \Magento\Framework\Reflection\TypeProcessor $typeProcessor
* @param \Magento\Framework\Serialization\DataBuilderFactory $dataBuilderFactory
Expand All @@ -29,7 +29,7 @@ class ProductAttributeDataBuilder extends \Magento\Framework\Api\Builder
public function __construct(
ObjectFactory $objectFactory,
MetadataServiceInterface $metadataService,
\Magento\Framework\Api\AttributeDataBuilder $attributeValueBuilder,
\Magento\Framework\Api\AttributeValueFactory $attributeValueFactory,
\Magento\Framework\Reflection\DataObjectProcessor $objectProcessor,
\Magento\Framework\Reflection\TypeProcessor $typeProcessor,
\Magento\Framework\Serialization\DataBuilderFactory $dataBuilderFactory,
Expand All @@ -39,7 +39,7 @@ public function __construct(
parent::__construct(
$objectFactory,
$metadataService,
$attributeValueBuilder,
$attributeValueFactory,
$objectProcessor,
$typeProcessor,
$dataBuilderFactory,
Expand Down
72 changes: 37 additions & 35 deletions app/code/Magento/Catalog/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
protected $_templateFilterFactory;

/**
* Tax class key builder
* Tax class key factory
*
* @var \Magento\Tax\Api\Data\TaxClassKeyDataBuilder
* @var \Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory
*/
protected $_taxClassKeyBuilder;
protected $_taxClassKeyFactory;

/**
* Tax helper
Expand All @@ -124,18 +124,18 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
protected $_taxConfig;

/**
* Quote details builder
* Quote details factory
*
* @var \Magento\Tax\Api\Data\QuoteDetailsDataBuilder
* @var \Magento\Tax\Api\Data\QuoteDetailsInterfaceFactory
*/
protected $_quoteDetailsBuilder;
protected $_quoteDetailsFactory;

/**
* Quote details item builder
* Quote details item factory
*
* @var \Magento\Tax\Api\Data\QuoteDetailsItemDataBuilder
* @var \Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory
*/
protected $_quoteDetailsItemBuilder;
protected $_quoteDetailsItemFactory;

/**
* @var CustomerSession
Expand Down Expand Up @@ -177,10 +177,10 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory
* @param string $templateFilterModel
* @param \Magento\Tax\Api\Data\TaxClassKeyDataBuilder $taxClassKeyBuilder
* @param \Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory $taxClassKeyFactory
* @param Config $taxConfig
* @param \Magento\Tax\Api\Data\QuoteDetailsDataBuilder $quoteDetailsBuilder
* @param \Magento\Tax\Api\Data\QuoteDetailsItemDataBuilder $quoteDetailsItemBuilder
* @param \Magento\Tax\Api\Data\QuoteDetailsInterfaceFactory $quoteDetailsFactory
* @param \Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory $quoteDetailsItemFactory
* @param \Magento\Tax\Api\TaxCalculationInterface $taxCalculationService
* @param CustomerSession $customerSession
* @param PriceCurrencyInterface $priceCurrency
Expand All @@ -199,10 +199,10 @@ public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory,
$templateFilterModel,
\Magento\Tax\Api\Data\TaxClassKeyDataBuilder $taxClassKeyBuilder,
\Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory $taxClassKeyFactory,
\Magento\Tax\Model\Config $taxConfig,
\Magento\Tax\Api\Data\QuoteDetailsDataBuilder $quoteDetailsBuilder,
\Magento\Tax\Api\Data\QuoteDetailsItemDataBuilder $quoteDetailsItemBuilder,
\Magento\Tax\Api\Data\QuoteDetailsInterfaceFactory $quoteDetailsFactory,
\Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory $quoteDetailsItemFactory,
\Magento\Tax\Api\TaxCalculationInterface $taxCalculationService,
CustomerSession $customerSession,
PriceCurrencyInterface $priceCurrency,
Expand All @@ -218,10 +218,10 @@ public function __construct(
$this->_scopeConfig = $scopeConfig;
$this->_coreRegistry = $coreRegistry;
$this->_templateFilterModel = $templateFilterModel;
$this->_taxClassKeyBuilder = $taxClassKeyBuilder;
$this->_taxClassKeyFactory = $taxClassKeyFactory;
$this->_taxConfig = $taxConfig;
$this->_quoteDetailsBuilder = $quoteDetailsBuilder;
$this->_quoteDetailsItemBuilder = $quoteDetailsItemBuilder;
$this->_quoteDetailsFactory = $quoteDetailsFactory;
$this->_quoteDetailsItemFactory = $quoteDetailsItemFactory;
$this->_taxCalculationService = $taxCalculationService;
$this->_customerSession = $customerSession;
$this->priceCurrency = $priceCurrency;
Expand Down Expand Up @@ -501,27 +501,29 @@ public function getTaxPrice(
$billingAddressDataObject = $billingAddress->getDataModel();
}

$item = $this->_quoteDetailsItemBuilder->setQuantity(1)
$taxClassKey = $this->_taxClassKeyFactory->create();
$taxClassKey->setType(TaxClassKeyInterface::TYPE_ID)
->setValue($product->getTaxClassId());

$customerTaxClassKey = $this->_taxClassKeyFactory->create();
$customerTaxClassKey->setType(TaxClassKeyInterface::TYPE_ID)
->setValue($ctc);

$item = $this->_quoteDetailsItemFactory->create();
$item->setQuantity(1)
->setCode($product->getSku())
->setShortDescription($product->getShortDescription())
->setTaxClassKey(
$this->_taxClassKeyBuilder->setType(TaxClassKeyInterface::TYPE_ID)
->setValue($product->getTaxClassId())
->create()
)->setTaxIncluded($priceIncludesTax)
->setTaxClassKey($taxClassKey)
->setIsTaxIncluded($priceIncludesTax)
->setType('product')
->setUnitPrice($price)
->create();
$quoteDetails = $this->_quoteDetailsBuilder
->setShippingAddress($shippingAddressDataObject)
->setUnitPrice($price);

$quoteDetails = $this->_quoteDetailsFactory->create();
$quoteDetails->setShippingAddress($shippingAddressDataObject)
->setBillingAddress($billingAddressDataObject)
->setCustomerTaxClassKey(
$this->_taxClassKeyBuilder->setType(TaxClassKeyInterface::TYPE_ID)
->setValue($ctc)
->create()
)->setItems([$item])
->setCustomerId($this->_customerSession->getCustomerId())
->create();
->setCustomerTaxClassKey($customerTaxClassKey)
->setItems([$item])
->setCustomerId($this->_customerSession->getCustomerId());

$storeId = null;
if ($store) {
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
namespace Magento\Catalog\Model;

use Magento\Framework\Api\AttributeDataBuilder;
use Magento\Framework\Api\AttributeValueFactory;

/**
* Abstract model for catalog entities
Expand Down Expand Up @@ -63,7 +63,7 @@ abstract class AbstractModel extends \Magento\Framework\Model\AbstractExtensible
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Api\MetadataServiceInterface $metadataService
* @param AttributeDataBuilder $customAttributeBuilder
* @param AttributeValueFactory $customAttributeFactory
* @param \Magento\Framework\Store\StoreManagerInterface $storeManager
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
Expand All @@ -73,7 +73,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Api\MetadataServiceInterface $metadataService,
AttributeDataBuilder $customAttributeBuilder,
AttributeValueFactory $customAttributeFactory,
\Magento\Framework\Store\StoreManagerInterface $storeManager,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
Expand All @@ -84,7 +84,7 @@ public function __construct(
$context,
$registry,
$metadataService,
$customAttributeBuilder,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
use Magento\Framework\Api\AttributeDataBuilder;
use Magento\Framework\Api\AttributeValueFactory;
use Magento\Framework\Convert\ConvertArray;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Profiler;
Expand Down Expand Up @@ -177,7 +177,7 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Catalog\Api\CategoryAttributeRepositoryInterface $metadataService
* @param AttributeDataBuilder $customAttributeBuilder
* @param AttributeValueFactory $customAttributeFactory
* @param \Magento\Framework\Store\StoreManagerInterface $storeManager
* @param Resource\Category\Tree $categoryTreeResource
* @param Resource\Category\TreeFactory $categoryTreeFactory
Expand All @@ -200,7 +200,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Catalog\Api\CategoryAttributeRepositoryInterface $metadataService,
AttributeDataBuilder $customAttributeBuilder,
AttributeValueFactory $customAttributeFactory,
\Magento\Framework\Store\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\Resource\Category\Tree $categoryTreeResource,
\Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory,
Expand Down Expand Up @@ -234,7 +234,7 @@ public function __construct(
$context,
$registry,
$metadataService,
$customAttributeBuilder,
$customAttributeFactory,
$storeManager,
$resource,
$resourceCollection,
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/Entity/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Magento\Catalog\Model\Entity;

use Magento\Catalog\Model\Attribute\LockValidatorInterface;
use Magento\Framework\Api\AttributeDataBuilder;
use Magento\Framework\Api\AttributeValueFactory;

/**
* Product attribute extension with event dispatching
Expand Down Expand Up @@ -72,7 +72,7 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Api\MetadataServiceInterface $metadataService
* @param AttributeDataBuilder $customAttributeBuilder
* @param AttributeValueFactory $customAttributeFactory
* @param \Magento\Core\Helper\Data $coreData
* @param \Magento\Eav\Model\Config $eavConfig
* @param \Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory
Expand All @@ -93,7 +93,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Api\MetadataServiceInterface $metadataService,
AttributeDataBuilder $customAttributeBuilder,
AttributeValueFactory $customAttributeFactory,
\Magento\Core\Helper\Data $coreData,
\Magento\Eav\Model\Config $eavConfig,
\Magento\Eav\Model\Entity\TypeFactory $eavTypeFactory,
Expand All @@ -114,7 +114,7 @@ public function __construct(
$context,
$registry,
$metadataService,
$customAttributeBuilder,
$customAttributeFactory,
$coreData,
$eavConfig,
$eavTypeFactory,
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Framework\Api\AttributeDataBuilder;
use Magento\Framework\Api\AttributeValueFactory;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Object\IdentityInterface;
use Magento\Framework\Pricing\Object\SaleableInterface;
Expand Down Expand Up @@ -242,7 +242,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $metadataService
* @param AttributeDataBuilder $customAttributeBuilder
* @param AttributeValueFactory $customAttributeFactory
* @param \Magento\Framework\Store\StoreManagerInterface $storeManager
* @param Product\Url $url
* @param Product\Link $productLink
Expand Down Expand Up @@ -273,7 +273,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Catalog\Api\ProductAttributeRepositoryInterface $metadataService,
AttributeDataBuilder $customAttributeBuilder,
AttributeValueFactory $customAttributeFactory,
\Magento\Framework\Store\StoreManagerInterface $storeManager,
Product\Url $url,
Product\Link $productLink,
Expand Down Expand Up @@ -321,7 +321,7 @@ public function __construct(
$context,
$registry,
$metadataService,
$customAttributeBuilder,
$customAttributeFactory,
$storeManager,
$resource,
$resourceCollection,
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/Product/Attribute/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
namespace Magento\Catalog\Model\Product\Attribute;

use Magento\Framework\Api\AttributeDataBuilder;
use Magento\Framework\Api\AttributeValueFactory;

class Group extends \Magento\Eav\Model\Entity\Attribute\Group
{
Expand All @@ -21,7 +21,7 @@ class Group extends \Magento\Eav\Model\Entity\Attribute\Group
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Api\MetadataServiceInterface $metadataService
* @param AttributeDataBuilder $customAttributeBuilder
* @param AttributeValueFactory $customAttributeFactory
* @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
Expand All @@ -31,7 +31,7 @@ public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Api\MetadataServiceInterface $metadataService,
AttributeDataBuilder $customAttributeBuilder,
AttributeValueFactory $customAttributeFactory,
\Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
Expand All @@ -42,7 +42,7 @@ public function __construct(
$context,
$registry,
$metadataService,
$customAttributeBuilder,
$customAttributeFactory,
$resource,
$resourceCollection,
$data
Expand Down
Loading

0 comments on commit c43555d

Please sign in to comment.