Esempio n. 1
0
})->convert('status', $app['converters.movies']);
$app->get('/moviesAvailable/{idMovies}', function (Application $app, cw_medias_movies $idMovies) {
    return $app['serializer']->serialize($idMovies, $app['format']);
})->convert('idMovies', $app['converters.movies'])->bind('idMovies');
$app->get('/moviesTitles', function (Application $app) {
    $status = $app['repo.allMovies']->getMoviesTitles();
    return $app['serializer']->serialize($status, $app['format']);
});
$app->get('/allMovies', function (Application $app) {
    $status = $app['repo.allMovies']->getAllMovies();
    return $app['serializer']->serialize($status, $app['format']);
});
$app->post('/addMovie', function (Application $app, Request $request) {
    $status = new cw_medias_movies();
    $status->setTitle($request->request->get('title'));
    $status->setTitleOriginal($request->request->get('titleOriginal'));
    $status->setRealisator($request->request->get('realisator'));
    $status->setPlot($request->request->get('plot'));
    $status->setActors($request->request->get('actors'));
    $status->setCountry($request->request->get('country'));
    $status->setType($request->request->get('type'));
    $status->setGenre($request->request->get('genre'));
    $status->setReleaseDate($request->request->get('releaseDate'));
    $status->setRunningTime($request->request->get('runningTime'));
    $status->setProduction($request->request->get('production'));
    $status->setDistribution($request->request->get('distribution'));
    $status->setLanguage($request->request->get('language'));
    $status->setWarning($request->request->get('warning'));
    $status->setArchive($request->request->get('archive'));
    $status->setAddedThe($request->request->get('addedThe'));
    $id = $app['repo.allMovies']->saveMovies($status);