Adds cascade=persist to parent, cascade=remove to childrens of scenes

This commit is contained in:
Vassyli
2016-09-05 16:00:15 +02:00
parent f7e34162e8
commit daf374889b
2 changed files with 14 additions and 2 deletions
+2 -2
View File
@@ -30,13 +30,13 @@ class Scene implements CreateableInterface
private $id;
/**
* @ManyToOne(targetEntity="Scene")
* @ManyToOne(targetEntity="Scene", cascade={"persist"})
* @JoinColumn(name="parent", referencedColumnName="id", nullable=true)
*/
private $parent = null;
/**
* @OneToMany(targetEntity="Scene", mappedBy="parent")
* @OneToMany(targetEntity="Scene", mappedBy="parent", cascade={"persist", "remove"})
*/
private $children = [];
+12
View File
@@ -9,6 +9,18 @@ use LotGD\Core\Models\Module as ModuleModel;
*/
interface Module extends EventHandler
{
/**
* Called when an event is published that is handled by this class.
*
* @param Game $g The game.
* @param string $event Name of this event.
* @param array $context Arbitrary dictionary representing context around this event.
* @return array|null Return an array if you want to make changes to the $context before
* the next handler is called. Otherwise, return null. Any changes made will be propogated
* to the event publisher as well.
*/
public static function handleEvent(Game $g, string $event, array &$context);
/**
* Lifecycle method called when this module is initially installed. Use
* this method to perform one-time setup operations like adding tables