sylius.repository.product OutOfMemoryException
sylius.repository.product OutOfMemoryException
"require": {
"sylius/sylius": "^1.0@beta",
"bitbag/cms-plugin": "^1.2",
"symfony/symfony": "3.3.13",
"egeloen/ckeditor-bundle": "^6.0",
"sensio/generator-bundle": "^3.1"
},
php 版本为:7.2.0
我的 Sylius 商店中只有一种产品
class TestController extends Controller {
public function indexAction($method, $param = array()) {
return $this->$method($param);
}
private function test($param) {
$repository = $this->container->get('sylius.repository.product');
// $products = $repository->findOneByCode('simple_produit');
$products = $repository->findAll(); // Load all the products!
var_dump($products);
$content = $this->renderView('JDFTestBundle::test.html.twig');
return new Response($content);
}
} /*End of class*/
var_dump 显示(摘录):
array(1) { [0]=> object(Sylius\Component\Core\Model\Product)#19560 (21) { ["variantSelectionMethod":protected]=> string(6) "choice" ["productTaxons":protected]=> object(Doctrine\ORM\PersistentCollection)#22238 (9) { ["snapshot":"Doctrine\ORM\PersistentCollection":private]=> [...]
提取图片:
如何在没有 > 1024M 数据的情况下获得所有产品?!我不明白什么是追加。
提前致谢
导致您 运行 内存不足的原因可能是 var_dump 调用。
尝试使用 dump from the VarDumper component 而不是
"require": {
"sylius/sylius": "^1.0@beta",
"bitbag/cms-plugin": "^1.2",
"symfony/symfony": "3.3.13",
"egeloen/ckeditor-bundle": "^6.0",
"sensio/generator-bundle": "^3.1"
},
php 版本为:7.2.0
我的 Sylius 商店中只有一种产品
class TestController extends Controller {
public function indexAction($method, $param = array()) {
return $this->$method($param);
}
private function test($param) {
$repository = $this->container->get('sylius.repository.product');
// $products = $repository->findOneByCode('simple_produit');
$products = $repository->findAll(); // Load all the products!
var_dump($products);
$content = $this->renderView('JDFTestBundle::test.html.twig');
return new Response($content);
}
} /*End of class*/
var_dump 显示(摘录):
array(1) { [0]=> object(Sylius\Component\Core\Model\Product)#19560 (21) { ["variantSelectionMethod":protected]=> string(6) "choice" ["productTaxons":protected]=> object(Doctrine\ORM\PersistentCollection)#22238 (9) { ["snapshot":"Doctrine\ORM\PersistentCollection":private]=> [...]
提取图片:
如何在没有 > 1024M 数据的情况下获得所有产品?!我不明白什么是追加。
提前致谢
导致您 运行 内存不足的原因可能是 var_dump 调用。 尝试使用 dump from the VarDumper component 而不是