コード例 #1
0
ファイル: Finder.php プロジェクト: awpeak/rutuber
 /**
  * @param $id
  * @return Video
  */
 public static function findVideoById($id)
 {
     $videoData = Request::getVideoById($id);
     $params = ['description' => $videoData->description, 'title' => $videoData->title, 'isHidden' => $videoData->is_hidden, 'categoryId' => $videoData->category->id, 'Rutuber' => $videoData];
     $video = new Video();
     $video->setAttributes($params);
     unset($videoData);
     return $video;
 }
コード例 #2
0
ファイル: Account.php プロジェクト: awpeak/rutuber
 /**
  * @param Video $video
  * @return bool|mixed
  * @throws AccountAuthorizedError
  */
 public function uploadVideo(Video $video)
 {
     $result = false;
     if (!$this->isAuthorized()) {
         throw new AccountAuthorizedError('Account not authorized at Rutuber');
     }
     if ($video->validate()) {
         $result = Request::uploadVideo($video->getAttrubutes(), $this->getToken(), $this->getSecure());
         $video->setRutuber($result)->setUploaded();
     }
     return $result;
 }