Example #1
0
 public function getCurrentImage()
 {
     $data = file_get_contents('php://input');
     $data = json_decode($data);
     $galleryRepo = GalleryRepository::create();
     $gallery = $galleryRepo->filterById($data->id)->findOne();
     $galleryOutputObject = $gallery->FullObjectGeter();
     print_r(json_encode(['Ok', $galleryOutputObject]));
 }
Example #2
0
 public function getCarouselImages()
 {
     $galleryRepo = GalleryRepository::create();
     $carousel = $galleryRepo->filterByCarousel(1)->findAll();
     $carousel = $carousel->getObject();
     echo json_encode($carousel);
 }
Example #3
0
 private function imagesSearchBG($page, $context)
 {
     $imageRepo = GalleryRepository::create();
     $imageIndex = $page * 9;
     if (!is_numeric($page)) {
         throw new \Exception('Invalid argument');
     }
     $imageRepo->customOr("titleBG", $context);
     $imageRepo->customOr("descriptionBG", $context);
     $images = $imageRepo->pagination($imageIndex, 9);
     $galleryRepoCounter = GalleryRepository::create();
     $galleryRepoCounter->customOr('descriptionBG', $context);
     $galleryRepoCounter->customOr('titleBG', $context);
     $imagesCountObject = $galleryRepoCounter->pagination(0, 99);
     $outPutObject = $images->getObject();
     $pages = $this->pageCounter($imagesCountObject->getObject(), 9);
     $outPutObject->pageCount = $pages;
     return $outPutObject;
 }