DontMergeEntry::offsetExists - jcobban/Genealogy GitHub Wiki

$dontMergeEntry->offsetExists($field)

Up: class DontMergeEntry

Part of the implementation of the interface ArrayAccess. This returns true if the field name is in use in either the record or the array of temporary fields. This method returns false if the field name does not correspond to any field in the record. It has one parameter:

parameter description
$field The field name is case insensitive. This is extended in class DontMergeEntry to permit directly referencing a field in either of the instances of class Person that are referenced by this class by prefixing the field name with 'left.' or 'l' to reference the Person identified by 'idirleft' or 'right.' or 'r' to reference the Person identified by 'idirright'. The field name may also be a temporary field defined by assigning a value to it in the set method.

This method is called to implement array_key_exists($field, $record).

For example:

if ($dontMergeEntry->offsetExists('left.surname'))
    print "field left.surname is defined.";
if (array_key_exists('left.surname',$dontMergeEntry))
    print "field left.surname is defined.";

Next: class DontMergeEntrySet