public static function getById($worksheet_id, $lab_config) { global $con; $worksheet_id = mysql_real_escape_string($worksheet_id, $con); if ($worksheet_id == null || $lab_config == null) { return null; } $saved_db = DbUtil::switchToLabConfig($lab_config->id); $query_string = "SELECT * FROM worksheet_custom WHERE id={$worksheet_id}"; $record = query_associative_one($query_string); $retval = CustomWorksheet::getObject($record); DbUtil::switchRestore($saved_db); return $retval; }