public function delete()
 {
     if (!$this->request->is('post') && !$this->request->is('delete')) {
         $msg = "Streams::delete can only be called with http:post or http:delete.";
         throw new DispatchException($msg);
     }
     Streams::find($this->request->id)->delete();
     return $this->redirect('Streams::index');
 }
 public function createStream($application, $stream, array $values = array())
 {
     $data = array('name' => $stream, 'application_id' => $application->id);
     return Streams::create($data + $values);
 }