Exemplo n.º 1
0
 function getAllObjects()
 {
     $object = new Obituary();
     $object->orderBy('date');
     $object->find();
     $objectList = array();
     while ($object->fetch()) {
         $objectList[$object->obituaryId] = clone $object;
     }
     return $objectList;
 }
Exemplo n.º 2
0
 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];
             }
         }
     }
 }