public static function list_event(Inputter $inputter, JSONOutputter $outputter) { // List for event // // Verify input // $required_dictionary = array('event_identification' => ''); $inputter->validate_input($required_dictionary, null); // Validate // $event_id = $inputter->variables_array['event_identification']; $event_error = null; UniversallyUniqueIdentifier::propertyIsValid('rawIdentifier', $event_id, $event_error); if (isset($event_error)) { $outputter->print_error($event_error); } // Event ID // $client = new Everyman\Neo4j\Client('events.sb04.stations.graphenedb.com', 24789); $client->getTransport()->setAuth('Events', '3TP9LHROhv8LIcGmbYzq'); $query_string = 'MATCH (occurrence:EventSpaceTimeOccurrence)-[:event]-(event:Event), (occurrence)-[:location]-(location:Location), (occurrence)-[:confined_date]-(confinedDate:ConfinedDate), (occurrence)-[:attendees_range]-(attendeesRange:Range) ' . 'WHERE event.' . UNIVERSALLY_UNIQUE_OBJECT_KEY_IDENTIFICATION . " = '" . $event_id . "' " . 'RETURN occurrence, location, confinedDate, attendeesRange'; $query = new Everyman\Neo4j\Cypher\Query($client, $query_string); $result = $query->getResultSet(); if (count($result) > 0) { $event_occurrence_prints = array(); foreach ($result as $row) { $event_occurrence_print = EventSpaceTimeOccurrence::printer_dictionary($row['occurrence']); $event_occurrence_print[SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_LOCATION] = Location::printer_dictionary($row['location']); $event_occurrence_print[SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_CONFINED_DATE] = ConfinedDate::printer_dictionary($row['confinedDate']); $event_occurrence_print[EVENT_SPACE_TIME_OCCURRENCE_RELATIONSHIP_NAME_RANGE] = Range::printer_dictionary($row['attendeesRange']); array_push($event_occurrence_prints, $event_occurrence_print); } // Print data // $outputter->print_data($event_occurrence_prints); } else { // Throw error, user doesn't exists // $error = Error::withDomain(PRIVATE_EVENTS_REST_CONTROLLER_ERROR_DOMAIN, PRIVATE_EVENTS_REST_CONTROLLER_ERROR_CODE_ENTITY_DOES_NOT_EXIST, 'No Event Occurrences for Event with identification ' . $event_id . ' does not exist.'); $outputter->print_error($error); } }