Optimierung Darstellungen, kleine Bugs,
SS-Sudan twig im Content
This commit is contained in:
parent
6dbaa30791
commit
e741dddfc1
2 changed files with 186 additions and 0 deletions
25
trunk/src/AppBundle/Entity/TravelGuideRepository.php
Normal file
25
trunk/src/AppBundle/Entity/TravelGuideRepository.php
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace AppBundle\Entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CMSContentRepository
|
||||||
|
*
|
||||||
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
|
* repository methods below.
|
||||||
|
*/
|
||||||
|
class CMSContentRepository extends \Doctrine\ORM\EntityRepository
|
||||||
|
{
|
||||||
|
|
||||||
|
public function findBySlug($slug)
|
||||||
|
{
|
||||||
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||||
|
$qb->select('c');
|
||||||
|
$qb->from('AppBundle:CMSContent', 'c');
|
||||||
|
$qb->where('c.slug = :slug');
|
||||||
|
$qb->setParameter('slug', $slug);
|
||||||
|
$qb->setMaxResults(1);
|
||||||
|
return $qb->getQuery()->getOneOrNullResult();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
161
trunk/src/AppBundle/Entity/TravelGuides.php
Normal file
161
trunk/src/AppBundle/Entity/TravelGuides.php
Normal file
|
|
@ -0,0 +1,161 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace AppBundle\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TravelGuides
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="travel_guides")
|
||||||
|
* @ORM\Entity(repositoryClass="AppBundle\Entity\TravelGuideRepository")
|
||||||
|
*/
|
||||||
|
class TravelGuides
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
* @ORM\Id
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*/
|
||||||
|
private $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="name", type="string", length=255)
|
||||||
|
*/
|
||||||
|
private $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="slug", type="string", length=255, unique=true)
|
||||||
|
*/
|
||||||
|
private $slug;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="full_text", type="text", nullable=true)
|
||||||
|
*/
|
||||||
|
private $fullText;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Page", mappedBy="travelGuideContentId")
|
||||||
|
*/
|
||||||
|
private $page;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get id
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getId()
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set name
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
*
|
||||||
|
* @return CMSContent
|
||||||
|
*/
|
||||||
|
public function setName($name)
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set slug
|
||||||
|
*
|
||||||
|
* @param string $slug
|
||||||
|
*
|
||||||
|
* @return CMSContent
|
||||||
|
*/
|
||||||
|
public function setSlug($slug)
|
||||||
|
{
|
||||||
|
$this->slug = $slug;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get slug
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSlug()
|
||||||
|
{
|
||||||
|
return $this->slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set fullText
|
||||||
|
*
|
||||||
|
* @param string $fullText
|
||||||
|
*
|
||||||
|
* @return CMSContent
|
||||||
|
*/
|
||||||
|
public function setFullText($fullText)
|
||||||
|
{
|
||||||
|
$this->fullText = $fullText;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get fullText
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getFullText()
|
||||||
|
{
|
||||||
|
return $this->fullText;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set page
|
||||||
|
*
|
||||||
|
* @param \AppBundle\Entity\Page $page
|
||||||
|
*
|
||||||
|
* @return TravelGuideContent
|
||||||
|
*/
|
||||||
|
public function setPage(\AppBundle\Entity\Page $page = null)
|
||||||
|
{
|
||||||
|
$this->page = $page;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get page
|
||||||
|
*
|
||||||
|
* @return \AppBundle\Entity\Page
|
||||||
|
*/
|
||||||
|
public function getPage()
|
||||||
|
{
|
||||||
|
return $this->page;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue