new BirthSet - jcobban/Genealogy GitHub Wiki

new BirthSet($parms)

Up: class BirthSet

The constructor for an instance of BirthSet takes one parameter:

parameter description
$parms identifies the database records to be associated with this instance. This is an array.

$parms may be:

  • An associative array of fieldname => value pairs to define the subset of the records in the SQL table that are represented by this instance. The parameters 'offset', 'limit', 'groupby',and 'order' are reserved to set the OFFSET, LIMIT, GROUP BY and ORDER BY clauses.
  • The parameter can also be an array of instances of the class Birth to be converted into a RecordSet.
  • If this parameter is omitted, or null, the object is empty. That is $birthset->count() is zero.

The constructor throws an exception or adds error messages to $record->msg if it is unable to complete due to bad parameters.

Examples:

$birthParms	= array(‘regyear'	=> 1871,
		        ‘regnum'	=> array($first, “:$last”);
$births		= new BirthSet($getParms);

returns the set of instances of class Birth which match the specified year and have a registration number between $first and $last inclusive.

Next: $birthSet->getSummary()