Adds cascade=persist to parent, cascade=remove to childrens of scenes
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user