/** * Inserts the given $child node as first child of current * The modifications in the current object and the tree * are not persisted until the child object is saved. * * @param Page $child Propel object for child node * * @return Page The current Propel object */ public function addChild(Page $child) { if ($this->isNew()) { throw new PropelException('A Page object must not be new to accept children.'); } $child->insertAsFirstChildOf($this); return $this; }