1
0
mirror of synced 2024-12-14 15:16:04 +03:00

Fixed endless recursion of DDC-719 test.

This commit is contained in:
Guilherme Blanco 2011-05-14 00:49:46 -03:00
parent 551247d11a
commit f4d62b317e

View File

@ -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);
}
} }
/** /**