/** * Return only ids * @param string $queryLogId Foreign key * @return string[] */ public static function getRelationshipByQueryLog($queryLogId) { //Access QueryLog object by this id to get the request_id $queryLogObject = QueryLog::getById($queryLogId); if (!$queryLogObject) { return []; } $requestId = $queryLogObject->attributes->request_id; SystemLogAdapter::prepare(); $table = static::$table = SystemLogAdapter::getTable(); $schema = SystemLogAdapter::getSchema(); //Include schema if is set $schema = $schema ? sprintf('"%s".', $schema) : ''; $ids = SystemLogAdapter::executeAndFetchAllArray(sprintf('SELECT "id" FROM %s"%s" WHERE "request_id" = ?', $schema, $table), [$requestId]); return array_map('strval', $ids); }