GridPreset.php (2247B)
1 <?php 2 3 namespace PartKeepr\FrontendBundle\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 * Stores the grid presets. 12 * 13 * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="name_grid_unique", columns={"grid", "name"})}) 14 * @ORM\Entity() 15 * @TargetService(uri="/api/grid_presets") 16 */ 17 class GridPreset extends BaseEntity 18 { 19 /** 20 * Holds the grid. 21 * 22 * @ORM\Column(length=255) 23 * @Groups({"default"}) 24 * 25 * @var string 26 */ 27 private $grid; 28 29 /** 30 * Holds the grid preset name. 31 * 32 * @ORM\Column(length=255) 33 * @Groups({"default"}) 34 * 35 * @var string 36 */ 37 private $name; 38 39 /** 40 * Defines the preset configuration. 41 * 42 * @ORM\Column(type="text") 43 * @Groups({"default"}) 44 * 45 * @var string 46 */ 47 private $configuration; 48 49 /** 50 * Defines if the selected grid preset is the default. 51 * 52 * @ORM\Column(type="boolean") 53 * @Groups({"default"}) 54 * 55 * @var bool 56 */ 57 private $gridDefault = false; 58 59 /** 60 * @return bool True if the given preset is the default 61 */ 62 public function isGridDefault() 63 { 64 return $this->gridDefault; 65 } 66 67 /** 68 * @param bool $default 69 */ 70 public function setGridDefault($default = true) 71 { 72 $this->gridDefault = $default; 73 } 74 75 /** 76 * @return string 77 */ 78 public function getGrid() 79 { 80 return $this->grid; 81 } 82 83 /** 84 * @param string $grid 85 */ 86 public function setGrid($grid) 87 { 88 $this->grid = $grid; 89 } 90 91 /** 92 * @return string 93 */ 94 public function getName() 95 { 96 return $this->name; 97 } 98 99 /** 100 * @param string $name 101 */ 102 public function setName($name) 103 { 104 $this->name = $name; 105 } 106 107 /** 108 * @return string 109 */ 110 public function getConfiguration() 111 { 112 return $this->configuration; 113 } 114 115 /** 116 * @param string $configuration 117 */ 118 public function setConfiguration($configuration) 119 { 120 $this->configuration = $configuration; 121 } 122 }