src/Eccube/Entity/Block.php line 28

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of EC-CUBE
  4. *
  5. * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6. *
  7. * http://www.ec-cube.co.jp/
  8. *
  9. * For the full copyright and license information, please view the LICENSE
  10. * file that was distributed with this source code.
  11. */
  12. namespace Eccube\Entity;
  13. use Doctrine\ORM\Mapping as ORM;
  14. if (!class_exists('\Eccube\Entity\Block')) {
  15. /**
  16. * Block
  17. *
  18. * @ORM\Table(name="dtb_block", uniqueConstraints={@ORM\UniqueConstraint(name="device_type_id", columns={"device_type_id", "file_name"})})
  19. * @ORM\InheritanceType("SINGLE_TABLE")
  20. * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21. * @ORM\HasLifecycleCallbacks()
  22. * @ORM\Entity(repositoryClass="Eccube\Repository\BlockRepository")
  23. */
  24. class Block extends \Eccube\Entity\AbstractEntity
  25. {
  26. /**
  27. * @var integer
  28. */
  29. public const UNUSED_BLOCK_ID = 0;
  30. /**
  31. * @var int
  32. *
  33. * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  34. * @ORM\Id
  35. * @ORM\GeneratedValue(strategy="IDENTITY")
  36. */
  37. private $id;
  38. /**
  39. * @var string|null
  40. *
  41. * @ORM\Column(name="block_name", type="string", length=255, nullable=true)
  42. */
  43. private $name;
  44. /**
  45. * @var string
  46. *
  47. * @ORM\Column(name="file_name", type="string", length=255)
  48. */
  49. private $file_name;
  50. /**
  51. * @var boolean
  52. *
  53. * @ORM\Column(name="use_controller", type="boolean", options={"default":false})
  54. */
  55. private $use_controller = false;
  56. /**
  57. * @var boolean
  58. *
  59. * @ORM\Column(name="deletable", type="boolean", options={"default":true})
  60. */
  61. private $deletable = true;
  62. /**
  63. * @var \DateTime
  64. *
  65. * @ORM\Column(name="create_date", type="datetimetz")
  66. */
  67. private $create_date;
  68. /**
  69. * @var \DateTime
  70. *
  71. * @ORM\Column(name="update_date", type="datetimetz")
  72. */
  73. private $update_date;
  74. /**
  75. * @var \Doctrine\Common\Collections\Collection
  76. *
  77. * @ORM\OneToMany(targetEntity="Eccube\Entity\BlockPosition", mappedBy="Block", cascade={"persist","remove"})
  78. */
  79. private $BlockPositions;
  80. /**
  81. * @var \Eccube\Entity\Master\DeviceType
  82. *
  83. * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\DeviceType")
  84. * @ORM\JoinColumns({
  85. * @ORM\JoinColumn(name="device_type_id", referencedColumnName="id")
  86. * })
  87. */
  88. private $DeviceType;
  89. /**
  90. * Constructor
  91. */
  92. public function __construct()
  93. {
  94. $this->BlockPositions = new \Doctrine\Common\Collections\ArrayCollection();
  95. }
  96. /**
  97. * Set id
  98. *
  99. * @param integer $id
  100. *
  101. * @return Block
  102. */
  103. public function setId($id)
  104. {
  105. $this->id = $id;
  106. return $this;
  107. }
  108. /**
  109. * Get id
  110. *
  111. * @return integer
  112. */
  113. public function getId()
  114. {
  115. return $this->id;
  116. }
  117. /**
  118. * Set name
  119. *
  120. * @param string $name
  121. *
  122. * @return Block
  123. */
  124. public function setName($name)
  125. {
  126. $this->name = $name;
  127. return $this;
  128. }
  129. /**
  130. * Get name
  131. *
  132. * @return string
  133. */
  134. public function getName()
  135. {
  136. return $this->name;
  137. }
  138. /**
  139. * Set fileName
  140. *
  141. * @param string $fileName
  142. *
  143. * @return Block
  144. */
  145. public function setFileName($fileName)
  146. {
  147. $this->file_name = $fileName;
  148. return $this;
  149. }
  150. /**
  151. * Get fileName
  152. *
  153. * @return string
  154. */
  155. public function getFileName()
  156. {
  157. return $this->file_name;
  158. }
  159. /**
  160. * Set useController
  161. *
  162. * @param boolean $useController
  163. *
  164. * @return Block
  165. */
  166. public function setUseController($useController)
  167. {
  168. $this->use_controller = $useController;
  169. return $this;
  170. }
  171. /**
  172. * Get useController
  173. *
  174. * @return boolean
  175. */
  176. public function isUseController()
  177. {
  178. return $this->use_controller;
  179. }
  180. /**
  181. * Set deletable
  182. *
  183. * @param boolean $deletable
  184. *
  185. * @return Block
  186. */
  187. public function setDeletable($deletable)
  188. {
  189. $this->deletable = $deletable;
  190. return $this;
  191. }
  192. /**
  193. * Get deletable
  194. *
  195. * @return boolean
  196. */
  197. public function isDeletable()
  198. {
  199. return $this->deletable;
  200. }
  201. /**
  202. * Set createDate
  203. *
  204. * @param \DateTime $createDate
  205. *
  206. * @return Block
  207. */
  208. public function setCreateDate($createDate)
  209. {
  210. $this->create_date = $createDate;
  211. return $this;
  212. }
  213. /**
  214. * Get createDate
  215. *
  216. * @return \DateTime
  217. */
  218. public function getCreateDate()
  219. {
  220. return $this->create_date;
  221. }
  222. /**
  223. * Set updateDate
  224. *
  225. * @param \DateTime $updateDate
  226. *
  227. * @return Block
  228. */
  229. public function setUpdateDate($updateDate)
  230. {
  231. $this->update_date = $updateDate;
  232. return $this;
  233. }
  234. /**
  235. * Get updateDate
  236. *
  237. * @return \DateTime
  238. */
  239. public function getUpdateDate()
  240. {
  241. return $this->update_date;
  242. }
  243. /**
  244. * Add blockPosition
  245. *
  246. * @param \Eccube\Entity\BlockPosition $blockPosition
  247. *
  248. * @return Block
  249. */
  250. public function addBlockPosition(BlockPosition $blockPosition)
  251. {
  252. $this->BlockPositions[] = $blockPosition;
  253. return $this;
  254. }
  255. /**
  256. * Remove blockPosition
  257. *
  258. * @param \Eccube\Entity\BlockPosition $blockPosition
  259. */
  260. public function removeBlockPosition(BlockPosition $blockPosition)
  261. {
  262. $this->BlockPositions->removeElement($blockPosition);
  263. }
  264. /**
  265. * Get blockPositions
  266. *
  267. * @return \Doctrine\Common\Collections\Collection
  268. */
  269. public function getBlockPositions()
  270. {
  271. return $this->BlockPositions;
  272. }
  273. /**
  274. * Set deviceType
  275. *
  276. * @param \Eccube\Entity\Master\DeviceType $deviceType
  277. *
  278. * @return Block
  279. */
  280. public function setDeviceType(Master\DeviceType $deviceType = null)
  281. {
  282. $this->DeviceType = $deviceType;
  283. return $this;
  284. }
  285. /**
  286. * Get deviceType
  287. *
  288. * @return \Eccube\Entity\Master\DeviceType
  289. */
  290. public function getDeviceType()
  291. {
  292. return $this->DeviceType;
  293. }
  294. }
  295. }