Magento 2.2.5: _init() return error “ Allowed memory size of 792723456 bytes exhausted”
I'm doing "Banner Slider", and I'm following module-catalog/category.
So when i trying to copy this file:
C:xampphtdocsmagentovendormagentomodule-catalogModelResourceModelProductCollection.php
I found that class was extends this class MagentoEavModelEntityCollectionAbstractCollection
.
I know we should extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
.
But when i try to follow them, it throw an error of memory when i using the init()
function like this:
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelSlideCollection.php
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 13/07/2018
* Time: 3:31 CH
*/
namespace AhtBannerSliderModelResourceModelSlide;
// extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection MagentoEavModelEntityCollectionAbstractCollection
class Collection extends AhtBannerSliderModelResourceModelCollectionAbstractCollection
{
protected $_idFieldName = 'id';
/**
* Define resource model
*
* @return void
*/
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
public function addAttributeToSelect($attribute, $joinType = false)
{
return parent::addAttributeToSelect($attribute, $joinType);
}
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelCollectionAbstractCollection.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace AhtBannerSliderModelResourceModelCollection;
/**
* Catalog EAV collection resource abstract model
* Implement using different stores for retrieve attribute values
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @since 100.0.2
*/
class AbstractCollection extends MagentoEavModelEntityCollectionAbstractCollection
{
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoEavModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
) {
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$connection
);
}
}
magento2 extend memory
add a comment |
I'm doing "Banner Slider", and I'm following module-catalog/category.
So when i trying to copy this file:
C:xampphtdocsmagentovendormagentomodule-catalogModelResourceModelProductCollection.php
I found that class was extends this class MagentoEavModelEntityCollectionAbstractCollection
.
I know we should extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
.
But when i try to follow them, it throw an error of memory when i using the init()
function like this:
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelSlideCollection.php
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 13/07/2018
* Time: 3:31 CH
*/
namespace AhtBannerSliderModelResourceModelSlide;
// extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection MagentoEavModelEntityCollectionAbstractCollection
class Collection extends AhtBannerSliderModelResourceModelCollectionAbstractCollection
{
protected $_idFieldName = 'id';
/**
* Define resource model
*
* @return void
*/
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
public function addAttributeToSelect($attribute, $joinType = false)
{
return parent::addAttributeToSelect($attribute, $joinType);
}
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelCollectionAbstractCollection.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace AhtBannerSliderModelResourceModelCollection;
/**
* Catalog EAV collection resource abstract model
* Implement using different stores for retrieve attribute values
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @since 100.0.2
*/
class AbstractCollection extends MagentoEavModelEntityCollectionAbstractCollection
{
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoEavModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
) {
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$connection
);
}
}
magento2 extend memory
WHy you don't useMagentoFrameworkModelResourceModelDbCollectionAbstractCollection
?
– Amit Bera♦
Aug 3 '18 at 8:09
because theMagentoFrameworkModelResourceModelDbCollectionAbstractCollection
dont have addAttributeToSelect() function. I need it in the copy of fileC:xampphtdocsmagentovendormagentomodule-catalogBlockAdminhtmlCategoryTabProduct.php
– fudu
Aug 3 '18 at 8:16
I've create a same file as "Product.php" and named it "Slide.php" for the same content.
– fudu
Aug 3 '18 at 8:17
add a comment |
I'm doing "Banner Slider", and I'm following module-catalog/category.
So when i trying to copy this file:
C:xampphtdocsmagentovendormagentomodule-catalogModelResourceModelProductCollection.php
I found that class was extends this class MagentoEavModelEntityCollectionAbstractCollection
.
I know we should extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
.
But when i try to follow them, it throw an error of memory when i using the init()
function like this:
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelSlideCollection.php
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 13/07/2018
* Time: 3:31 CH
*/
namespace AhtBannerSliderModelResourceModelSlide;
// extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection MagentoEavModelEntityCollectionAbstractCollection
class Collection extends AhtBannerSliderModelResourceModelCollectionAbstractCollection
{
protected $_idFieldName = 'id';
/**
* Define resource model
*
* @return void
*/
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
public function addAttributeToSelect($attribute, $joinType = false)
{
return parent::addAttributeToSelect($attribute, $joinType);
}
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelCollectionAbstractCollection.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace AhtBannerSliderModelResourceModelCollection;
/**
* Catalog EAV collection resource abstract model
* Implement using different stores for retrieve attribute values
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @since 100.0.2
*/
class AbstractCollection extends MagentoEavModelEntityCollectionAbstractCollection
{
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoEavModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
) {
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$connection
);
}
}
magento2 extend memory
I'm doing "Banner Slider", and I'm following module-catalog/category.
So when i trying to copy this file:
C:xampphtdocsmagentovendormagentomodule-catalogModelResourceModelProductCollection.php
I found that class was extends this class MagentoEavModelEntityCollectionAbstractCollection
.
I know we should extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
.
But when i try to follow them, it throw an error of memory when i using the init()
function like this:
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelSlideCollection.php
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 13/07/2018
* Time: 3:31 CH
*/
namespace AhtBannerSliderModelResourceModelSlide;
// extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection MagentoEavModelEntityCollectionAbstractCollection
class Collection extends AhtBannerSliderModelResourceModelCollectionAbstractCollection
{
protected $_idFieldName = 'id';
/**
* Define resource model
*
* @return void
*/
protected function _construct()
{
$this->_init(AhtBannerSliderModelSlide::class, AhtBannerSliderModelResourceModelSlide::class);
}
public function addAttributeToSelect($attribute, $joinType = false)
{
return parent::addAttributeToSelect($attribute, $joinType);
}
}
Here is my
C:xampphtdocsmagentoappcodeAhtBannerSliderModelResourceModelCollectionAbstractCollection.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace AhtBannerSliderModelResourceModelCollection;
/**
* Catalog EAV collection resource abstract model
* Implement using different stores for retrieve attribute values
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @since 100.0.2
*/
class AbstractCollection extends MagentoEavModelEntityCollectionAbstractCollection
{
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoEavModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
) {
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$connection
);
}
}
magento2 extend memory
magento2 extend memory
edited 15 mins ago
Teja Bhagavan Kollepara
2,94841847
2,94841847
asked Aug 3 '18 at 7:36
fudufudu
38411
38411
WHy you don't useMagentoFrameworkModelResourceModelDbCollectionAbstractCollection
?
– Amit Bera♦
Aug 3 '18 at 8:09
because theMagentoFrameworkModelResourceModelDbCollectionAbstractCollection
dont have addAttributeToSelect() function. I need it in the copy of fileC:xampphtdocsmagentovendormagentomodule-catalogBlockAdminhtmlCategoryTabProduct.php
– fudu
Aug 3 '18 at 8:16
I've create a same file as "Product.php" and named it "Slide.php" for the same content.
– fudu
Aug 3 '18 at 8:17
add a comment |
WHy you don't useMagentoFrameworkModelResourceModelDbCollectionAbstractCollection
?
– Amit Bera♦
Aug 3 '18 at 8:09
because theMagentoFrameworkModelResourceModelDbCollectionAbstractCollection
dont have addAttributeToSelect() function. I need it in the copy of fileC:xampphtdocsmagentovendormagentomodule-catalogBlockAdminhtmlCategoryTabProduct.php
– fudu
Aug 3 '18 at 8:16
I've create a same file as "Product.php" and named it "Slide.php" for the same content.
– fudu
Aug 3 '18 at 8:17
WHy you don't use
MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
?– Amit Bera♦
Aug 3 '18 at 8:09
WHy you don't use
MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
?– Amit Bera♦
Aug 3 '18 at 8:09
because the
MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
dont have addAttributeToSelect() function. I need it in the copy of file C:xampphtdocsmagentovendormagentomodule-catalogBlockAdminhtmlCategoryTabProduct.php
– fudu
Aug 3 '18 at 8:16
because the
MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
dont have addAttributeToSelect() function. I need it in the copy of file C:xampphtdocsmagentovendormagentomodule-catalogBlockAdminhtmlCategoryTabProduct.php
– fudu
Aug 3 '18 at 8:16
I've create a same file as "Product.php" and named it "Slide.php" for the same content.
– fudu
Aug 3 '18 at 8:17
I've create a same file as "Product.php" and named it "Slide.php" for the same content.
– fudu
Aug 3 '18 at 8:17
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f237049%2fmagento-2-2-5-init-return-error-allowed-memory-size-of-792723456-bytes-exh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f237049%2fmagento-2-2-5-init-return-error-allowed-memory-size-of-792723456-bytes-exh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
WHy you don't use
MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
?– Amit Bera♦
Aug 3 '18 at 8:09
because the
MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
dont have addAttributeToSelect() function. I need it in the copy of fileC:xampphtdocsmagentovendormagentomodule-catalogBlockAdminhtmlCategoryTabProduct.php
– fudu
Aug 3 '18 at 8:16
I've create a same file as "Product.php" and named it "Slide.php" for the same content.
– fudu
Aug 3 '18 at 8:17