new OcfaSet - jcobban/Genealogy GitHub Wiki

new OcfaSet($parms)

Up: class OcfaSet

The constructor for an instance of OcfaSet 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 Ocfa to be converted into a RecordSet.
  • If this parameter is omitted, or null, the object is empty. That is $ocfaset->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:

$ocfaParms	= array(‘county' => 'Middlesex');
$ocfas		= new OcfaSet($getParms);

returns the set of instances of class Ocfa which match the specified county name.

Next: $ocfaSet->getStatistics()