Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.67 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AdminBundleEntity;
  4. use SymfonyBridgeDoctrineValidatorConstraints as DoctrineAssert;
  5.  
  6. /**
  7. * Organisation
  8. */
  9. class Organisation
  10. {
  11. /**
  12. * @var int
  13. */
  14. private $id;
  15.  
  16. /**
  17. * @var string(200)
  18. */
  19. private $name;
  20.  
  21. /**
  22. * @var int
  23. */
  24. private $organisationtype=null;
  25.  
  26. /**
  27. * @var string
  28. */
  29. private $description=null;
  30.  
  31. /**
  32. * @var string(100)
  33. */
  34. private $address1=null;
  35.  
  36. /**
  37. * @var string(100)
  38. */
  39. private $address2=null;
  40.  
  41. /**
  42. * @var string(11)
  43. */
  44. private $zipcode=null;
  45.  
  46. /**
  47. * @var string(50)
  48. */
  49. private $city=null;
  50.  
  51. /**
  52. * @var int
  53. */
  54. private $country=null;
  55.  
  56. /**
  57. * @var string(60)
  58. */
  59. private $phone=null;
  60.  
  61. /**
  62. * @var string(100)
  63. */
  64. private $URL=null;
  65.  
  66. /**
  67. * @var string(50)
  68. */
  69. private $email=null;
  70.  
  71.  
  72. /**
  73. * @var string(50)
  74. */
  75. private $comments=null;
  76.  
  77. /**
  78. * @var DateTime
  79. */
  80. private $created;
  81.  
  82. /**
  83. * @var DateTime
  84. */
  85. private $updated;
  86.  
  87.  
  88. public function setCreatedAtValue()
  89. {
  90. $this->created = new DateTime();
  91. }
  92.  
  93. public function setUpdatedAtValue()
  94. {
  95. $this->updated = new DateTime();
  96. }
  97.  
  98.  
  99. /**
  100. * Get id
  101. *
  102. * @return int
  103. */
  104. public function getId()
  105. {
  106. return $this->id;
  107. }
  108.  
  109.  
  110. public function __toString(){
  111. return $this->name;
  112. }
  113.  
  114. /**
  115. * Set name
  116. *
  117. * @param string $name
  118. *
  119. * @return Organisation
  120. */
  121. public function setName($name)
  122. {
  123. $this->name = $name;
  124.  
  125. return $this;
  126. }
  127.  
  128. /**
  129. * Get name
  130. *
  131. * @return string
  132. */
  133. public function getName()
  134. {
  135. return $this->name;
  136. }
  137.  
  138. /**
  139. * Set organisationtype
  140. *
  141. * @param $organisationtype
  142. *
  143. * @return Organisation
  144. */
  145. public function setOrganisationtype($organisationtype)
  146. {
  147. $this->organisationtype = $organisationtype;
  148.  
  149. return $this;
  150. }
  151.  
  152. /**
  153. * Get organisationtype
  154. *
  155. * @return int
  156. */
  157. public function getOrganisationtype()
  158. {
  159. return $this->organisationtype;
  160. }
  161.  
  162. /**
  163. * Set description
  164. *
  165. * @param string $description
  166. *
  167. * @return Organisation
  168. */
  169. public function setDescription($description)
  170. {
  171. $this->description = $description;
  172.  
  173. return $this;
  174. }
  175.  
  176. /**
  177. * Get description
  178. *
  179. * @return string
  180. */
  181. public function getDescription()
  182. {
  183. return $this->description;
  184. }
  185.  
  186. /**
  187. * Set address1
  188. *
  189. * @param string $address1
  190. *
  191. * @return Organisation
  192. */
  193. public function setAddress1($address1)
  194. {
  195. $this->address1 = $address1;
  196.  
  197. return $this;
  198. }
  199.  
  200. /**
  201. * Get address1
  202. *
  203. * @return string
  204. */
  205. public function getAddress1()
  206. {
  207. return $this->address1;
  208. }
  209.  
  210.  
  211. /**
  212. * Set address2
  213. *
  214. * @param string $address2
  215. *
  216. * @return Organisation
  217. */
  218. public function setAddress2($address2)
  219. {
  220. $this->address2 = $address2;
  221.  
  222. return $this;
  223. }
  224.  
  225. /**
  226. * Get address2
  227. *
  228. * @return string
  229. */
  230. public function getAddress2()
  231. {
  232. return $this->address2;
  233. }
  234.  
  235. /**
  236. * Set zipcode
  237. *
  238. * @param int $zipcode
  239. *
  240. * @return Organisation
  241. */
  242. public function setZipcode($zipcode)
  243. {
  244. $this->zipcode = $zipcode;
  245.  
  246. return $this;
  247. }
  248.  
  249. /**
  250. * Get zipcode
  251. *
  252. * @return string
  253. */
  254. public function getZipcode()
  255. {
  256. return $this->zipcode;
  257. }
  258.  
  259.  
  260. /**
  261. * Set city
  262. *
  263. * @param string $city
  264. *
  265. * @return Organisation
  266. */
  267. public function setCity($city)
  268. {
  269. $this->city = $city;
  270.  
  271. return $this;
  272. }
  273.  
  274. /**
  275. * Get city
  276. *
  277. * @return string
  278. */
  279. public function getCity()
  280. {
  281. return $this->city;
  282. }
  283.  
  284. /**
  285. * Set country
  286. *
  287. * @param $country
  288. *
  289. * @return Organisation
  290. */
  291. public function setCountry($country)
  292. {
  293. $this->country = $country;
  294.  
  295. return $this;
  296. }
  297.  
  298. /**
  299. * Get country
  300. *
  301. * @return int
  302. */
  303. public function getCountry()
  304. {
  305. return $this->country;
  306. }
  307.  
  308. /**
  309. * Set phone
  310. *
  311. * @param int $phone
  312. *
  313. * @return Organisation
  314. */
  315. public function setPhone($phone)
  316. {
  317. $this->phone = $phone;
  318.  
  319. return $this;
  320. }
  321.  
  322. /**
  323. * Get phone
  324. *
  325. * @return string
  326. */
  327. public function getPhone()
  328. {
  329. return $this->phone;
  330. }
  331.  
  332. /**
  333. * Set URL
  334. *
  335. * @param string $URL
  336. *
  337. * @return Organisation
  338. */
  339. public function setURL($URL)
  340. {
  341. $this->URL = $URL;
  342.  
  343. return $this;
  344. }
  345.  
  346. /**
  347. * Get URL
  348. *
  349. * @return string
  350. */
  351. public function getURL()
  352. {
  353. return $this->URL;
  354. }
  355.  
  356. /**
  357. * Set email
  358. *
  359. * @param string $email
  360. *
  361. * @return Organisation
  362. */
  363. public function setEmail($email)
  364. {
  365. $this->email = $email;
  366.  
  367. return $this;
  368. }
  369.  
  370. /**
  371. * Get email
  372. *
  373. * @return string
  374. */
  375. public function getEmail()
  376. {
  377. return $this->email;
  378. }
  379.  
  380. /**
  381. * Set comments
  382. *
  383. * @param string $comments
  384. *
  385. * @return Organisation
  386. */
  387. public function setComments($comments)
  388. {
  389. $this->comments = $comments;
  390.  
  391. return $this;
  392. }
  393.  
  394. /**
  395. * Get comments
  396. *
  397. * @return string
  398. */
  399. public function getComments()
  400. {
  401. return $this->comments;
  402. }
  403.  
  404.  
  405. /**
  406. * Set created
  407. *
  408. * @param DateTime $created
  409. * @return Contact
  410. */
  411. public function setCreated($created)
  412. {
  413. $this->created = $created;
  414.  
  415. return $this;
  416. }
  417.  
  418. /**
  419. * Get created
  420. *
  421. * @return DateTime
  422. */
  423. public function getCreated()
  424. {
  425. return $this->created;
  426. }
  427.  
  428. /**
  429. * Set updated
  430. *
  431. * @param DateTime $updated
  432. * @return Contact
  433. */
  434. public function setUpdated($updated)
  435. {
  436. $this->updated = $updated;
  437.  
  438. return $this;
  439. }
  440.  
  441. /**
  442. * Get updated
  443. *
  444. * @return DateTime
  445. */
  446. public function getUpdated()
  447. {
  448. return $this->updated;
  449. }
  450.  
  451.  
  452.  
  453. }
  454.  
  455. AdminBundleEntityOrganisation:
  456. type: entity
  457. table: null
  458. repositoryClass: AdminBundleRepositoryOrganisationRepository
  459. id:
  460. id:
  461. type: integer
  462. id: true
  463. generator:
  464. strategy: AUTO
  465. fields:
  466. name:
  467. type: string
  468. length: 200
  469. unique: true
  470. description:
  471. type: text
  472. nullable: TRUE
  473. address1:
  474. type: string
  475. length: 100
  476. nullable: TRUE
  477. address2:
  478. type: string
  479. length: 100
  480. nullable: TRUE
  481. zipcode:
  482. type: string
  483. length: 11
  484. nullable: TRUE
  485. city:
  486. type: string
  487. length: 50
  488. nullable: TRUE
  489. phone:
  490. type: string
  491. length: 60
  492. nullable: TRUE
  493. URL:
  494. type: string
  495. length: 100
  496. nullable: TRUE
  497. email:
  498. type: string
  499. length: 50
  500. nullable: TRUE
  501. comments:
  502. type: string
  503. length: 255
  504. nullable: TRUE
  505. created:
  506. type: datetime
  507. nullable: true
  508. gedmo:
  509. timestampable:
  510. on: create
  511. updated:
  512. type: datetime
  513. nullable: true
  514. gedmo:
  515. timestampable:
  516. on: update
  517. uniqueConstraints:
  518. search_idx:
  519. columns: [ name ]
  520. lifecycleCallbacks:
  521. prePersist: [ setCreatedAtValue,setUpdatedAtValue ]
  522. preUpdate: [ setUpdatedAtValue ]
  523. manyToOne:
  524. organisationtype:
  525. targetEntity: AdminBundleEntityOrganisation_type
  526. joinColumn:
  527. name: organisationtype
  528. referencedColumnName: id
  529. nullable: TRUE
  530. country:
  531. targetEntity: AdminBundleEntityCountry
  532. joinColumn:
  533. name: country
  534. referencedColumnName: id
  535. nullable: TRUE
  536.  
  537. AdminBundleEntityOrganisation:
  538. constraints:
  539. - SymfonyBridgeDoctrineValidatorConstraintsUniqueEntity:
  540. fields: name
  541. message: 'Ce nom est dèjà utilisé'
  542.  
  543. imports:
  544. - { resource: parameters.yml }
  545. - { resource: security.yml }
  546. - { resource: services.yml }
  547. - { resource: "@AdminBundle/Resources/config/services.yml" }
  548. - { resource: "@UserBundle/Resources/config/services.yml" }
  549.  
  550. # Put parameters here that don't need to change on each machine where the app is deployed
  551. # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
  552. parameters:
  553. locale: en
  554.  
  555. framework:
  556. #esi: ~
  557. translator: { fallbacks: ["%locale%"] }
  558. secret: "%secret%"
  559. router:
  560. resource: "%kernel.root_dir%/config/routing.yml"
  561. strict_requirements: ~
  562. form: ~
  563. csrf_protection: ~
  564. validation: { enabled: true, enable_annotations: true }
  565. #serializer: { enable_annotations: true }
  566. templating:
  567. engines: ['twig']
  568. default_locale: "%locale%"
  569. trusted_hosts: ~
  570. trusted_proxies: ~
  571. session:
  572. # http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
  573. handler_id: session.handler.native_file
  574. save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
  575. fragments: ~
  576. http_method_override: true
  577. assets: ~
  578. # Twig Configuration
  579. twig:
  580. debug: "%kernel.debug%"
  581. strict_variables: "%kernel.debug%"
  582.  
  583. # Doctrine Configuration
  584. doctrine:
  585. dbal:
  586. driver: pdo_mysql
  587. host: "%database_host%"
  588. port: "%database_port%"
  589. dbname: "%database_name%"
  590. user: "%database_user%"
  591. password: "%database_password%"
  592. charset: UTF8
  593. # if using pdo_sqlite as your database driver:
  594. # 1. add the path in parameters.yml
  595. # e.g. database_path: "%kernel.root_dir%/data/data.db3"
  596. # 2. Uncomment database_path in parameters.yml.dist
  597. # 3. Uncomment next line:
  598. # path: "%database_path%"
  599.  
  600. orm:
  601. auto_generate_proxy_classes: "%kernel.debug%"
  602. naming_strategy: doctrine.orm.naming_strategy.underscore
  603. auto_mapping: true
  604. # Swiftmailer Configuration
  605. swiftmailer:
  606. transport: "%mailer_transport%"
  607. host: "%mailer_host%"
  608. username: "%mailer_user%"
  609. password: "%mailer_password%"
  610. spool: { type: memory }
  611.  
  612. # FOSUserBundle
  613. fos_user:
  614. db_driver: orm
  615. firewall_name: main
  616. use_listener: false
  617. user_class: UserBundleEntityUser
  618.  
  619. # SonataAdminBundle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement