commit 84d67b868ec0c18579e205b4cf7949a47c4fb890
parent 8d06f3f79510aa5c6ca7893ec229598163c17340
Author: Felicitus <felicitus@felicitus.org>
Date: Wed, 7 Oct 2015 17:18:45 +0200
Initialize category children with empty ArrayCollection
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/PartKeepr/CategoryBundle/Entity/AbstractCategory.php b/src/PartKeepr/CategoryBundle/Entity/AbstractCategory.php
@@ -1,6 +1,7 @@
<?php
namespace PartKeepr\CategoryBundle\Entity;
+use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use PartKeepr\Util\BaseEntity;
@@ -79,6 +80,10 @@ abstract class AbstractCategory extends BaseEntity
*/
public $expanded = true;
+ public function __construct () {
+ $this->children = new ArrayCollection();
+ }
+
/**
* Sets the name of this category
*