Guest User

Untitled

a guest
Dec 11th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.04 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppBundleEntity;
  4.  
  5. use DoctrineORMMapping as ORM;
  6.  
  7. /**
  8. * newspaper_name
  9. *
  10. * @ORMTable(name="newspaper_name")
  11. * @ORMEntity(repositoryClass="AppBundleRepositorynewspaper_nameRepository")
  12. */
  13. class newspaper_name
  14. {
  15. /**
  16. * @var int
  17. *
  18. * @ORMColumn(name="id", type="integer")
  19. * @ORMId
  20. * @ORMGeneratedValue(strategy="AUTO")
  21. */
  22. private $id;
  23.  
  24. /**
  25. * @var string
  26. *
  27. * @ORMColumn(name="name", type="string", length=255)
  28. */
  29. private $name;
  30.  
  31. /**
  32. * One newspaper has One design.
  33. * @ORMOneToOne(targetEntity="newspaper_design", mappedBy="newspapername")
  34. */
  35. private $newspaperdesign;
  36.  
  37. /**
  38. * One newspaper has One font.
  39. * @ORMOneToOne(targetEntity="newspaper_fonts", mappedBy="newspapername")
  40. */
  41. private $newspaperfonts;
  42.  
  43. /**
  44. * One newspaper has Many releases.
  45. * @ORMOneToMany(targetEntity="newspaper_releases", mappedBy="newspapername")
  46. */
  47. private $newspaperreleases;
  48.  
  49. /**
  50. * One newspaper has Many categories.
  51. * @ORMOneToMany(targetEntity="newspaper_categories", mappedBy="newspapername")
  52. */
  53. private $newspapercategories;
  54.  
  55. /**
  56. * @var string
  57. *
  58. * @ORMColumn(name="description", type="text")
  59. */
  60. private $description;
  61.  
  62.  
  63. /**
  64. * Get id
  65. *
  66. * @return int
  67. */
  68. public function getId()
  69. {
  70. return $this->id;
  71. }
  72.  
  73. /**
  74. * Set name
  75. *
  76. * @param string $name
  77. *
  78. * @return newspapername
  79. */
  80. public function setName($name)
  81. {
  82. $this->name = $name;
  83.  
  84. return $this;
  85. }
  86.  
  87. /**
  88. * Get name
  89. *
  90. * @return string
  91. */
  92. public function getName()
  93. {
  94. return $this->name;
  95. }
  96.  
  97. /**
  98. * Set description
  99. *
  100. * @param string $description
  101. *
  102. * @return newspapername
  103. */
  104. public function setDescription($description)
  105. {
  106. $this->description = $description;
  107.  
  108. return $this;
  109. }
  110.  
  111. /**
  112. * Get description
  113. *
  114. * @return string
  115. */
  116. public function getDescription()
  117. {
  118. return $this->description;
  119. }
  120. /**
  121. * Constructor
  122. */
  123. public function __construct()
  124. {
  125. $this->newspaperreleases = new DoctrineCommonCollectionsArrayCollection();
  126. $this->newspapercategories = new DoctrineCommonCollectionsArrayCollection();
  127. }
  128.  
  129. /**
  130. * Set newspaperdesign
  131. *
  132. * @param AppBundleEntitynewspaper_design $newspaperdesign
  133. *
  134. * @return newspaper_name
  135. */
  136. public function setNewspaperdesign(AppBundleEntitynewspaper_design $newspaperdesign = null)
  137. {
  138. $this->newspaperdesign = $newspaperdesign;
  139.  
  140. return $this;
  141. }
  142.  
  143. /**
  144. * Get newspaperdesign
  145. *
  146. * @return AppBundleEntitynewspaper_design
  147. */
  148. public function getNewspaperdesign()
  149. {
  150. return $this->newspaperdesign;
  151. }
  152.  
  153. /**
  154. * Set newspaperfonts
  155. *
  156. * @param AppBundleEntitynewspaper_fonts $newspaperfonts
  157. *
  158. * @return newspaper_name
  159. */
  160. public function setNewspaperfonts(AppBundleEntitynewspaper_fonts $newspaperfonts = null)
  161. {
  162. $this->newspaperfonts = $newspaperfonts;
  163.  
  164. return $this;
  165. }
  166.  
  167. /**
  168. * Get newspaperfonts
  169. *
  170. * @return AppBundleEntitynewspaper_fonts
  171. */
  172. public function getNewspaperfonts()
  173. {
  174. return $this->newspaperfonts;
  175. }
  176.  
  177. /**
  178. * Add newspaperrelease
  179. *
  180. * @param AppBundleEntitynewspaper_releases $newspaperrelease
  181. *
  182. * @return newspaper_name
  183. */
  184. public function addNewspaperrelease(AppBundleEntitynewspaper_releases $newspaperrelease)
  185. {
  186. $this->newspaperreleases[] = $newspaperrelease;
  187.  
  188. return $this;
  189. }
  190.  
  191. /**
  192. * Remove newspaperrelease
  193. *
  194. * @param AppBundleEntitynewspaper_releases $newspaperrelease
  195. */
  196. public function removeNewspaperrelease(AppBundleEntitynewspaper_releases $newspaperrelease)
  197. {
  198. $this->newspaperreleases->removeElement($newspaperrelease);
  199. }
  200.  
  201. /**
  202. * Get newspaperreleases
  203. *
  204. * @return DoctrineCommonCollectionsCollection
  205. */
  206. public function getNewspaperreleases()
  207. {
  208. return $this->newspaperreleases;
  209. }
  210.  
  211. /**
  212. * Add newspapercategory
  213. *
  214. * @param AppBundleEntitynewspaper_categories $newspapercategory
  215. *
  216. * @return newspaper_name
  217. */
  218. public function addNewspapercategory(AppBundleEntitynewspaper_categories $newspapercategory)
  219. {
  220. $this->newspapercategories[] = $newspapercategory;
  221.  
  222. return $this;
  223. }
  224.  
  225. /**
  226. * Remove newspapercategory
  227. *
  228. * @param AppBundleEntitynewspaper_categories $newspapercategory
  229. */
  230. public function removeNewspapercategory(AppBundleEntitynewspaper_categories $newspapercategory)
  231. {
  232. $this->newspapercategories->removeElement($newspapercategory);
  233. }
  234.  
  235. /**
  236. * Get newspapercategories
  237. *
  238. * @return DoctrineCommonCollectionsCollection
  239. */
  240. public function getNewspapercategories()
  241. {
  242. return $this->newspapercategories;
  243. }
  244.  
  245.  
  246.  
  247.  
  248.  
  249. // make this all also to a string
  250.  
  251. public function __toString()
  252. {
  253. return $this->getName();
  254. }
  255. }
  256.  
  257. <?php
  258.  
  259. namespace AppBundleEntity;
  260.  
  261. use DoctrineORMMapping as ORM;
  262.  
  263. /**
  264. * newspaper_design
  265. *
  266. * @ORMTable(name="newspaper_design")
  267. * @ORMEntity(repositoryClass="AppBundleRepositorynewspaper_designRepository")
  268. */
  269. class newspaper_design
  270. {
  271. /**
  272. * @var int
  273. *
  274. * @ORMColumn(name="id", type="integer")
  275. * @ORMId
  276. * @ORMGeneratedValue(strategy="AUTO")
  277. */
  278. private $id;
  279.  
  280. /**
  281. * One design has One newspaper.
  282. * @ORMOneToOne(targetEntity="newspaper_name", inversedBy="newspaperdesign")
  283. * @ORMJoinColumn(name="np_id", referencedColumnName="id")
  284. */
  285. private $newspapername;
  286.  
  287.  
  288.  
  289.  
  290. /**
  291. * @var string
  292. *
  293. * @ORMColumn(name="font_size", type="string", length=255)
  294. */
  295. private $fontSize;
  296.  
  297. /**
  298. * @var int
  299. *
  300. * @ORMColumn(name="columns", type="integer")
  301. */
  302. private $columns;
  303.  
  304. /**
  305. * @var string
  306. *
  307. * @ORMColumn(name="columns_width", type="string", length=255)
  308. */
  309. private $columnsWidth;
  310.  
  311. /**
  312. * @var string
  313. *
  314. * @ORMColumn(name="columns_height", type="string", length=255)
  315. */
  316. private $columnsHeight;
  317.  
  318.  
  319. /**
  320. * Get id
  321. *
  322. * @return int
  323. */
  324. public function getId()
  325. {
  326. return $this->id;
  327. }
  328.  
  329. /**
  330. * Set fontSize
  331. *
  332. * @param string $fontSize
  333. *
  334. * @return newspaperdesign
  335. */
  336. public function setFontSize($fontSize)
  337. {
  338. $this->fontSize = $fontSize;
  339.  
  340. return $this;
  341. }
  342.  
  343. /**
  344. * Get fontSize
  345. *
  346. * @return string
  347. */
  348. public function getFontSize()
  349. {
  350. return $this->fontSize;
  351. }
  352.  
  353. /**
  354. * Set columns
  355. *
  356. * @param integer $columns
  357. *
  358. * @return newspaperdesign
  359. */
  360. public function setColumns($columns)
  361. {
  362. $this->columns = $columns;
  363.  
  364. return $this;
  365. }
  366.  
  367. /**
  368. * Get columns
  369. *
  370. * @return int
  371. */
  372. public function getColumns()
  373. {
  374. return $this->columns;
  375. }
  376.  
  377. /**
  378. * Set columnsWidth
  379. *
  380. * @param string $columnsWidth
  381. *
  382. * @return newspaperdesign
  383. */
  384. public function setColumnsWidth($columnsWidth)
  385. {
  386. $this->columnsWidth = $columnsWidth;
  387.  
  388. return $this;
  389. }
  390.  
  391. /**
  392. * Get columnsWidth
  393. *
  394. * @return string
  395. */
  396. public function getColumnsWidth()
  397. {
  398. return $this->columnsWidth;
  399. }
  400.  
  401. /**
  402. * Set columnsHeight
  403. *
  404. * @param string $columnsHeight
  405. *
  406. * @return newspaperdesign
  407. */
  408. public function setColumnsHeight($columnsHeight)
  409. {
  410. $this->columnsHeight = $columnsHeight;
  411.  
  412. return $this;
  413. }
  414.  
  415. /**
  416. * Get columnsHeight
  417. *
  418. * @return string
  419. */
  420. public function getColumnsHeight()
  421. {
  422. return $this->columnsHeight;
  423. }
  424.  
  425. /**
  426. * Set newspapername
  427. *
  428. * @param AppBundleEntitynewspaper_name $newspapername
  429. *
  430. * @return newspaper_design
  431. */
  432. public function setNewspapername(AppBundleEntitynewspaper_name $newspapername = null)
  433. {
  434. $this->newspapername = $newspapername;
  435.  
  436. return $this;
  437. }
  438.  
  439. /**
  440. * Get newspapername
  441. *
  442. * @return AppBundleEntitynewspaper_name
  443. */
  444. public function getNewspapername()
  445. {
  446. return $this->newspapername;
  447. }
  448.  
  449.  
  450.  
  451.  
  452. // make this all also to a string
  453.  
  454. public function __toString()
  455. {
  456. return $this->getName();
  457. }
  458. }
  459.  
  460. <?php
  461.  
  462. namespace AppBundleForm;
  463.  
  464. use SymfonyComponentFormAbstractType;
  465. use SymfonyComponentFormExtensionCoreTypeTextareaType;
  466. use SymfonyComponentFormExtensionCoreTypeTextType;
  467. use SymfonyComponentFormFormBuilderInterface;
  468. use SymfonyComponentOptionsResolverOptionsResolver;
  469. use SymfonyBridgeDoctrineFormTypeEntityType;
  470.  
  471. class newspaper_nameType extends AbstractType
  472. {
  473. /**
  474. * {@inheritdoc}
  475. */
  476. public function buildForm(FormBuilderInterface $builder, array $options)
  477. {
  478. $builder->add('name', TextType::class, [
  479. 'label' => 'authorsite.form.name',
  480. 'required' => true
  481. ]);
  482. $builder->add('description', TextareaType::class, [
  483. 'label' => 'authorsite.form.name',
  484. 'required' => true
  485. ]);
  486. $builder->add('font_size', EntityType::class, [
  487. 'class' => 'AppBundleEntitynewspaper_design',
  488. 'label' => 'authorsite.form.font_size',
  489. 'required' => true
  490. ]);
  491. $builder->add('columns', EntityType::class, [
  492. 'class' => 'AppBundleEntitynewspaper_design',
  493. 'label' => 'authorsite.form.columns',
  494. 'required' => true
  495. ]);
  496.  
  497.  
  498. }
  499.  
  500. /**
  501. * {@inheritdoc}
  502. */
  503. public function configureOptions(OptionsResolver $resolver)
  504. {
  505. $resolver->setDefaults(array(
  506. 'data_class' => 'AppBundleEntitynewspaper_name'
  507. ));
  508. }
  509.  
  510. /**
  511. * {@inheritdoc}
  512. */
  513. public function getBlockPrefix()
  514. {
  515. return 'appbundle_newspaper_name';
  516. }
  517.  
  518.  
  519. }
Add Comment
Please, Sign In to add comment