Fixed endless recursion of DDC-719 test.
This commit is contained in:
parent
551247d11a
commit
f4d62b317e
@ -77,21 +77,23 @@ class DDC719Group extends Entity {
|
|||||||
* adds group as new child
|
* adds group as new child
|
||||||
*
|
*
|
||||||
* @param Group $child
|
* @param Group $child
|
||||||
* @todo check against endless recursion
|
|
||||||
* @todo check if the group is already member of the group
|
|
||||||
*/
|
*/
|
||||||
public function addGroup(Group $child) {
|
public function addGroup(Group $child) {
|
||||||
$this->children->add($child);
|
if ( ! $this->children->contains($child)) {
|
||||||
|
$this->children->add($child);
|
||||||
|
$child->addGroup($this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* adds channel as new child
|
* adds channel as new child
|
||||||
*
|
*
|
||||||
* @param Channel $child
|
* @param Channel $child
|
||||||
* @todo check if the channel is already member of the group
|
|
||||||
*/
|
*/
|
||||||
public function addChannel(Channel $child) {
|
public function addChannel(Channel $child) {
|
||||||
$this->channels->add($child);
|
if ( ! $this->channels->contains($child)) {
|
||||||
|
$this->channels->add($child);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user