src/JuridicusBundle/Entity/Faq.php line 12

Open in your IDE?
  1. <?php
  2. namespace JF\JuridicusBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. /**
  7.  * Faq
  8.  */
  9. class Faq
  10. {
  11.     const CLASSNAME __CLASS__;
  12.     
  13.     /**
  14.      * @var integer
  15.      */
  16.     private $id;
  17.     /**
  18.      * @var integer
  19.      */
  20.     private $sortierung;
  21.     /**
  22.      * @var string
  23.      * @Assert\NotBlank
  24.      */
  25.     private $frage;
  26.     /**
  27.      * @var string
  28.      * @Assert\NotBlank
  29.      */
  30.     private $antwort;
  31.     /**
  32.      * @var \DateTime
  33.      * @Assert\Type(\DateTimeInterface::class)
  34.      */
  35.     private $created_at;
  36.     /**
  37.      * @var \DateTime
  38.      * @Assert\Type(\DateTimeInterface::class)
  39.      */
  40.     private $updated_at;
  41.     /**
  42.      * Get id
  43.      *
  44.      * @return integer 
  45.      */
  46.     public function getId()
  47.     {
  48.         return $this->id;
  49.     }
  50.     /**
  51.      * Set sortierung
  52.      *
  53.      * @param integer $sortierung
  54.      * @return Faq
  55.      */
  56.     public function setSortierung($sortierung)
  57.     {
  58.         $this->sortierung $sortierung;
  59.     
  60.         return $this;
  61.     }
  62.     /**
  63.      * Get sortierung
  64.      *
  65.      * @return integer 
  66.      */
  67.     public function getSortierung()
  68.     {
  69.         return $this->sortierung;
  70.     }
  71.     /**
  72.      * Set frage
  73.      *
  74.      * @param string $frage
  75.      * @return Faq
  76.      */
  77.     public function setFrage($frage)
  78.     {
  79.         $this->frage $frage;
  80.     
  81.         return $this;
  82.     }
  83.     /**
  84.      * Get frage
  85.      *
  86.      * @return string 
  87.      */
  88.     public function getFrage()
  89.     {
  90.         return $this->frage;
  91.     }
  92.     /**
  93.      * Set antwort
  94.      *
  95.      * @param string $antwort
  96.      * @return Faq
  97.      */
  98.     public function setAntwort($antwort)
  99.     {
  100.         $this->antwort $antwort;
  101.     
  102.         return $this;
  103.     }
  104.     /**
  105.      * Get antwort
  106.      *
  107.      * @return string 
  108.      */
  109.     public function getAntwort()
  110.     {
  111.         return $this->antwort;
  112.     }
  113.     /**
  114.      * Set created_at
  115.      *
  116.      * @param \DateTime $createdAt
  117.      * @return Faq
  118.      */
  119.     public function setCreatedAt($createdAt)
  120.     {
  121.         $this->created_at $createdAt;
  122.     
  123.         return $this;
  124.     }
  125.     /**
  126.      * Get created_at
  127.      *
  128.      * @return \DateTime 
  129.      */
  130.     public function getCreatedAt()
  131.     {
  132.         return $this->created_at;
  133.     }
  134.     /**
  135.      * Set updated_at
  136.      *
  137.      * @param \DateTime $updatedAt
  138.      * @return Faq
  139.      */
  140.     public function setUpdatedAt($updatedAt)
  141.     {
  142.         $this->updated_at $updatedAt;
  143.     
  144.         return $this;
  145.     }
  146.     /**
  147.      * Get updated_at
  148.      *
  149.      * @return \DateTime 
  150.      */
  151.     public function getUpdatedAt()
  152.     {
  153.         return $this->updated_at;
  154.     }
  155.     
  156.        
  157.     public function __toString()
  158.     {
  159.         return sprintf('FAQ Item #%d'$this->getSortierung());
  160.     }
  161.     
  162.     /**
  163.      * @param array replacements
  164.      * @return string
  165.      */
  166.     public function antwortReplace( array $replacements )
  167.     {
  168.         $body $this->antwort;
  169.         
  170.         if ( isset( $replacements['host'] ) )
  171.         {
  172.             $body str_replace('[HOST]'sprintf'<a href="http://%1$s">%1$s</a>'$replacements['host'] ), $body);
  173.         }
  174.         if ( isset( $replacements['anzahl_pruefer'] ) )
  175.         {
  176.             $body str_replace('[ANZAHL_PRUEFER]',$replacements['anzahl_pruefer'], $body);
  177.         }                                                                
  178.         return $body;
  179.     }
  180. }