function getAllObjects() { $object = new Marriage(); $object->orderBy('marriageDate'); $object->find(); $objectList = array(); while ($object->fetch()) { $objectList[$object->marriageId] = clone $object; } return $objectList; }
function __get($name) { global $timer; if ($name == 'displayName') { return $this->firstName . ' ' . $this->lastName; } else { if ($name == 'marriages') { if (is_null($this->marriages)) { $this->marriages = array(); if ($this->personId > 0) { //Load roles for the user from the user $marriage = new Marriage(); $marriage->personId = $this->personId; $marriage->orderBy('marriageDateYear ASC'); $marriage->find(); while ($marriage->fetch()) { $this->marriages[$marriage->marriageId] = clone $marriage; } } $timer->logTime("Loaded marriages"); return $this->marriages; } else { return $this->marriages; } } else { if ($name == 'obituaries') { if (is_null($this->obituaries)) { $this->obituaries = array(); if ($this->personId > 0) { //Load roles for the user from the user $obit = new Obituary(); $obit->personId = $this->personId; $obit->orderBy('source ASC'); $obit->find(); while ($obit->fetch()) { $this->obituaries[$obit->obituaryId] = clone $obit; } } $timer->logTime("Loaded obituaries"); return $this->obituaries; } else { return $this->obituaries; } } else { return $this->data[$name]; } } } }