當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Collection::__construct方法代碼示例

本文整理匯總了PHP中Magento\Catalog\Model\ResourceModel\Product\Collection::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Collection::__construct方法的具體用法?PHP Collection::__construct怎麽用?PHP Collection::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Catalog\Model\ResourceModel\Product\Collection的用法示例。


在下文中一共展示了Collection::__construct方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
  * @param \Psr\Log\LoggerInterface $logger
  * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
  * @param \Magento\Framework\Event\ManagerInterface $eventManager
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param \Magento\Framework\App\ResourceConnection $resource
  * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory
  * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper
  * @param \Magento\Framework\Validator\UniversalFactory $universalFactory
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Framework\Module\Manager $moduleManager ,
  * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory
  * @param \Magento\Catalog\Model\ResourceModel\Url $catalogUrl
  * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
  * @param \Magento\CatalogSearch\Model\Advanced\Request\Builder $requestBuilder
  * @param \Magento\Search\Model\SearchEngine $searchEngine
  * @param \Magento\Framework\Search\Adapter\Mysql\TemporaryStorageFactory $temporaryStorageFactory
  * @param \Zend_Db_Adapter_Abstract $connection
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\ResourceConnection $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Module\Manager $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\ResourceModel\Url $catalogUrl, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\CatalogSearch\Model\Advanced\Request\Builder $requestBuilder, \Magento\Search\Model\SearchEngine $searchEngine, \Magento\Framework\Search\Adapter\Mysql\TemporaryStorageFactory $temporaryStorageFactory, $connection = null)
 {
     $this->requestBuilder = $requestBuilder;
     $this->searchEngine = $searchEngine;
     $this->temporaryStorageFactory = $temporaryStorageFactory;
     parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $eavConfig, $resource, $eavEntityFactory, $resourceHelper, $universalFactory, $storeManager, $moduleManager, $catalogProductFlatState, $scopeConfig, $productOptionFactory, $catalogUrl, $localeDate, $customerSession, $dateTime, $groupManagement, $connection);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:33,代碼來源:Collection.php

示例2: __construct

 /**
  * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
  * @param \Psr\Log\LoggerInterface $logger
  * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
  * @param \Magento\Framework\Event\ManagerInterface $eventManager
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param \Magento\Framework\App\ResourceConnection $resource
  * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory
  * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper
  * @param \Magento\Framework\Validator\UniversalFactory $universalFactory
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Framework\Module\Manager $moduleManager
  * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory
  * @param \Magento\Catalog\Model\ResourceModel\Url $catalogUrl
  * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
  * @param \Magento\Catalog\Model\ResourceModel\Product $product
  * @param \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory
  * @param \Magento\Catalog\Model\Product\Type $productType
  * @param \Magento\Quote\Model\ResourceModel\Quote\Collection $quoteResource
  * @param mixed $connection
  *
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\ResourceConnection $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Module\Manager $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\ResourceModel\Url $catalogUrl, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\Catalog\Model\ResourceModel\Product $product, \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory, \Magento\Catalog\Model\Product\Type $productType, \Magento\Quote\Model\ResourceModel\Quote\Collection $quoteResource, \Magento\Framework\DB\Adapter\AdapterInterface $connection = null)
 {
     $this->setProductEntityId($product->getEntityIdField());
     $this->setProductEntityTableName($product->getEntityTable());
     $this->setProductAttributeSetId($product->getEntityType()->getDefaultAttributeSetId());
     parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $eavConfig, $resource, $eavEntityFactory, $resourceHelper, $universalFactory, $storeManager, $moduleManager, $catalogProductFlatState, $scopeConfig, $productOptionFactory, $catalogUrl, $localeDate, $customerSession, $dateTime, $groupManagement, $connection);
     $this->_eventTypeFactory = $eventTypeFactory;
     $this->_productType = $productType;
     $this->quoteResource = $quoteResource;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:38,代碼來源:Collection.php

示例3: __construct

 /**
  * Collection constructor.
  * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
  * @param \Psr\Log\LoggerInterface $logger
  * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
  * @param \Magento\Framework\Event\ManagerInterface $eventManager
  * @param \Magento\Eav\Model\Config $eavConfig
  * @param \Magento\Framework\App\ResourceConnection $resource
  * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory
  * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper
  * @param \Magento\Framework\Validator\UniversalFactory $universalFactory
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Framework\Module\Manager $moduleManager
  * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory
  * @param \Magento\Catalog\Model\ResourceModel\Url $catalogUrl
  * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
  * @param \Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitation $productLimitation
  * @param \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem
  * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare
  * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
  *
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\ResourceConnection $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Module\Manager $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Catalog\Model\ResourceModel\Url $catalogUrl, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitation $productLimitation, \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem, \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, \Magento\Framework\DB\Adapter\AdapterInterface $connection = null)
 {
     $this->_catalogProductCompareItem = $catalogProductCompareItem;
     $this->_catalogProductCompare = $catalogProductCompare;
     parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $eavConfig, $resource, $eavEntityFactory, $resourceHelper, $universalFactory, $storeManager, $moduleManager, $catalogProductFlatState, $scopeConfig, $productOptionFactory, $catalogUrl, $localeDate, $customerSession, $dateTime, $groupManagement, $productLimitation, $connection);
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:34,代碼來源:Collection.php


注:本文中的Magento\Catalog\Model\ResourceModel\Product\Collection::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。