Skip to content

Commit

Permalink
Merge pull request magento#110 from magento-folks/develop
Browse files Browse the repository at this point in the history
[Folks] Sprint 62 Contribution
  • Loading branch information
vpelipenko committed Mar 2, 2015
2 parents c587bcc + 2629ad0 commit f4121a4
Show file tree
Hide file tree
Showing 143 changed files with 1,529 additions and 703 deletions.
10 changes: 6 additions & 4 deletions app/code/Magento/Authorization/Model/Resource/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ class Role extends \Magento\Framework\Model\Resource\Db\AbstractDb
protected $dateTime;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Framework\App\CacheInterface $cache
* @param \Magento\Framework\Stdlib\DateTime $dateTime
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Framework\App\CacheInterface $cache,
\Magento\Framework\Stdlib\DateTime $dateTime
\Magento\Framework\Stdlib\DateTime $dateTime,
$resourcePrefix = null
) {
$this->dateTime = $dateTime;
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
$this->_cache = $cache->getFrontend();
}

Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Authorization/Model/Resource/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,23 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb
protected $_logger;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Framework\Acl\Builder $aclBuilder
* @param \Psr\Log\LoggerInterface $logger
* @param \Magento\Framework\Acl\RootResource $rootResource
* @param \Magento\Framework\Acl\CacheInterface $aclCache
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Framework\Acl\Builder $aclBuilder,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Acl\RootResource $rootResource,
\Magento\Framework\Acl\CacheInterface $aclCache
\Magento\Framework\Acl\CacheInterface $aclCache,
$resourcePrefix = null
) {
$this->_aclBuilder = $aclBuilder;
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
$this->_rootResource = $rootResource;
$this->_aclCache = $aclCache;
$this->_logger = $logger;
Expand Down
26 changes: 19 additions & 7 deletions app/code/Magento/Bundle/Model/Resource/Bundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,25 @@ class Bundle extends \Magento\Framework\Model\Resource\Db\AbstractDb
protected $_productRelation;

/**
* @param \Magento\Framework\App\Resource $resource
* @var \Magento\Quote\Model\Resource\Quote
*/
protected $quoteResource;

/**
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation
* @param \Magento\Quote\Model\Resource\Quote $quoteResource
* @param null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Catalog\Model\Resource\Product\Relation $productRelation
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Catalog\Model\Resource\Product\Relation $productRelation,
\Magento\Quote\Model\Resource\Quote $quoteResource,
$resourcePrefix = null
) {
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
$this->_productRelation = $productRelation;
$this->quoteResource = $quoteResource;
}

/**
Expand Down Expand Up @@ -83,8 +93,10 @@ public function getSelectionsData($productId)
*/
public function dropAllQuoteChildItems($productId)
{
$quoteItemIds = $this->_getReadAdapter()->fetchCol(
$this->_getReadAdapter()->select()->from(
$select = $this->quoteResource->getReadConnection()->select();
$adapter = $select->getAdapter();
$quoteItemIds = $adapter->fetchCol(
$select->from(
$this->getTable('quote_item'),
['item_id']
)->where(
Expand All @@ -94,7 +106,7 @@ public function dropAllQuoteChildItems($productId)
);

if ($quoteItemIds) {
$this->_getWriteAdapter()->delete(
$adapter->delete(
$this->getTable('quote_item'),
['parent_item_id IN(?)' => $quoteItemIds]
);
Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Bundle/Model/Resource/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb
private $validator;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Bundle\Model\Option\Validator $validator
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Bundle\Model\Option\Validator $validator
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Bundle\Model\Option\Validator $validator,
$resourcePrefix = null
) {
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
$this->validator = $validator;
}

Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Captcha/Model/Resource/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb
protected $_remoteAddress;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate
* @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Framework\Stdlib\DateTime\DateTime $coreDate,
\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress
\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress,
$resourcePrefix = null
) {
$this->_coreDate = $coreDate;
$this->_remoteAddress = $remoteAddress;
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
}

/**
Expand Down
26 changes: 3 additions & 23 deletions app/code/Magento/Catalog/Model/Resource/AbstractResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,20 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity
protected $_modelFactory;

/**
* Construct
*
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Eav\Model\Config $eavConfig
* @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
* @param \Magento\Eav\Model\Resource\Helper $resourceHelper
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
* @param \Magento\Eav\Model\Entity\Context $context
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Catalog\Model\Factory $modelFactory
* @param array $data
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Eav\Model\Config $eavConfig,
\Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity,
\Magento\Framework\Locale\FormatInterface $localeFormat,
\Magento\Eav\Model\Resource\Helper $resourceHelper,
\Magento\Framework\Validator\UniversalFactory $universalFactory,
\Magento\Eav\Model\Entity\Context $context,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\Factory $modelFactory,
$data = []
) {
$this->_storeManager = $storeManager;
$this->_modelFactory = $modelFactory;
parent::__construct(
$resource,
$eavConfig,
$attrSetEntity,
$localeFormat,
$resourceHelper,
$universalFactory,
$data
);
parent::__construct($context, $data);
}

/**
Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Catalog/Model/Resource/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,24 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute
protected $attrLockValidator;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Eav\Model\Resource\Entity\Type $eavEntityType
* @param \Magento\Eav\Model\Config $eavConfig
* @param LockValidatorInterface $lockValidator
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Eav\Model\Resource\Entity\Type $eavEntityType,
\Magento\Eav\Model\Config $eavConfig,
LockValidatorInterface $lockValidator
LockValidatorInterface $lockValidator,
$resourcePrefix = null
) {
$this->attrLockValidator = $lockValidator;
$this->_eavConfig = $eavConfig;
parent::__construct($resource, $storeManager, $eavEntityType);
parent::__construct($context, $storeManager, $eavEntityType, $resourcePrefix);
}

/**
Expand Down
29 changes: 5 additions & 24 deletions app/code/Magento/Catalog/Model/Resource/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,16 @@ class Category extends AbstractResource
protected $_categoryTreeFactory;

/**
* Construct
*
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Eav\Model\Config $eavConfig
* @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
* @param \Magento\Eav\Model\Resource\Helper $resourceHelper
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
* @param \Magento\Eav\Model\Entity\Context $context
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Catalog\Model\Factory $modelFactory
* @param \Magento\Framework\Event\ManagerInterface $eventManager
* @param \Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory
* @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory
* @param Category\TreeFactory $categoryTreeFactory
* @param Category\CollectionFactory $categoryCollectionFactory
* @param array $data
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Eav\Model\Config $eavConfig,
\Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity,
\Magento\Framework\Locale\FormatInterface $localeFormat,
\Magento\Eav\Model\Resource\Helper $resourceHelper,
\Magento\Framework\Validator\UniversalFactory $universalFactory,
\Magento\Eav\Model\Entity\Context $context,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\Factory $modelFactory,
\Magento\Framework\Event\ManagerInterface $eventManager,
Expand All @@ -98,12 +84,7 @@ public function __construct(
$data = []
) {
parent::__construct(
$resource,
$eavConfig,
$attrSetEntity,
$localeFormat,
$resourceHelper,
$universalFactory,
$context,
$storeManager,
$modelFactory,
$data
Expand Down
12 changes: 7 additions & 5 deletions app/code/Magento/Catalog/Model/Resource/Category/Flat.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,29 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource
protected $_categoryFactory;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
* @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory
* @param CollectionFactory $categoryCollectionFactory
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Catalog\Model\Config $catalogConfig
* @param \Magento\Framework\Event\ManagerInterface $eventManager
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Catalog\Model\CategoryFactory $categoryFactory,
\Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\Config $catalogConfig,
\Magento\Framework\Event\ManagerInterface $eventManager
\Magento\Framework\Event\ManagerInterface $eventManager,
$resourcePrefix = null
) {
$this->_categoryFactory = $categoryFactory;
$this->_categoryCollectionFactory = $categoryCollectionFactory;
$this->_storeManager = $storeManager;
$this->_catalogConfig = $catalogConfig;
$this->_eventManager = $eventManager;
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
}

/**
Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Catalog/Model/Resource/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ class Config extends \Magento\Framework\Model\Resource\Db\AbstractDb
protected $_storeManager;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Eav\Model\Config $eavConfig
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Eav\Model\Config $eavConfig
\Magento\Eav\Model\Config $eavConfig,
$resourcePrefix = null
) {
$this->_storeManager = $storeManager;
$this->_eavConfig = $eavConfig;
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
}

/**
Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,26 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb
private $storeManager;

/**
* @param \Magento\Framework\App\Resource $resource
* @param \Magento\Framework\Model\Resource\Db\Context $context
* @param \Magento\Framework\Event\ManagerInterface $eventManager
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
* @param \Magento\Customer\Model\Session $session
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param string|null $resourcePrefix
*/
public function __construct(
\Magento\Framework\App\Resource $resource,
\Magento\Framework\Model\Resource\Db\Context $context,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
\Magento\Customer\Model\Session $session,
\Magento\Store\Model\StoreManagerInterface $storeManager
\Magento\Store\Model\StoreManagerInterface $storeManager,
$resourcePrefix = null
) {
$this->layer = $layerResolver->get();
$this->session = $session;
$this->storeManager = $storeManager;
$this->_eventManager = $eventManager;
parent::__construct($resource);
parent::__construct($context, $resourcePrefix);
}

/**
Expand Down
Loading

0 comments on commit f4121a4

Please sign in to comment.