partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

TipOfTheDay.php (1221B)


      1 <?php
      2 
      3 namespace PartKeepr\TipOfTheDayBundle\Entity;
      4 
      5 use Doctrine\ORM\Mapping as ORM;
      6 use PartKeepr\CoreBundle\Entity\BaseEntity;
      7 use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService;
      8 use Symfony\Component\Serializer\Annotation\Groups;
      9 
     10 /**
     11  * Represents a tip of the day.
     12  *
     13  * Tips are stored on the central PartKeepr server in a wiki. However, we need to know a list of all tip pages
     14  * because the API has a limit per day. So basically, we sync the tip names from the wiki to the local system several
     15  * times a day and not each time an user logs in.
     16  *
     17  * Note: If you wish to link against a tip of the day, do it by name and not by id!
     18  *
     19  * @ORM\Entity
     20  * @TargetService(uri="/api/tip_of_the_days")
     21  **/
     22 class TipOfTheDay extends BaseEntity
     23 {
     24     /**
     25      * @ORM\Column(type="string")
     26      * @Groups({"default"})
     27      *
     28      * @var string
     29      */
     30     private $name;
     31 
     32     /**
     33      * Sets the name for this tip.
     34      *
     35      * @param string $name The name
     36      */
     37     public function setName($name)
     38     {
     39         $this->name = $name;
     40     }
     41 
     42     /**
     43      * Returns the name for this tip.
     44      *
     45      * @return string The name
     46      */
     47     public function getName()
     48     {
     49         return $this->name;
     50     }
     51 }