public function addParent(Parents $parent) { $parent->save(); $this->parents[] = $parent; $mapper = DbSingleton::getParentChildrenMapper(); $mapper->addRelation($parent, $this); }
public function addChildren(Children $children) { $children->save(); $this->childrens[] = $children; $mapper = DbSingleton::getParentChildrenMapper(); $mapper->addRelation($this, $children); }