Fixed endless recursion of DDC-719 test.
This commit is contained in:
parent
551247d11a
commit
f4d62b317e
@ -77,22 +77,24 @@ 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) {
|
||||||
|
if ( ! $this->children->contains($child)) {
|
||||||
$this->children->add($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) {
|
||||||
|
if ( ! $this->channels->contains($child)) {
|
||||||
$this->channels->add($child);
|
$this->channels->add($child);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getter & setter
|
* getter & setter
|
||||||
|
Loading…
Reference in New Issue
Block a user