0
下面我有錯誤,同時運行Magento的2:編譯不兼容的參數類型時出錯
PHP斌/ Magento的設置:迪:編譯
Errors during compilation:
Ves\Blog\Model\ResourceModel\Author\Grid\Collection
Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Magento\Store\Model\StoreManagerInterface; File:
app/code/Ves/Blog/Model/ResourceModel/Author/Grid/Collection.php
新村/博客/型號/ ResourceModel /作者/表格/ Collection.php
namespace Ves\Blog\Model\ResourceModel\Author\Grid;
use Magento\Framework\Api\Search\SearchResultInterface;
use Magento\Framework\Search\AggregationInterface;
use Ves\Blog\Model\ResourceModel\Author\Collection as AuthorCollection;
class Collection extends AuthorCollection implements SearchResultInterface
{
protected $aggregations;
public function __construct(
\Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Store\Model\StoreManagerInterface $storeManager,
$mainTable,
$eventPrefix,
$eventObject,
$resourceModel,
$model = 'Magento\Framework\View\Element\UiComponent\DataProvider\Document',
$connection = null,
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
) {
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$storeManager,
$connection,
$resource
);
$this->_eventPrefix = $eventPrefix;
$this->_eventObject = $eventObject;
$this->_init($model, $resourceModel);
$this->setMainTable($mainTable);
}
編輯1: \程序\代碼\新村\博客\型號\ ResourceModel \作者\ Collection.php
<?php
namespace Ves\Blog\Model\ResourceModel\Author;
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
protected function _construct()
{
$this->_init('Ves\Blog\Model\Author', 'Ves\Blog\Model\ResourceModel\Author');
}
}
請讓我知道如何解決這個問題。
與筆者收集更新的問題。 – Palanikumar