public static function addMarker() { $film = new Film(null, "a film", "http://www.cnn.com"); $updatedFilm = FilmDAO::insert($film); $user = new User(null, "*****@*****.**", "john doe", User::hash("password")); $updatedUser = UserDAO::add($user); $markerType = MarkerTypeDAO::getByName('Event'); UserDAO::addFilm($updatedUser->getUserId(), $updatedFilm->getId()); $myVideos = UserDAO::getFilms($updatedUser->getUserId()); var_dump($myVideos); $array = array("id" => NULL, "filmId" => $updatedFilm->getId(), "markerId" => $markerType->getId(), "start" => 0.5, "end" => 0.6, "text" => "this is stuff", "target" => "target", "userId" => $updatedUser->getUserId()); $marker = new FilmMarker($array); $markerWithId = FilmMarkerDAO::insertMarker($marker); //var_dump($markerWithId); UserDAO::removeFilm($updatedUser->getUserId(), $updatedFilm->getId()); FilmMarkerDAO::delete($markerWithId->getId()); UserDAO::delete($updatedUser->getUserId()); FilmDAO::delete($film->getId()); }
<?php include_once '../user.php'; include_once '../film.php'; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $postAction = filter_input(INPUT_POST, 'action'); $email = filter_input(INPUT_POST, "email"); $userPassword = filter_input(INPUT_POST, "password"); if ($postAction == 'login') { $userReturn = UserDAO::loginUser($email, $userPassword); if ($userReturn) { $userFilm = UserDAO::getFilms($userReturn->getUserId()); $userFilmUrl = $userFilm[0]['film_url']; $userArray = []; $userArray['email'] = $userReturn->getUserEmail(); $userArray['filmUrl'] = $userFilmUrl; $userArray['fullName'] = $userReturn->getFullName(); echo json_encode($userArray); } else { echo "USER NOT found!!!!"; } }