/**
  * create new albums
  * @param array $details 
  * @return json
  *   
  */
 public function insertNewAlbum($details)
 {
     $insert_id = parent::insertNewAlbum($details);
     if ($insert_id) {
         return $this->buildAnswer(0, 200, array("success" => 1, "insert_id" => $insert_id));
     }
     return $this->buildAnswer(1, 400, array("success" => 1, "insert_id" => $insert_id));
 }
Exemplo n.º 2
0
 private function checkImages(&$list)
 {
     parent::checkAlbumList($list);
 }
Exemplo n.º 3
0
<?php

include 'DBController.php';
class AlbumController
{
    function __construct()
    {
    }
    function get_albums()
    {
        $db = new DBController();
        return $db->get_album();
    }
}
$album = new AlbumController();
while ($row = $album->get_albums()->fetchArray()) {
    var_dump($row);
    echo $row['date'];
}
Exemplo n.º 4
0
    echo json_encode($album);
});
/***** ADD / UPDATE Album ***/
Flight::route('PUT /albums', function () {
    $request = Flight::request();
    $album_controller = new AlbumController();
    $album = json_decode($request->body);
    if (!isset($album->ID)) {
        echo json_encode($album_controller->ajouterAlbum($album));
    } else {
        echo json_encode($album_controller->modifierAlbum($album));
    }
});
/***** Delete Album ***/
Flight::route('DELETE /album/@id', function ($id) {
    $album_controller = new AlbumController();
    $response = $album_controller->deleteAlbum($id);
    echo json_encode($response);
});
/*
****************
**************** Tracks
****************
*/
/***** ADD / UPDATE Track ***/
Flight::route('PUT /tracks', function () {
    $request = Flight::request();
    $Track_controller = new TrackController();
    $Track = json_decode($request->body);
    if ($Track->ID == 'NULL') {
        echo json_encode($Track_controller->ajouterTrack($Track));
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
 }