TEMPLATE_CLASS_SYS_EVENTS, META_SESSION_DAEMON => 1 ]; } // sometimes I forget to replace the class template in the meta data that initiated the system event... if ($_meta[META_TEMPLATE] != TEMPLATE_CLASS_SYS_EVENTS) $_meta[META_TEMPLATE] = TEMPLATE_CLASS_SYS_EVENTS; try { parent::__construct($_meta); } catch (Throwable $t) { $hdr = basename(__METHOD__) . AT . __LINE__ . COLON; $msg = ERROR_THROWABLE_EXCEPTION . COLON . $t->getMessage(); @handleExceptionMessaging($hdr, $msg, $this->eventMessages, true); $this->state = STATE_FRAMEWORK_FAIL; $this->status = false; return; } if (!$this->status) { $msg = ERROR_FAILED_TO_INSTANTIATE . STRING_CLASS_MONGO; if (isset($this->logger) and $this->logger->available) $this->logger->warn($msg); else consoleLog($this->res, CON_ERROR, $msg); $this->eventMessages[] = $msg; return; } $this->aiClient = null; $this->class = get_class($this); } /** * fetchRecordBySessionGUID() -- public method * * This session-events class function requires a single input parameter: * * $_sessionGUID -- this is the session GUID, unique by definition, that we'll use to fetch the sys-event record * * The method assumes (because it was validated by the adminOut broker that called this method) that the GUID is valid. * We'll exec a schema-fetch based on the query build to filter by the session GUID. On success, the entire record will * populated in the current data object. Otherwise error messages and such. * * The function returns type void - success or failure can be tested by the class state/status. * * * @author mike@givingassistant.org * @version 1.0 * * @param string $_sessionGUID * * * HISTORY: * ======== * 10-20-20 mks DB-168: original coding * */ public function fetchRecordBySessionGUID(string $_sessionGUID):void { $query = [STRING_QUERY_DATA => [ SYSTEM_EVENT_FK_SESSION_GUID => [OPERAND_NULL => [OPERATOR_EQ => [$_sessionGUID]]]]]; $this->_fetchRecords($query); if (!$this->status) { $this->eventMessages[] = ERROR_NOSQL_FETCH; consoleLog($this->res, CON_ERROR, sprintf(ERROR_MDB_FETCH_FAIL, TEMPLATE_CLASS_SYS_EVENTS) . SYSTEM_EVENT_FK_SESSION_GUID); } elseif ($this->count != 1) { $this->eventMessages[] = ERROR_FETCH; $this->logger->warn(sprintf(ERROR_DATA_RECORD_COUNT,1, $this->count)); $this->logger->warn(json_encode($query)); } } /** * __clone() -- public method * * Silently disallows cloning of the object * * @author mike@givingassistant.org * @version 1.0 * * @return null * * HISTORY: * ======== * 08-17-15 mks CORE-500: original coding * */ private function __clone() { return null; } /** * __destruct() -- public method * * As of PHP 5.3.10, destructors are not run on shutdowns caused by fatal errors - since the destructor is * now registered in the constructor method, recovery and/or clean-up efforts should go into this method. * * @author mike@givingassistant.org * @version 1.0 * * HISTORY: * ======== * 08-17-15 mks CORE-500: original coding * */ public function __destruct() { //do nothing } }