本文整理汇总了PHP中Magento\Framework\Model\AbstractModel::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractModel::__construct方法的具体用法?PHP AbstractModel::__construct怎么用?PHP AbstractModel::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Model\AbstractModel
的用法示例。
在下文中一共展示了AbstractModel::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param JobFactory $jobFactory
* @param JobCollection $jobCollection
* @param Context $context
* @param Registry $registry
*/
public function __construct(JobFactory $jobFactory, JobCollection $jobCollection, Context $context, Registry $registry)
{
$this->_init('Springbot\\Queue\\Model\\ResourceModel\\Job');
$this->jobFactory = $jobFactory;
$this->jobCollection = $jobCollection;
parent::__construct($context, $registry);
}
示例2: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Tax\Helper\Data $taxData
* @param \Magento\Framework\Filesystem $filesystem ,
* @param \Magento\Framework\Filter\FilterManager $filterManager
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->filterManager = $filterManager;
$this->_taxData = $taxData;
$this->_rootDirectory = $filesystem->getDirectoryRead(DirectoryList::ROOT);
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例3: __construct
public function __construct(\Ess\M2ePro\Model\Factory $modelFactory, \Ess\M2ePro\Model\ActiveRecord\Factory $activeRecordFactory, \Ess\M2ePro\Helper\Factory $helperFactory, \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->modelFactory = $modelFactory;
$this->activeRecordFactory = $activeRecordFactory;
$this->helperFactory = $helperFactory;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例4: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Catalog\Model\ResourceModel\Product\Link\CollectionFactory $linkCollectionFactory
* @param \Magento\Catalog\Model\ResourceModel\Product\Link\Product\CollectionFactory $productCollectionFactory
* @param \Magento\Catalog\Model\Product\Link\SaveHandler $saveProductLinks
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Catalog\Model\ResourceModel\Product\Link\CollectionFactory $linkCollectionFactory, \Magento\Catalog\Model\ResourceModel\Product\Link\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Product\Link\SaveHandler $saveProductLinks, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->_linkCollectionFactory = $linkCollectionFactory;
$this->_productCollectionFactory = $productCollectionFactory;
$this->saveProductLinks = $saveProductLinks;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例5: __construct
/**
* Automation constructor.
*
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Stdlib\DateTime $dateTime
* @param \Dotdigitalgroup\Email\Helper\Data $helper
* @param \Magento\Store\Model\StoreManagerInterface $storeManagerInterface
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Stdlib\DateTime $dateTime, \Dotdigitalgroup\Email\Helper\Data $helper, \Magento\Store\Model\StoreManagerInterface $storeManagerInterface, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->dateTime = $dateTime;
$this->helper = $helper;
$this->storeManager = $storeManagerInterface;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例6: __construct
/**
* Export constructor.
* @param ProductFactory $productFactory
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param array $data
*/
public function __construct(ProductFactory $productFactory, \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExportFactory $exportFactory, PersonalisedProductsLogger $logger, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->_productFactory = $productFactory;
$this->_exportFactory = $exportFactory;
$this->_logger = $logger;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例7: __construct
/**
* Rules constructor.
*
* @param Adminhtml\Source\Rules\Type $rulesType
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Eav\Model\Config $config
* @param \Magento\Framework\App\ResourceConnection $resourceConnection
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param array $data
*/
public function __construct(\Dotdigitalgroup\Email\Model\Adminhtml\Source\Rules\Type $rulesType, \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Eav\Model\Config $config, \Magento\Framework\App\ResourceConnection $resourceConnection, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->coreResource = $resourceConnection;
$this->config = $config;
$this->rulesType = $rulesType;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例8: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Tax\Model\ClassModel $taxClass
* @param \Magento\Tax\Model\Calculation $calculation
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Tax\Model\ClassModel $taxClass, \Magento\Tax\Model\Calculation $calculation, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = array())
{
$this->_calculation = $calculation;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
$this->_init('Magento\\Tax\\Model\\Resource\\Calculation\\Rule');
$this->_taxClass = $taxClass;
}
示例9: __construct
/**
* Initialize dependencies.
*
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magefan\Blog\Model\PostFactory $postFactory,
* @param \Magefan\Blog\Model\CategoryFactory $categoryFactory,
* @param \Magento\Store\Model\StoreManagerInterface $storeManager,
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magefan\Blog\Model\PostFactory $postFactory, \Magefan\Blog\Model\CategoryFactory $categoryFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->_postFactory = $postFactory;
$this->_categoryFactory = $categoryFactory;
$this->_storeManager = $storeManager;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例10: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength $keyLength
* @param \Magento\Framework\Url\Validator $urlValidator
* @param \Magento\Integration\Helper\Oauth\Data $dataHelper
* @param \Magento\Framework\Model\ModelResource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength $keyLength, \Magento\Framework\Url\Validator $urlValidator, \Magento\Integration\Helper\Oauth\Data $dataHelper, \Magento\Framework\Model\ModelResource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->keyLengthValidator = $keyLength;
$this->urlValidator = $urlValidator;
$this->dataHelper = $dataHelper;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例11: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Locale\ListsInterface $localeLists
* @param Country\FormatFactory $formatFactory
* @param \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Locale\ListsInterface $localeLists, \Magento\Directory\Model\Country\FormatFactory $formatFactory, \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
$this->_localeLists = $localeLists;
$this->_formatFactory = $formatFactory;
$this->_regionCollectionFactory = $regionCollectionFactory;
}
示例12: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Indexer\Model\Resource\Indexer\State $resource
* @param \Magento\Indexer\Model\Resource\Indexer\State\Collection $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Indexer\Model\Resource\Indexer\State $resource, \Magento\Indexer\Model\Resource\Indexer\State\Collection $resourceCollection, array $data = [])
{
if (!isset($data['status'])) {
$data['status'] = self::STATUS_INVALID;
}
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例13: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Catalog\Model\ResourceModel\Product\Link\CollectionFactory $linkCollectionFactory
* @param \Magento\Catalog\Model\ResourceModel\Product\Link\Product\CollectionFactory $productCollectionFactory
* @param \Magento\CatalogInventory\Helper\Stock $stockHelper
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Catalog\Model\ResourceModel\Product\Link\CollectionFactory $linkCollectionFactory, \Magento\Catalog\Model\ResourceModel\Product\Link\Product\CollectionFactory $productCollectionFactory, \Magento\CatalogInventory\Helper\Stock $stockHelper, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->_linkCollectionFactory = $linkCollectionFactory;
$this->_productCollectionFactory = $productCollectionFactory;
$this->stockHelper = $stockHelper;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例14: __construct
/**
* Constructor
*
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Store\Model\StoresConfig $storesConfig
* @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor
* @param \Magento\Tax\Model\ClassModelFactory $classModelFactory
* @param \Magento\Framework\Model\ModelResource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Store\Model\StoresConfig $storesConfig, \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, \Magento\Tax\Model\ClassModelFactory $classModelFactory, \Magento\Framework\Model\ModelResource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->_storesConfig = $storesConfig;
$this->dataObjectProcessor = $dataObjectProcessor;
$this->classModelFactory = $classModelFactory;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
示例15: __construct
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Smart2Pay\GlobalPay\Model\CountryMethodFactory $countryMethodFactory, \Smart2Pay\GlobalPay\Model\CountryFactory $countryFactory, \Smart2Pay\GlobalPay\Model\MethodFactory $methodFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
{
$this->_countryMethodFactory = $countryMethodFactory;
$this->_countryFactory = $countryFactory;
$this->_methodFactory = $methodFactory;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}