Family::addChild - jcobban/Genealogy GitHub Wiki
$family->addChild($idir)
Up: class Family
This factory method is used to associate an instance of class Person
as a child of this instance of Family
.
It has one parameter:
parameter | description |
---|---|
$idir | If this is an integer value it is the unique identifier of an instance of Person . Otherwise it may be an instance of Person . |
This returns an instance of class Child
. If the identifier Person
is already a child of this Family
then this is an existing instance, otherwise it is necessary for the calling code to save the instance to the database.
$child = $family->addChild($idir);
if (!$child->isExisting())
$child->save();
The method throws an exception if the parameter is invalid.
Next: $family->getStatus()