order page webzine
This commit is contained in:
parent
eba2e1c745
commit
f04915f759
@ -284,8 +284,8 @@ class WebzineController extends AbstractController
|
|||||||
$page=$em->getRepository("App:Webzinepage")->find($id);
|
$page=$em->getRepository("App:Webzinepage")->find($id);
|
||||||
$sets=$em->getRepository($this->entity)->findBy(["set"=>$webzine->getSet()],["order"=>"ASC"]);
|
$sets=$em->getRepository($this->entity)->findBy(["set"=>$webzine->getSet()],["order"=>"ASC"]);
|
||||||
|
|
||||||
$datanext=$this->getDataAllNext($idcat,$id,$webzine);
|
$datanext=$this->getDataAllNext($idcat,$page->getOrder(),$webzine);
|
||||||
$dataprev=$this->getDataAllPrev($idcat,$id,$webzine);
|
$dataprev=$this->getDataAllPrev($idcat,$page->getOrder(),$webzine);
|
||||||
|
|
||||||
$pathinfo=pathinfo($page->getIllustration());
|
$pathinfo=pathinfo($page->getIllustration());
|
||||||
|
|
||||||
@ -304,17 +304,17 @@ class WebzineController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getDataAllNext($idcat,$id,$webzine)
|
protected function getDataAllNext($idcat,$order,$webzine)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$data = $em->createQueryBuilder()
|
$data = $em->createQueryBuilder()
|
||||||
->select('e')
|
->select('e')
|
||||||
->from("App:Webzinepage", 'e')
|
->from("App:Webzinepage", 'e')
|
||||||
->where('e.id>:id')
|
->where('e.order>:order')
|
||||||
->andWhere('e.webzine=:idcat')
|
->andWhere('e.webzine=:idcat')
|
||||||
->orderBy("e.order","ASC")
|
->orderBy("e.order","ASC")
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->setParameter("id", $id)
|
->setParameter("order", $order)
|
||||||
->setParameter("idcat", $idcat)
|
->setParameter("idcat", $idcat)
|
||||||
->setMaxResults(1)
|
->setMaxResults(1)
|
||||||
->getResult();
|
->getResult();
|
||||||
@ -348,17 +348,17 @@ class WebzineController extends AbstractController
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getDataAllPrev($idcat,$id,$webzine)
|
protected function getDataAllPrev($idcat,$order,$webzine)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$data = $em->createQueryBuilder()
|
$data = $em->createQueryBuilder()
|
||||||
->select('e')
|
->select('e')
|
||||||
->from("App:Webzinepage", 'e')
|
->from("App:Webzinepage", 'e')
|
||||||
->where('e.id<:id')
|
->where('e.order<:order')
|
||||||
->andWhere('e.webzine=:idcat')
|
->andWhere('e.webzine=:idcat')
|
||||||
->orderBy("e.order","DESC")
|
->orderBy("e.order","DESC")
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->setParameter("id", $id)
|
->setParameter("order", $order)
|
||||||
->setParameter("idcat", $idcat)
|
->setParameter("idcat", $idcat)
|
||||||
->setMaxResults(1)
|
->setMaxResults(1)
|
||||||
->getResult();
|
->getResult();
|
||||||
|
Loading…
Reference in New Issue
Block a user