コード例 #1
0
 /**
  * @param $id
  * @return mixed
  */
 public function getMediaById($id)
 {
     try {
         return $this->repository->findById($id);
     } catch (\CoandaCMS\Coanda\Media\Exceptions\MediaNotFound $exception) {
         return false;
     }
 }
コード例 #2
0
 /**
  * @return mixed
  */
 public function getBrowse()
 {
     $per_page = 12;
     $type = 'all';
     if (Input::has('type') && Input::get('type') == 'image') {
         $type = 'image';
     }
     if (Input::has('type') && Input::get('type') == 'file') {
         $type = 'file';
     }
     $media_list = $this->mediaRepository->getListByType($type, $per_page);
     return $media_list;
 }