create() 공개 메소드

public create ( $postData )
예제 #1
0
     httpResponse($news->delete($params[1]));
     break;
 case validateRoute('GET', 'suggestions'):
     $suggestions = new Suggestions($db, $user);
     $arr = $suggestions->get($_GET["view"] ?: 'top', (int) $_GET["limit"] ?: 10);
     httpResponse($arr);
     break;
 case validateRoute('POST', 'suggestions/\\d+/votes'):
     $suggestions = new Suggestions($db, $user);
     $arr = $suggestions->vote($params[1], $postdata["direction"]);
     httpResponse($arr);
     break;
 case validateRoute('POST', 'suggestions'):
     $forum = new Forum($db, $user);
     $suggestions = new Suggestions($db, $user, $forum);
     httpResponse($suggestions->create($postdata));
     break;
 case validateRoute('PATCH', 'suggestions/\\d+'):
     $suggestions = new Suggestions($db, $user);
     httpResponse($suggestions->update($params[1], $postdata));
     break;
 case validateRoute('GET', 'sweTvGuide'):
     $week = (int) $_GET["week"];
     $cacheId = 'swetvguide-' . $week;
     if ($memcache && ($cached = $memcache->get($cacheId))) {
         if ($week == 0) {
             $user->updateLastTorrentViewAccess('last_tvbrowse');
         }
         httpResponse($cached);
     } else {
         $torrent = new Torrent($db, $user);