PageRenderTime 44ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/src/Nexity/ContactBundle/Entity/BaseContact.php

https://bitbucket.org/wizzmedia/nexity-generateur
PHP | 826 lines | 312 code | 123 blank | 391 comment | 0 complexity | 1900813af4a8d4f123b2bace2808b500 MD5 | raw file
Possible License(s): Apache-2.0
  1. <?php
  2. /**
  3. * This file is part of the nexitysf2 package.
  4. *
  5. * (c) Mike Plavonil
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Nexity\ContactBundle\Entity;
  11. abstract class BaseContact
  12. {
  13. const CIVILITE_MR = 'M.';
  14. const CIVILITE_MME = 'Mme';
  15. const CIVILITE_MLLE = 'Mlle';
  16. const SOURCE_SITE = 'site';
  17. const SOURCE_MOBILE = 'mobile';
  18. const SOURCE_APPLI = 'appli';
  19. /**
  20. * Contact id.
  21. *
  22. * @var integer
  23. */
  24. protected $id;
  25. /**
  26. * Contact civilite
  27. *
  28. * @var integer
  29. */
  30. protected $civilite;
  31. /**
  32. * Contact $nom.
  33. *
  34. * @var string
  35. */
  36. protected $nom;
  37. /**
  38. * Contact prenom.
  39. *
  40. * @var string
  41. */
  42. protected $prenom;
  43. /**
  44. * @var string
  45. */
  46. protected $adresse;
  47. /**
  48. * @var string
  49. */
  50. protected $codePostal;
  51. /**
  52. * @var string
  53. */
  54. protected $ville;
  55. /**
  56. * @var string
  57. */
  58. protected $telephone;
  59. /**
  60. * @var string
  61. */
  62. protected $email;
  63. /**
  64. * @var string
  65. */
  66. protected $entreprise;
  67. /**
  68. * @var string
  69. */
  70. protected $optinNexity;
  71. /**
  72. * @var string
  73. */
  74. protected $optinPartenaire;
  75. /**
  76. * @var FormulaireSite
  77. */
  78. protected $typeFormulaire;
  79. /**
  80. * @var string
  81. */
  82. protected $bien;
  83. /**
  84. * @var string
  85. */
  86. protected $bienCodePostal;
  87. /**
  88. * @var string
  89. */
  90. protected $typeCommercialisation;
  91. /**
  92. * @var string
  93. */
  94. protected $agence;
  95. /**
  96. * @var string
  97. */
  98. protected $formId;
  99. /**
  100. * @var string
  101. */
  102. protected $source;
  103. /**
  104. * @var string
  105. */
  106. protected $destinataire;
  107. /**
  108. * @var string
  109. */
  110. protected $objetMailCc;
  111. /**
  112. * @var string
  113. */
  114. protected $datePostForm;
  115. /**
  116. * @var integer
  117. */
  118. protected $priorite;
  119. /**
  120. * @var string
  121. */
  122. protected $message;
  123. /**
  124. * @var string
  125. */
  126. protected $pays;
  127. /**
  128. * @var string
  129. */
  130. protected $codePostalSip;
  131. /**
  132. * @var string
  133. */
  134. protected $clientNexity;
  135. /**
  136. * Constructor.
  137. */
  138. public function __construct()
  139. {
  140. $this->civilite = self::CIVILITE_MR;
  141. $this->source = self::SOURCE_SITE;
  142. $this->datePostForm = new \DateTime();
  143. $this->typeFormulaire = new FormulaireSite();
  144. }
  145. public static function getCiviliteList()
  146. {
  147. return [
  148. self::CIVILITE_MR => self::CIVILITE_MR,
  149. self::CIVILITE_MME => self::CIVILITE_MME,
  150. self::CIVILITE_MLLE => self::CIVILITE_MLLE,
  151. ];
  152. }
  153. public static function getCiviliteValues()
  154. {
  155. return array_keys(self::getCiviliteList());
  156. }
  157. public function getCiviliteName()
  158. {
  159. $list = [
  160. self::CIVILITE_MLLE => 'Mademoiselle',
  161. self::CIVILITE_MME => 'Madame',
  162. self::CIVILITE_MR => 'Monsieur',
  163. ];
  164. return !empty($list[$this->getCivilite()])?$list[$this->getCivilite()]:'';
  165. }
  166. /**
  167. * Get bien
  168. *
  169. * @return string
  170. */
  171. public function getBien()
  172. {
  173. return $this->bien;
  174. }
  175. /**
  176. * Set bien
  177. *
  178. * @param string $bien
  179. * @return Contact
  180. */
  181. public function setBien($bien)
  182. {
  183. $this->bien = $bien;
  184. return $this;
  185. }
  186. /**
  187. * Set civilite
  188. *
  189. * @param integer $civilite
  190. * @return Contact
  191. */
  192. public function setCivilite($civilite)
  193. {
  194. $this->civilite = $civilite;
  195. return $this;
  196. }
  197. /**
  198. * Get civilite
  199. *
  200. * @return integer
  201. */
  202. public function getCivilite()
  203. {
  204. return $this->civilite;
  205. }
  206. /**
  207. * Set nom
  208. *
  209. * @param string $nom
  210. * @return Contact
  211. */
  212. public function setNom($nom)
  213. {
  214. $this->nom = $nom;
  215. return $this;
  216. }
  217. /**
  218. * Get nom
  219. *
  220. * @return string
  221. */
  222. public function getNom()
  223. {
  224. return $this->nom;
  225. }
  226. /**
  227. * Set prenom
  228. *
  229. * @param string $prenom
  230. * @return Contact
  231. */
  232. public function setPrenom($prenom)
  233. {
  234. $this->prenom = $prenom;
  235. return $this;
  236. }
  237. /**
  238. * Get prenom
  239. *
  240. * @return string
  241. */
  242. public function getPrenom()
  243. {
  244. return $this->prenom;
  245. }
  246. /**
  247. * Set adresse
  248. *
  249. * @param string $adresse
  250. * @return Contact
  251. */
  252. public function setAdresse($adresse)
  253. {
  254. $this->adresse = $adresse;
  255. return $this;
  256. }
  257. /**
  258. * Get adresse
  259. *
  260. * @return string
  261. */
  262. public function getAdresse()
  263. {
  264. return $this->adresse;
  265. }
  266. /**
  267. * Set codePostal
  268. *
  269. * @param string $codePostal
  270. * @return Contact
  271. */
  272. public function setCodePostal($codePostal)
  273. {
  274. $this->codePostal = $codePostal;
  275. return $this;
  276. }
  277. /**
  278. * Get codePostal
  279. *
  280. * @return string
  281. */
  282. public function getCodePostal()
  283. {
  284. return $this->codePostal;
  285. }
  286. /**
  287. * Set ville
  288. *
  289. * @param string $ville
  290. * @return Contact
  291. */
  292. public function setVille($ville)
  293. {
  294. $this->ville = $ville;
  295. return $this;
  296. }
  297. /**
  298. * Get ville
  299. *
  300. * @return string
  301. */
  302. public function getVille()
  303. {
  304. return $this->ville;
  305. }
  306. /**
  307. * Set telephone
  308. *
  309. * @param string $telephone
  310. * @return Contact
  311. */
  312. public function setTelephone($telephone)
  313. {
  314. $this->telephone = $telephone;
  315. return $this;
  316. }
  317. /**
  318. * Get telephone
  319. *
  320. * @return string
  321. */
  322. public function getTelephone()
  323. {
  324. return $this->telephone;
  325. }
  326. /**
  327. * Set email
  328. *
  329. * @param string $email
  330. * @return Contact
  331. */
  332. public function setEmail($email)
  333. {
  334. $this->email = $email;
  335. return $this;
  336. }
  337. /**
  338. * Get email
  339. *
  340. * @return string
  341. */
  342. public function getEmail()
  343. {
  344. return $this->email;
  345. }
  346. /**
  347. * Set entreprise
  348. *
  349. * @param string $entreprise
  350. * @return Contact
  351. */
  352. public function setEntreprise($entreprise)
  353. {
  354. $this->entreprise = $entreprise;
  355. return $this;
  356. }
  357. /**
  358. * Get entreprise
  359. *
  360. * @return string
  361. */
  362. public function getEntreprise()
  363. {
  364. return $this->entreprise;
  365. }
  366. /**
  367. * Set optinNexity
  368. *
  369. * @param integer $optinNexity
  370. * @return Contact
  371. */
  372. public function setOptinNexity($optinNexity)
  373. {
  374. $this->optinNexity = $optinNexity;
  375. return $this;
  376. }
  377. /**
  378. * Get optinNexity
  379. *
  380. * @return integer
  381. */
  382. public function getOptinNexity()
  383. {
  384. return $this->optinNexity;
  385. }
  386. /**
  387. * Set optinPartenaire
  388. *
  389. * @param integer $optinPartenaire
  390. * @return Contact
  391. */
  392. public function setOptinPartenaire($optinPartenaire)
  393. {
  394. $this->optinPartenaire = $optinPartenaire;
  395. return $this;
  396. }
  397. /**
  398. * Get optinPartenaire
  399. *
  400. * @return integer
  401. */
  402. public function getOptinPartenaire()
  403. {
  404. return $this->optinPartenaire;
  405. }
  406. /**
  407. * Set typeFormulaire
  408. *
  409. * @param FormulaireSite $typeFormulaire
  410. * @return Contact
  411. */
  412. public function setTypeFormulaire(FormulaireSite $typeFormulaire)
  413. {
  414. $this->typeFormulaire = $typeFormulaire;
  415. return $this;
  416. }
  417. /**
  418. * Get typeFormulaire
  419. *
  420. * @return string
  421. */
  422. public function getTypeFormulaire()
  423. {
  424. return $this->typeFormulaire;
  425. }
  426. /**
  427. * Set bienCodePostal
  428. *
  429. * @param string $bienCodePostal
  430. * @return Contact
  431. */
  432. public function setBienCodePostal($bienCodePostal)
  433. {
  434. $this->bienCodePostal = $bienCodePostal;
  435. return $this;
  436. }
  437. /**
  438. * Get bienCodePostal
  439. *
  440. * @return string
  441. */
  442. public function getBienCodePostal()
  443. {
  444. return $this->bienCodePostal;
  445. }
  446. /**
  447. * Set typeCommercialisation
  448. *
  449. * @param string $typeCommercialisation
  450. * @return Contact
  451. */
  452. public function setTypeCommercialisation($typeCommercialisation)
  453. {
  454. $this->typeCommercialisation = $typeCommercialisation;
  455. return $this;
  456. }
  457. /**
  458. * Get typeCommercialisation
  459. *
  460. * @return string
  461. */
  462. public function getTypeCommercialisation()
  463. {
  464. return $this->typeCommercialisation;
  465. }
  466. /**
  467. * Set agence
  468. *
  469. * @param string $agence
  470. * @return Contact
  471. */
  472. public function setAgence($agence)
  473. {
  474. $this->agence = $agence;
  475. return $this;
  476. }
  477. /**
  478. * Get agence
  479. *
  480. * @return string
  481. */
  482. public function getAgence()
  483. {
  484. return $this->agence;
  485. }
  486. /**
  487. * Set formId
  488. *
  489. * @param integer $formId
  490. * @return Contact
  491. */
  492. public function setFormId($formId)
  493. {
  494. $this->formId = $formId;
  495. return $this;
  496. }
  497. /**
  498. * Get formId
  499. *
  500. * @return integer
  501. */
  502. public function getFormId()
  503. {
  504. return $this->formId;
  505. }
  506. /**
  507. * Set source
  508. *
  509. * @param string $source
  510. * @return Contact
  511. */
  512. public function setSource($source)
  513. {
  514. $this->source = $source;
  515. return $this;
  516. }
  517. /**
  518. * Get source
  519. *
  520. * @return string
  521. */
  522. public function getSource()
  523. {
  524. return $this->source;
  525. }
  526. /**
  527. * Set destinataire
  528. *
  529. * @param string $destinataire
  530. * @return Contact
  531. */
  532. public function setDestinataire($destinataire)
  533. {
  534. $this->destinataire = $destinataire;
  535. return $this;
  536. }
  537. /**
  538. * Get destinataire
  539. *
  540. * @return string
  541. */
  542. public function getDestinataire()
  543. {
  544. return $this->destinataire;
  545. }
  546. /**
  547. * Set objetMailCc
  548. *
  549. * @param string $objetMailCc
  550. * @return Contact
  551. */
  552. public function setObjetMailCc($objetMailCc)
  553. {
  554. $this->objetMailCc = $objetMailCc;
  555. return $this;
  556. }
  557. /**
  558. * Get objetMailCc
  559. *
  560. * @return string
  561. */
  562. public function getObjetMailCc()
  563. {
  564. return $this->objetMailCc;
  565. }
  566. /**
  567. * Set datePostForm
  568. *
  569. * @param string $datePostForm
  570. * @return Contact
  571. */
  572. public function setDatePostForm($datePostForm)
  573. {
  574. $this->datePostForm = $datePostForm;
  575. return $this;
  576. }
  577. /**
  578. * Get datePostForm
  579. *
  580. * @return string
  581. */
  582. public function getDatePostForm()
  583. {
  584. return $this->datePostForm;
  585. }
  586. /**
  587. * Get id
  588. *
  589. * @return integer
  590. */
  591. public function getId()
  592. {
  593. return $this->id;
  594. }
  595. /**
  596. * @param integer $priorite
  597. * @return Contact
  598. */
  599. public function setPriorite($priorite)
  600. {
  601. $this->priorite = $priorite;
  602. return $this;
  603. }
  604. /**
  605. * Get priorite
  606. *
  607. * @return integer
  608. */
  609. public function getPriorite()
  610. {
  611. return $this->priorite;
  612. }
  613. /**
  614. * @param $message
  615. * @return $this
  616. */
  617. public function setMessage($message)
  618. {
  619. $this->message = $message;
  620. return $this;
  621. }
  622. /**
  623. * @return string
  624. */
  625. public function getMessage()
  626. {
  627. return $this->message;
  628. }
  629. /**
  630. * @return string
  631. */
  632. public function getFullname()
  633. {
  634. return $this->nom .' '. $this->prenom;
  635. }
  636. /**
  637. * @return string
  638. */
  639. public function getFullAdresse()
  640. {
  641. return $this->codePostal .' '. strtoupper($this->ville);
  642. }
  643. /**
  644. * Set pays
  645. *
  646. * @param string $pays
  647. * @return Contact
  648. */
  649. public function setPays($pays)
  650. {
  651. $this->pays = $pays;
  652. return $this;
  653. }
  654. /**
  655. * Get pays
  656. *
  657. * @return string
  658. */
  659. public function getPays()
  660. {
  661. return $this->pays;
  662. }
  663. /**
  664. * Set codePostalSip
  665. *
  666. * @param string $codePostalSip
  667. * @return Contact
  668. */
  669. public function setCodePostalSip($codePostalSip)
  670. {
  671. $this->codePostalSip = $codePostalSip;
  672. return $this;
  673. }
  674. /**
  675. * Get codePostalSip
  676. *
  677. * @return string
  678. */
  679. public function getCodePostalSip()
  680. {
  681. return $this->codePostalSip;
  682. }
  683. /**
  684. * Set clientNexity
  685. *
  686. * @param integer $clientNexity
  687. * @return Contact
  688. */
  689. public function setClientNexity($clientNexity)
  690. {
  691. $this->clientNexity = $clientNexity;
  692. return $this;
  693. }
  694. /**
  695. * Get clientNexity
  696. *
  697. * @return integer
  698. */
  699. public function getClientNexity()
  700. {
  701. return $this->clientNexity;
  702. }
  703. }