Event.php 20 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  1. <?php
  2. namespace Opentalent\OtTemplating\Domain\Model;
  3. use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
  4. /**
  5. * Event
  6. */
  7. class Event extends AbstractEntity
  8. {
  9. /**
  10. * id
  11. *
  12. * @var int
  13. */
  14. protected $id = 0;
  15. /**
  16. * type
  17. *
  18. * @var string
  19. */
  20. protected $type = '';
  21. /**
  22. * organizationId
  23. *
  24. * @var int
  25. */
  26. protected $organizationId = 0;
  27. /**
  28. * subdomain
  29. *
  30. * @var string
  31. */
  32. protected $subdomain = '';
  33. /**
  34. * name
  35. *
  36. * @var string
  37. */
  38. protected $name = '';
  39. /**
  40. * description
  41. *
  42. * @var string
  43. */
  44. protected $description = '';
  45. /**
  46. * categories
  47. *
  48. * @var int
  49. */
  50. protected $categories = 0;
  51. /**
  52. * url
  53. *
  54. * @var string
  55. */
  56. protected $url = '';
  57. /**
  58. * rule
  59. *
  60. * @var string
  61. */
  62. protected $rule = '';
  63. /**
  64. * datetimeStart
  65. *
  66. * @var \DateTime
  67. */
  68. protected $datetimeStart = null;
  69. /**
  70. * datetimeEnd
  71. *
  72. * @var \DateTime
  73. */
  74. protected $datetimeEnd = null;
  75. /**
  76. * dates
  77. *
  78. * @var string
  79. */
  80. protected $dates = '';
  81. /**
  82. * placename
  83. *
  84. * @var string
  85. */
  86. protected $placename = '';
  87. /**
  88. * placeDescription
  89. *
  90. * @var string
  91. */
  92. protected $placeDescription = '';
  93. /**
  94. * placeFloorSize
  95. *
  96. * @var string
  97. */
  98. protected $placeFloorSize = '';
  99. /**
  100. * placeCapacity
  101. *
  102. * @var string
  103. */
  104. protected $placeCapacity = '';
  105. /**
  106. * city
  107. *
  108. * @var string
  109. */
  110. protected $city = '';
  111. /**
  112. * postalCode
  113. *
  114. * @var string
  115. */
  116. protected $postalCode = '';
  117. /**
  118. * streetAddress
  119. *
  120. * @var string
  121. */
  122. protected $streetAddress = '';
  123. /**
  124. * longitude
  125. *
  126. * @var float
  127. */
  128. protected $longitude = 0.0;
  129. /**
  130. * latitude
  131. *
  132. * @var float
  133. */
  134. protected $latitude = 0.0;
  135. /**
  136. * roomName
  137. *
  138. * @var string
  139. */
  140. protected $roomName = '';
  141. /**
  142. * roomDescription
  143. *
  144. * @var string
  145. */
  146. protected $roomDescription = '';
  147. /**
  148. * roomLocalisation
  149. *
  150. * @var string
  151. */
  152. protected $roomLocalisation = '';
  153. /**
  154. * roomCapacity
  155. *
  156. * @var string
  157. */
  158. protected $roomCapacity = '';
  159. /**
  160. * roomFloorSize
  161. *
  162. * @var string
  163. */
  164. protected $roomFloorSize = '';
  165. /**
  166. * zupId
  167. *
  168. * @var int
  169. */
  170. protected $zupId = 0;
  171. /**
  172. * deepLink
  173. *
  174. * @var string
  175. */
  176. protected $deepLink = '';
  177. /**
  178. * image
  179. *
  180. * @var string
  181. */
  182. protected $image = '';
  183. /**
  184. * priceMini
  185. *
  186. * @var float
  187. */
  188. protected $priceMini = 0.0;
  189. /**
  190. * meetingSchedule
  191. *
  192. * @var string
  193. */
  194. protected $meetingSchedule = '';
  195. /**
  196. * api
  197. *
  198. * @var bool
  199. */
  200. protected $api = false;
  201. /**
  202. * parentName
  203. *
  204. * @var string
  205. */
  206. protected $parentName = '';
  207. /**
  208. * parentSubdomain
  209. *
  210. * @var string
  211. */
  212. protected $parentSubdomain = '';
  213. /**
  214. * organization
  215. *
  216. * @var
  217. */
  218. protected $organization = null;
  219. /**
  220. * Returns the id
  221. *
  222. * @return int $id
  223. */
  224. public function getId()
  225. {
  226. return $this->id;
  227. }
  228. /**
  229. * Sets the id
  230. *
  231. * @param int $id
  232. * @return void
  233. */
  234. public function setId($id)
  235. {
  236. $this->id = $id;
  237. }
  238. /**
  239. * Returns the type
  240. *
  241. * @return string $type
  242. */
  243. public function getType()
  244. {
  245. return $this->type;
  246. }
  247. /**
  248. * Sets the type
  249. *
  250. * @param string $type
  251. * @return void
  252. */
  253. public function setType($type)
  254. {
  255. $this->type = $type;
  256. }
  257. /**
  258. * Returns the organizationId
  259. *
  260. * @return int $organizationId
  261. */
  262. public function getOrganizationId()
  263. {
  264. return $this->organizationId;
  265. }
  266. /**
  267. * Sets the organizationId
  268. *
  269. * @param int $organizationId
  270. * @return void
  271. */
  272. public function setOrganizationId($organizationId)
  273. {
  274. $this->organizationId = $organizationId;
  275. }
  276. /**
  277. * Returns the subdomain
  278. *
  279. * @return string $subdomain
  280. */
  281. public function getSubdomain()
  282. {
  283. return $this->subdomain;
  284. }
  285. /**
  286. * Sets the subdomain
  287. *
  288. * @param string $subdomain
  289. * @return void
  290. */
  291. public function setSubdomain($subdomain)
  292. {
  293. $this->subdomain = $subdomain;
  294. }
  295. /**
  296. * Returns the name
  297. *
  298. * @return string $name
  299. */
  300. public function getName()
  301. {
  302. return $this->name;
  303. }
  304. /**
  305. * Sets the name
  306. *
  307. * @param string $name
  308. * @return void
  309. */
  310. public function setName($name)
  311. {
  312. $this->name = $name;
  313. }
  314. /**
  315. * Returns the description
  316. *
  317. * @return string $description
  318. */
  319. public function getDescription()
  320. {
  321. return $this->description;
  322. }
  323. /**
  324. * Sets the description
  325. *
  326. * @param string $description
  327. * @return void
  328. */
  329. public function setDescription($description)
  330. {
  331. $this->description = $description;
  332. }
  333. /**
  334. * Returns the categories
  335. *
  336. * @return int $categories
  337. */
  338. public function getCategories()
  339. {
  340. return $this->categories;
  341. }
  342. /**
  343. * Sets the categories
  344. *
  345. * @param int $categories
  346. * @return void
  347. */
  348. public function setCategories($categories)
  349. {
  350. $this->categories = $categories;
  351. }
  352. /**
  353. * Returns the url
  354. *
  355. * @return string $url
  356. */
  357. public function getUrl()
  358. {
  359. return $this->url;
  360. }
  361. /**
  362. * Sets the url
  363. *
  364. * @param string $url
  365. * @return void
  366. */
  367. public function setUrl($url)
  368. {
  369. $this->url = $url;
  370. }
  371. /**
  372. * Returns the rule
  373. *
  374. * @return string $rule
  375. */
  376. public function getRule()
  377. {
  378. return $this->rule;
  379. }
  380. /**
  381. * Sets the rule
  382. *
  383. * @param string $rule
  384. * @return void
  385. */
  386. public function setRule($rule)
  387. {
  388. $this->rule = $rule;
  389. }
  390. /**
  391. * Returns the datetimeStart
  392. *
  393. * @return \DateTime $datetimeStart
  394. */
  395. public function getDatetimeStart()
  396. {
  397. return $this->datetimeStart;
  398. }
  399. /**
  400. * Sets the datetimeStart
  401. *
  402. * @param \DateTime $datetimeStart
  403. * @return void
  404. */
  405. public function setDatetimeStart(\DateTime $datetimeStart)
  406. {
  407. $this->datetimeStart = $datetimeStart;
  408. }
  409. /**
  410. * Returns the datetimeEnd
  411. *
  412. * @return \DateTime $datetimeEnd
  413. */
  414. public function getDatetimeEnd()
  415. {
  416. return $this->datetimeEnd;
  417. }
  418. /**
  419. * Sets the datetimeEnd
  420. *
  421. * @param \DateTime $datetimeEnd
  422. * @return void
  423. */
  424. public function setDatetimeEnd(\DateTime $datetimeEnd)
  425. {
  426. $this->datetimeEnd = $datetimeEnd;
  427. }
  428. /**
  429. * Returns the dates
  430. *
  431. * @return string $dates
  432. */
  433. public function getDates()
  434. {
  435. return $this->dates;
  436. }
  437. /**
  438. * Sets the dates
  439. *
  440. * @param string $dates
  441. * @return void
  442. */
  443. public function setDates($dates)
  444. {
  445. $this->dates = $dates;
  446. }
  447. /**
  448. * Returns the placename
  449. *
  450. * @return string $placename
  451. */
  452. public function getPlacename()
  453. {
  454. return $this->placename;
  455. }
  456. /**
  457. * Sets the placename
  458. *
  459. * @param string $placename
  460. * @return void
  461. */
  462. public function setPlacename($placename)
  463. {
  464. $this->placename = $placename;
  465. }
  466. /**
  467. * Returns the placeDescription
  468. *
  469. * @return string $placeDescription
  470. */
  471. public function getPlaceDescription()
  472. {
  473. return $this->placeDescription;
  474. }
  475. /**
  476. * Sets the placeDescription
  477. *
  478. * @param string $placeDescription
  479. * @return void
  480. */
  481. public function setPlaceDescription($placeDescription)
  482. {
  483. $this->placeDescription = $placeDescription;
  484. }
  485. /**
  486. * Returns the placeFloorSize
  487. *
  488. * @return string $placeFloorSize
  489. */
  490. public function getPlaceFloorSize()
  491. {
  492. return $this->placeFloorSize;
  493. }
  494. /**
  495. * Sets the placeFloorSize
  496. *
  497. * @param string $placeFloorSize
  498. * @return void
  499. */
  500. public function setPlaceFloorSize($placeFloorSize)
  501. {
  502. $this->placeFloorSize = $placeFloorSize;
  503. }
  504. /**
  505. * Returns the placeCapacity
  506. *
  507. * @return string $placeCapacity
  508. */
  509. public function getPlaceCapacity()
  510. {
  511. return $this->placeCapacity;
  512. }
  513. /**
  514. * Sets the placeCapacity
  515. *
  516. * @param string $placeCapacity
  517. * @return void
  518. */
  519. public function setPlaceCapacity($placeCapacity)
  520. {
  521. $this->placeCapacity = $placeCapacity;
  522. }
  523. /**
  524. * Returns the city
  525. *
  526. * @return string $city
  527. */
  528. public function getCity()
  529. {
  530. return $this->city;
  531. }
  532. /**
  533. * Sets the city
  534. *
  535. * @param string $city
  536. * @return void
  537. */
  538. public function setCity($city)
  539. {
  540. $this->city = $city;
  541. }
  542. /**
  543. * Returns the postalCode
  544. *
  545. * @return string $postalCode
  546. */
  547. public function getPostalCode()
  548. {
  549. return $this->postalCode;
  550. }
  551. /**
  552. * Sets the postalCode
  553. *
  554. * @param string $postalCode
  555. * @return void
  556. */
  557. public function setPostalCode($postalCode)
  558. {
  559. $this->postalCode = $postalCode;
  560. }
  561. /**
  562. * Returns the streetAddress
  563. *
  564. * @return string $streetAddress
  565. */
  566. public function getStreetAddress()
  567. {
  568. return $this->streetAddress;
  569. }
  570. /**
  571. * Sets the streetAddress
  572. *
  573. * @param string $streetAddress
  574. * @return void
  575. */
  576. public function setStreetAddress($streetAddress)
  577. {
  578. $this->streetAddress = $streetAddress;
  579. }
  580. /**
  581. * Returns the longitude
  582. *
  583. * @return float $longitude
  584. */
  585. public function getLongitude()
  586. {
  587. return $this->longitude;
  588. }
  589. /**
  590. * Sets the longitude
  591. *
  592. * @param float $longitude
  593. * @return void
  594. */
  595. public function setLongitude($longitude)
  596. {
  597. $this->longitude = $longitude;
  598. }
  599. /**
  600. * Returns the latitude
  601. *
  602. * @return float $latitude
  603. */
  604. public function getLatitude()
  605. {
  606. return $this->latitude;
  607. }
  608. /**
  609. * Sets the latitude
  610. *
  611. * @param float $latitude
  612. * @return void
  613. */
  614. public function setLatitude($latitude)
  615. {
  616. $this->latitude = $latitude;
  617. }
  618. /**
  619. * Returns the roomName
  620. *
  621. * @return string $roomName
  622. */
  623. public function getRoomName()
  624. {
  625. return $this->roomName;
  626. }
  627. /**
  628. * Sets the roomName
  629. *
  630. * @param string $roomName
  631. * @return void
  632. */
  633. public function setRoomName($roomName)
  634. {
  635. $this->roomName = $roomName;
  636. }
  637. /**
  638. * Returns the roomDescription
  639. *
  640. * @return string $roomDescription
  641. */
  642. public function getRoomDescription()
  643. {
  644. return $this->roomDescription;
  645. }
  646. /**
  647. * Sets the roomDescription
  648. *
  649. * @param string $roomDescription
  650. * @return void
  651. */
  652. public function setRoomDescription($roomDescription)
  653. {
  654. $this->roomDescription = $roomDescription;
  655. }
  656. /**
  657. * Returns the roomLocalisation
  658. *
  659. * @return string $roomLocalisation
  660. */
  661. public function getRoomLocalisation()
  662. {
  663. return $this->roomLocalisation;
  664. }
  665. /**
  666. * Sets the roomLocalisation
  667. *
  668. * @param string $roomLocalisation
  669. * @return void
  670. */
  671. public function setRoomLocalisation($roomLocalisation)
  672. {
  673. $this->roomLocalisation = $roomLocalisation;
  674. }
  675. /**
  676. * Returns the roomCapacity
  677. *
  678. * @return string $roomCapacity
  679. */
  680. public function getRoomCapacity()
  681. {
  682. return $this->roomCapacity;
  683. }
  684. /**
  685. * Sets the roomCapacity
  686. *
  687. * @param string $roomCapacity
  688. * @return void
  689. */
  690. public function setRoomCapacity($roomCapacity)
  691. {
  692. $this->roomCapacity = $roomCapacity;
  693. }
  694. /**
  695. * Returns the roomFloorSize
  696. *
  697. * @return string $roomFloorSize
  698. */
  699. public function getRoomFloorSize()
  700. {
  701. return $this->roomFloorSize;
  702. }
  703. /**
  704. * Sets the roomFloorSize
  705. *
  706. * @param string $roomFloorSize
  707. * @return void
  708. */
  709. public function setRoomFloorSize($roomFloorSize)
  710. {
  711. $this->roomFloorSize = $roomFloorSize;
  712. }
  713. /**
  714. * Returns the zupId
  715. *
  716. * @return int $zupId
  717. */
  718. public function getZupId()
  719. {
  720. return $this->zupId;
  721. }
  722. /**
  723. * Sets the zupId
  724. *
  725. * @param int $zupId
  726. * @return void
  727. */
  728. public function setZupId($zupId)
  729. {
  730. $this->zupId = $zupId;
  731. }
  732. /**
  733. * Returns the deepLink
  734. *
  735. * @return string $deepLink
  736. */
  737. public function getDeepLink()
  738. {
  739. return $this->deepLink;
  740. }
  741. /**
  742. * Sets the deepLink
  743. *
  744. * @param string $deepLink
  745. * @return void
  746. */
  747. public function setDeepLink($deepLink)
  748. {
  749. $this->deepLink = $deepLink;
  750. }
  751. /**
  752. * Returns the image
  753. *
  754. * @return string $image
  755. */
  756. public function getImage()
  757. {
  758. return $this->image;
  759. }
  760. /**
  761. * Sets the image
  762. *
  763. * @param string $image
  764. * @return void
  765. */
  766. public function setImage($image)
  767. {
  768. $this->image = $image;
  769. }
  770. /**
  771. * Returns the priceMini
  772. *
  773. * @return float $priceMini
  774. */
  775. public function getPriceMini()
  776. {
  777. return $this->priceMini;
  778. }
  779. /**
  780. * Sets the priceMini
  781. *
  782. * @param float $priceMini
  783. * @return void
  784. */
  785. public function setPriceMini($priceMini)
  786. {
  787. $this->priceMini = $priceMini;
  788. }
  789. /**
  790. * Returns the meetingSchedule
  791. *
  792. * @return string $meetingSchedule
  793. */
  794. public function getMeetingSchedule()
  795. {
  796. return $this->meetingSchedule;
  797. }
  798. /**
  799. * Sets the meetingSchedule
  800. *
  801. * @param string $meetingSchedule
  802. * @return void
  803. */
  804. public function setMeetingSchedule($meetingSchedule)
  805. {
  806. $this->meetingSchedule = $meetingSchedule;
  807. }
  808. /**
  809. * Returns the api
  810. *
  811. * @return bool $api
  812. */
  813. public function getApi()
  814. {
  815. return $this->api;
  816. }
  817. /**
  818. * Sets the api
  819. *
  820. * @param bool $api
  821. * @return void
  822. */
  823. public function setApi($api)
  824. {
  825. $this->api = $api;
  826. }
  827. /**
  828. * Returns the boolean state of api
  829. *
  830. * @return bool
  831. */
  832. public function isApi()
  833. {
  834. return $this->api;
  835. }
  836. /**
  837. * Returns the parentName
  838. *
  839. * @return string $parentName
  840. */
  841. public function getParentName()
  842. {
  843. return $this->parentName;
  844. }
  845. /**
  846. * Sets the parentName
  847. *
  848. * @param string $parentName
  849. * @return void
  850. */
  851. public function setParentName($parentName)
  852. {
  853. $this->parentName = $parentName;
  854. }
  855. /**
  856. * Returns the parentSubdomain
  857. *
  858. * @return string $parentSubdomain
  859. */
  860. public function getParentSubdomain()
  861. {
  862. return $this->parentSubdomain;
  863. }
  864. /**
  865. * Sets the parentSubdomain
  866. *
  867. * @param string $parentSubdomain
  868. * @return void
  869. */
  870. public function setParentSubdomain($parentSubdomain)
  871. {
  872. $this->parentSubdomain = $parentSubdomain;
  873. }
  874. /**
  875. * Returns the organization
  876. *
  877. * @return $organization
  878. */
  879. public function getOrganization()
  880. {
  881. return $this->organization;
  882. }
  883. /**
  884. * Sets the organization
  885. *
  886. * @param string $organization
  887. * @return void
  888. */
  889. public function setOrganization($organization)
  890. {
  891. $this->organization = $organization;
  892. }
  893. /**
  894. * Retourne une chaine formattée indiquant la date et l'heure de début et de fin de l'Event
  895. *
  896. * @return string
  897. */
  898. public function getFormattedDates() {
  899. if ($this->getDatetimeStart() & $this->getDatetimeEnd()) {
  900. if ($this->getDatetimeStart()->format('d-m-Y') != $this->getDatetimeEnd()->format('d-m-Y')) {
  901. return 'Du ' . $this->getDatetimeStart()->format('d/m/Y H\hi') . ' au ' . $this->getDatetimeEnd()->format('d/m/Y H\hi');
  902. } else {
  903. return 'Le ' . $this->getDatetimeStart()->format('d/m/Y') . ' de ' . $this->getDatetimeStart()->format('H\hi') . ' à ' . $this->getDatetimeEnd()->format('H\hi');
  904. }
  905. } else if ($this->getDatetimeStart()) {
  906. return 'A partir de ' . $this->getDatetimeStart()->format('d/m/Y H\hi');
  907. } else if ($this->getDatetimeEnd()) {
  908. return "Jusqu'à " . $this->getDatetimeEnd()->format('d/m/Y H\hi');
  909. }
  910. return '';
  911. }
  912. /**
  913. * Returns the short concatened location and date of the event
  914. *
  915. * @return string $datetimeStart
  916. */
  917. public function getLocAndDate() {
  918. $infos = [];
  919. if ($this->getPlacename() && $this->getCity() && ($this->getPlacename() !== $this->getCity())) {
  920. $infos[] = $this->getPlacename() . ' (' . $this->getCity() . ')';
  921. } else if ($this->getPlacename()) {
  922. $infos[] = $this->getPlacename();
  923. } else if ($this->getPlacename()) {
  924. $infos[] = $this->getCity();
  925. }
  926. $dates = $this->getFormattedDates();
  927. if ($dates !== '') {
  928. $infos[] = lcfirst($dates);
  929. }
  930. return ucfirst(join(', ', $infos));
  931. }
  932. /**
  933. * Returns the concateneted adress of the event
  934. *
  935. * @return string
  936. */
  937. public function getFullAdress() {
  938. $adress = [];
  939. if ($this->getPlaceName() &&
  940. strtolower($this->getPlaceName()) != strtolower($this->getStreetAddress()) &&
  941. strtolower($this->getPlaceName()) != strtolower($this->getCity())) {
  942. // On ajoute le nom du lieu, si ce n'est pas celui de la ville ou d'une adresse telle qu'une place
  943. $adress[] = $this->getPlaceName();
  944. }
  945. if ($this->getRoomName() !== null) {
  946. $adress[] = $this->getRoomName();
  947. }
  948. if ($this->getRoomLocalisation() !== null) {
  949. $adress[] = $this->getRoomLocalisation();
  950. }
  951. if ($this->getStreetAddress() !== null) {
  952. $adress[] = $this->getStreetAddress();
  953. }
  954. if ($this->getCity() !== null) {
  955. $pc = '';
  956. if ($this->getPostalCode() !== null) {
  957. $pc = $this->getPostalCode() . ' ';
  958. }
  959. $adress[] = $pc . $this->getCity();
  960. }
  961. return ucfirst(join(PHP_EOL, $adress));
  962. }
  963. /**
  964. * Returns an array containing all the data to display
  965. *
  966. * @return array
  967. */
  968. public function getInfosTable() {
  969. $infos = [];
  970. if ($this->getPlacename() !== null) {
  971. $infos['Lieu'] = $this->getPlacename();
  972. }
  973. if ($this->getPlacename() !== null) {
  974. $infos['Lieu'] = $this->getPlacename();
  975. }
  976. if ($this->getPlaceDescription() !== null) {
  977. $infos['Description du lieu'] = $this->getPlaceDescription();
  978. }
  979. $adress = $this->getFullAdress();
  980. if ($adress !== '') {
  981. $infos['Adresse'] = $adress;
  982. }
  983. if ($this->getUrl() !== null) {
  984. $infos['Lien externe'] = $this->getUrl();
  985. }
  986. return $infos;
  987. }
  988. /**
  989. * Returns an eluded description (max 100cars)
  990. *
  991. * @return string
  992. */
  993. public function getShortDescription() {
  994. $maxCars = 100;
  995. if (strlen($this->getDescription()) <= $maxCars) {
  996. return $this->getDescription();
  997. } else {
  998. return mb_substr($this->getDescription(), 0, $maxCars, "UTF-8") . '...';
  999. }
  1000. }
  1001. /**
  1002. * Returns a external url to get more informations
  1003. * about an event (child-structures events only)
  1004. */
  1005. public function getInfosLink() {
  1006. if (preg_match('#^((https?|ftp)://(\S*?\.\S*?))([\s)\[\]{},;"\':<]|\.\s|$)$#i', $this->getUrl()) == 1) {
  1007. return $this->getUrl();
  1008. } else {
  1009. return 'https://' . $this->getSubdomain() . '.opentalent.fr';
  1010. }
  1011. }
  1012. }