Element.php 18KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. <?php
  2. namespace Muzich\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use \Doctrine\Common\Collections\ArrayCollection;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Doctrine\ORM\EntityManager;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Muzich\CoreBundle\Validator as MuzichAssert;
  9. use Muzich\CoreBundle\Entity\Tag;
  10. use Muzich\CoreBundle\Managers\CommentsManager;
  11. /**
  12. * L'Element est l'Element central de l'application. C'est cet
  13. * entité qui stocke le media partagé sur le réseau.
  14. *
  15. * @ORM\Entity
  16. * @ORM\Table(name="element")
  17. * @ORM\Entity(repositoryClass="Muzich\CoreBundle\Repository\ElementRepository")
  18. *
  19. */
  20. class Element
  21. {
  22. /**
  23. * Identifiant de l'objet externe
  24. * @var string
  25. */
  26. const DATA_REF_ID = "data_ref_id";
  27. /**
  28. * Identifiant de l'objet externe
  29. * @var string
  30. */
  31. const DATA_NORMALIZED_URL = "data_normalized_url";
  32. /**
  33. * Adresse HTTP(S) de la jaquette
  34. * @var string
  35. */
  36. const DATA_THUMB_URL = "data_thumb_url";
  37. /**
  38. * Titre de l'objet externe
  39. * @var string
  40. */
  41. const DATA_TITLE = "data_title";
  42. /**
  43. * Nom de l'artiste
  44. * @var string
  45. */
  46. const DATA_ARTIST = "data_artist";
  47. /**
  48. * Tags de l'objets externe array("tag1", "tag2", [...])
  49. * @var string
  50. */
  51. const DATA_TAGS = "data_tags";
  52. /**
  53. * Type de l'objet track|album|
  54. * @var string
  55. */
  56. const DATA_TYPE = "data_type";
  57. /**
  58. * Contenu téléchargeable ?
  59. * @var string
  60. */
  61. const DATA_DOWNLOAD = "data_download";
  62. /**
  63. * Adresse du contenu téléchargeable
  64. * @var string
  65. */
  66. const DATA_DOWNLOAD_URL = "data_download_url";
  67. /**
  68. * Don possible ?
  69. * @var string
  70. */
  71. const DATA_GIFT = "data_gift";
  72. /**
  73. * Adresse pour effectuer un don
  74. * @var string
  75. */
  76. const DATA_GIFT_URL = "data_gift_url";
  77. /**
  78. * @ORM\Id
  79. * @ORM\Column(type="integer")
  80. * @ORM\GeneratedValue(strategy="AUTO")
  81. * @var type int
  82. */
  83. protected $id;
  84. /**
  85. * Cet attribut stocke le type d'élément.
  86. *
  87. * @ORM\Column(type="string", length=64)
  88. * @Assert\NotBlank()
  89. * @Assert\Length(max = 255)
  90. */
  91. protected $type;
  92. /**
  93. * Cet attribut stocke la liste des tags liés a cet élément.
  94. *
  95. * @ORM\ManyToMany(targetEntity="Tag", inversedBy="elements")
  96. * @ORM\JoinTable(name="elements_tag")
  97. */
  98. private $tags;
  99. /**
  100. * Propriétaire de l'élément
  101. *
  102. * @ORM\ManyToOne(targetEntity="User", inversedBy="elements")
  103. * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  104. */
  105. protected $owner;
  106. /**
  107. * Objet parent (si a été repartagé)
  108. *
  109. * @ORM\ManyToOne(targetEntity="Element", inversedBy="childs")
  110. * @ORM\JoinColumn(name="element_parent_id", referencedColumnName="id")
  111. */
  112. protected $parent;
  113. /**
  114. * Liste des Elements qui on reshare cet element
  115. *
  116. * @ORM\OneToMany(targetEntity="Element", mappedBy="parent")
  117. */
  118. protected $childs;
  119. /**
  120. * Groupe de l'élément
  121. *
  122. * @ORM\ManyToOne(targetEntity="Group", inversedBy="elements")
  123. * @ORM\JoinColumn(name="group_id", referencedColumnName="id")
  124. * @MuzichAssert\GroupOwnedOrPublic()
  125. */
  126. protected $group = null;
  127. /**
  128. * Cet attribu stocke les enregistrements UsersElementsFavorites liés
  129. * a ce Tag dans le cadre des Elements favoris.
  130. *
  131. * @ORM\OneToMany(targetEntity="UsersElementsFavorites", mappedBy="element")
  132. */
  133. protected $elements_favorites;
  134. /**
  135. * Propositions de tags
  136. *
  137. * @ORM\OneToMany(targetEntity="ElementTagsProposition", mappedBy="element")
  138. */
  139. protected $tags_propositions;
  140. /**
  141. * Permet de savoir sans faire de gros calculs en base si il y a des
  142. * propositions de tags en cours sur cet élément.
  143. *
  144. * @ORM\Column(type="boolean", nullable = true)
  145. * @var type string
  146. */
  147. protected $has_tags_proposition = false;
  148. /**
  149. * L'url est l'url du media.
  150. *
  151. * @ORM\Column(type="string", length=1024)
  152. * @Assert\NotBlank(message = "error.element.url.notblank")
  153. * @Assert\Length(max = 1024, maxMessage="error.element.url.tolong|error.element.url.tolong")
  154. * @Assert\Url(message = "error.element.url.invalid")
  155. * @var type string
  156. */
  157. protected $url;
  158. /**
  159. * Libellé du media
  160. *
  161. * @ORM\Column(type = "string", length = 128)
  162. * @Assert\NotBlank(message = "error.element.name.notblank")
  163. * @Assert\Length(min = 3, max = 84, minMessage = "error.element.name.toshort|error.element.name.toshort", maxMessage = "error.element.name.tolong|error.element.name.tolong")
  164. * @var type string
  165. */
  166. protected $name;
  167. /**
  168. * Code d'embed
  169. *
  170. * @ORM\Column(type="text", nullable=true)
  171. * @var type string
  172. */
  173. protected $embed;
  174. /**
  175. * @var datetime $created
  176. *
  177. * @Gedmo\Timestampable(on="create")
  178. * @ORM\Column(type="datetime")
  179. */
  180. private $created;
  181. /**
  182. * @var datetime $updated
  183. *
  184. * @ORM\Column(type="datetime")
  185. * @Gedmo\Timestampable(on="update")
  186. */
  187. private $updated;
  188. /**
  189. * @var string $thumbnail_url
  190. *
  191. * @ORM\Column(type="string", length=512, nullable=true)
  192. */
  193. protected $thumbnail_url;
  194. /**
  195. * Commentaires stocké au format json
  196. *
  197. * array(
  198. * array(
  199. * "u" => array( // Des infos sur l'utilisateur auteur du commentaire
  200. * "i" => "IdDuUser", // l'id
  201. * "s" => "LeSlugDuUser", // le slug
  202. * "n" => "NameDuUser" // le name
  203. * ),
  204. * "d" => "LaDate", // Date au format Y-m-d H:i:s
  205. * "c" => "Comment" // Le commentaire
  206. * ),
  207. * [...]
  208. * );
  209. *
  210. * @ORM\Column(type="text", nullable=true)
  211. * @var type string
  212. */
  213. protected $comments;
  214. /**
  215. * Compteur de signalements
  216. *
  217. * @ORM\Column(type="integer", nullable=true)
  218. * @var int
  219. */
  220. protected $count_report;
  221. /**
  222. * @ORM\Column(type="boolean", nullable=false)
  223. * @var int
  224. */
  225. protected $reported = false;
  226. /**
  227. * array json des id users ayant reporté l'élément
  228. *
  229. * @ORM\Column(type="text", nullable=true)
  230. * @var string
  231. */
  232. protected $report_ids;
  233. /**
  234. * array json des id users ayant voté +1
  235. *
  236. * @ORM\Column(type="text", nullable=true)
  237. * @var string
  238. */
  239. protected $vote_good_ids;
  240. /**
  241. * Compteur de points
  242. *
  243. * @ORM\Column(type="integer", nullable=true)
  244. * @var int
  245. */
  246. protected $points;
  247. /**
  248. * Booléen permettant de savoir si un des commentaires de cet élément
  249. * a été signalé a la modération.
  250. *
  251. * @ORM\Column(type="integer", nullable=true)
  252. * @var int
  253. */
  254. protected $count_comment_report = false;
  255. /**
  256. * Données de l'objet chez le service externe
  257. *
  258. * @ORM\Column(type="text", nullable=true)
  259. * @var type string
  260. */
  261. protected $datas;
  262. /**
  263. *
  264. * @ORM\Column(type="boolean", nullable=true)
  265. * @var boolean
  266. */
  267. protected $need_tags = false;
  268. /**
  269. * Get id
  270. *
  271. * @return integer
  272. */
  273. public function getId()
  274. {
  275. return $this->id;
  276. }
  277. /**
  278. * Set url
  279. *
  280. * @param string $url
  281. */
  282. public function setUrl($url)
  283. {
  284. $this->url = $url;
  285. }
  286. /**
  287. * Get url
  288. *
  289. * @return string
  290. */
  291. public function getUrl()
  292. {
  293. return $this->url;
  294. }
  295. /**
  296. * Set name
  297. *
  298. * @param string $name
  299. */
  300. public function setName($name)
  301. {
  302. $this->name = $name;
  303. }
  304. /**
  305. * Get name
  306. *
  307. * @return string
  308. */
  309. public function getName()
  310. {
  311. return $this->name;
  312. }
  313. /**
  314. * Set type
  315. *
  316. * @param string $type
  317. */
  318. public function setType($type)
  319. {
  320. $this->type = $type;
  321. }
  322. /**
  323. * Get type
  324. *
  325. * @return string
  326. */
  327. public function getType()
  328. {
  329. return $this->type;
  330. }
  331. public function __construct($url = null)
  332. {
  333. //$this->tags = new ArrayCollection();
  334. $this->url = $url;
  335. }
  336. public function __toString()
  337. {
  338. return $this->name;
  339. }
  340. /**
  341. * Add tags
  342. *
  343. * @param Tag $tags
  344. */
  345. public function addTag(Tag $tags)
  346. {
  347. $this->tags[] = $tags;
  348. }
  349. /**
  350. * Get tags
  351. *
  352. * @return Doctrine\Common\Collections\Collection
  353. */
  354. public function getTags()
  355. {
  356. return $this->tags;
  357. }
  358. public function getTagsIdsJson()
  359. {
  360. $ids = array();
  361. if (count($this->getTags()))
  362. {
  363. foreach ($this->getTags() as $tag)
  364. {
  365. $ids[] = $tag->getId();
  366. }
  367. }
  368. return json_encode($ids);
  369. }
  370. public function setTags($tags)
  371. {
  372. $this->tags = $tags;
  373. }
  374. /**
  375. *
  376. * @param Collection|Array $tags
  377. */
  378. public function addTags($tags)
  379. {
  380. foreach ($tags as $tag)
  381. {
  382. $this->addTag($tag);
  383. }
  384. }
  385. /**
  386. * Set owner
  387. *
  388. * @param User $owner
  389. */
  390. public function setOwner(User $owner)
  391. {
  392. $this->owner = $owner;
  393. }
  394. /**
  395. * Get owner
  396. *
  397. * @return User
  398. */
  399. public function getOwner()
  400. {
  401. return $this->owner;
  402. }
  403. /**
  404. * Add elements_favorites
  405. *
  406. * @param UsersElementsFavorites $elementsFavorites
  407. */
  408. public function addUsersElementsFavorites(UsersElementsFavorites $elementsFavorites)
  409. {
  410. $this->elements_favorites[] = $elementsFavorites;
  411. }
  412. /**
  413. * Get elements_favorites
  414. *
  415. * @return Doctrine\Common\Collections\Collection
  416. */
  417. public function getElementsFavorites()
  418. {
  419. return $this->elements_favorites;
  420. }
  421. /**
  422. * Set group
  423. *
  424. * @param Group $group
  425. */
  426. public function setGroup($group)
  427. {
  428. $this->group = $group;
  429. }
  430. /**
  431. * Get group
  432. *
  433. * @return Group
  434. */
  435. public function getGroup()
  436. {
  437. return $this->group;
  438. }
  439. /**
  440. * Set embed
  441. *
  442. * @param string $code
  443. */
  444. public function setEmbed($code)
  445. {
  446. $this->embed = $code;
  447. }
  448. /**
  449. * Get embed
  450. *
  451. * @return string
  452. */
  453. public function getEmbed()
  454. {
  455. return $this->embed;
  456. }
  457. /**
  458. * Set created
  459. *
  460. * @param date $created
  461. */
  462. public function setCreated($created)
  463. {
  464. $this->created = $created;
  465. }
  466. /**
  467. * Get created
  468. *
  469. * @return date
  470. */
  471. public function getCreated()
  472. {
  473. return $this->created;
  474. }
  475. /**
  476. * Set updated
  477. *
  478. * @param datetime $updated
  479. */
  480. public function setUpdated($updated)
  481. {
  482. $this->updated = $updated;
  483. }
  484. /**
  485. * Get updated
  486. *
  487. * @return datetime
  488. */
  489. public function getUpdated()
  490. {
  491. return $this->updated;
  492. }
  493. /**
  494. * Set thumbnail url
  495. *
  496. * @param string $thumbnail_url
  497. */
  498. public function setThumbnailUrl($thumbnail_url)
  499. {
  500. $this->thumbnail_url = $thumbnail_url;
  501. }
  502. /**
  503. * Get thumbnail url
  504. *
  505. * @return datetime
  506. */
  507. public function getThumbnailUrl()
  508. {
  509. return $this->thumbnail_url;
  510. }
  511. /**
  512. *
  513. * @return type array
  514. */
  515. public function getComments()
  516. {
  517. return json_decode($this->comments, true);
  518. }
  519. public function getCountReport()
  520. {
  521. return $this->count_report;
  522. }
  523. public function setCountReport($count)
  524. {
  525. $this->count_report = $count;
  526. if ($count)
  527. {
  528. $this->setReported(true);
  529. }
  530. else
  531. {
  532. $this->setReported(false);
  533. }
  534. }
  535. public function setReported($reported)
  536. {
  537. $this->reported = $reported;
  538. }
  539. public function getReported()
  540. {
  541. return $this->reported;
  542. }
  543. public function getReportIds()
  544. {
  545. return json_decode($this->report_ids, true);
  546. }
  547. public function setReportIds($report_ids)
  548. {
  549. $this->report_ids = json_encode($report_ids);
  550. }
  551. /**
  552. *
  553. * @param array $comments
  554. */
  555. public function setComments($comments)
  556. {
  557. $this->comments = json_encode($comments);
  558. }
  559. /**
  560. *
  561. * @return type array
  562. */
  563. public function getDatas()
  564. {
  565. if ($this->datas === null)
  566. {
  567. return array();
  568. }
  569. return json_decode($this->datas, true);
  570. }
  571. /**
  572. *
  573. * @param string $data_id
  574. * @return all
  575. */
  576. public function getData($data_id)
  577. {
  578. $datas = $this->getDatas();
  579. if (array_key_exists($data_id, $datas))
  580. {
  581. return $datas[$data_id];
  582. }
  583. return null;
  584. }
  585. /**
  586. *
  587. * @param array $datas
  588. */
  589. public function setDatas($datas)
  590. {
  591. $this->datas = json_encode($datas);
  592. }
  593. /**
  594. *
  595. * @param string $data_id
  596. * @param all $data_value
  597. */
  598. public function setData($data_id, $data_value)
  599. {
  600. $datas = $this->getDatas();
  601. $datas[$data_id] = $data_value;
  602. $this->setDatas($datas);
  603. }
  604. public function setHasTagProposition($has_prop)
  605. {
  606. $this->has_tags_proposition = $has_prop;
  607. }
  608. public function hasTagProposition()
  609. {
  610. if ($this->has_tags_proposition === null)
  611. {
  612. return false;
  613. }
  614. return $this->has_tags_proposition;
  615. }
  616. public function getTagsProposition()
  617. {
  618. return $this->tags_propositions;
  619. }
  620. public function setTagsPRopositions($propositions)
  621. {
  622. $this->tags_propositions = $propositions;
  623. }
  624. public function getCountCommentReport()
  625. {
  626. return $this->count_comment_report;
  627. }
  628. public function setCountCommentReport($count)
  629. {
  630. $this->count_comment_report = $count;
  631. }
  632. /**
  633. * Etablie des relation vers des tags.
  634. * (Supprime les anciens tags, au niveau de l'objet seulement)
  635. *
  636. * @param array $ids
  637. */
  638. public function setTagsWithIds(EntityManager $em, $ids)
  639. {
  640. $this->tags = null;
  641. if (count($ids))
  642. {
  643. $tags = $em->getRepository('MuzichCoreBundle:Tag')->findByIds($ids)->execute();
  644. // Pour les nouveaux ids restants
  645. foreach ($tags as $tag)
  646. {
  647. $this->addTag($tag);
  648. }
  649. }
  650. }
  651. // /**
  652. // * Retourne le nombre de fois que cet élément a été msi en favoris
  653. // *
  654. // * @return int
  655. // */
  656. // public function getCountFavorite()
  657. // {
  658. // return count($this->elements_favorites);
  659. // }
  660. public function hasFavoriteUser($user_id)
  661. {
  662. if (count($this->elements_favorites))
  663. {
  664. foreach ($this->elements_favorites as $favorite)
  665. {
  666. if ($favorite->getUser()->getId() == $user_id)
  667. {
  668. return true;
  669. }
  670. }
  671. }
  672. return false;
  673. }
  674. public function setGroupToId()
  675. {
  676. $this->group = $this->group->getId();
  677. }
  678. // public function deleteTag(Tag $tag)
  679. // {
  680. // $this->tags->removeElement($tag);
  681. // }
  682. /**
  683. * Répond vrai si le tag transmis fait partis des tags de l'élément
  684. *
  685. * @param Tag $tag_t
  686. * @return boolean
  687. */
  688. public function hasTag(Tag $tag_t)
  689. {
  690. foreach ($this->getTags() as $tag)
  691. {
  692. if ($tag_t->getId() == $tag->getId())
  693. {
  694. return true;
  695. }
  696. }
  697. return false;
  698. }
  699. public function getPoints()
  700. {
  701. if ($this->points === null)
  702. {
  703. return '0';
  704. }
  705. return $this->points;
  706. }
  707. public function setPoints($points)
  708. {
  709. $this->points = $points;
  710. }
  711. public function getVoteGoodIds()
  712. {
  713. return json_decode($this->vote_good_ids, true);
  714. }
  715. public function setVoteGoodIds($votes_ids)
  716. {
  717. $this->vote_good_ids = json_encode($votes_ids);
  718. }
  719. /**
  720. * ajoute le vote de l'user_id aux votes good
  721. *
  722. * @param int $user_id
  723. */
  724. public function addVoteGood($user_id)
  725. {
  726. $votes = $this->getVoteGoodIds();
  727. if (!count($votes))
  728. {
  729. $votes = array();
  730. }
  731. if (!$this->hasVoteGood($user_id))
  732. {
  733. $votes[] = (string)$user_id;
  734. $this->setPoints(count($votes));
  735. }
  736. $this->setVoteGoodIds($votes);
  737. }
  738. /**
  739. * Retire le vote_good de l'user_id
  740. *
  741. * @param int $user_id
  742. */
  743. public function removeVoteGood($user_id)
  744. {
  745. if (count($votes = $this->getVoteGoodIds()))
  746. {
  747. $votes_n = array();
  748. foreach ($votes as $id)
  749. {
  750. if ($id != $user_id)
  751. {
  752. $votes_n[] = (string)$id;
  753. }
  754. }
  755. $this->setPoints(count($votes_n));
  756. $this->setVoteGoodIds($votes_n);
  757. }
  758. }
  759. /**
  760. * Répond vrai si l'user_id a déjà voté good.
  761. *
  762. * @param int $user_id
  763. * @return boolean
  764. */
  765. public function hasVoteGood($user_id)
  766. {
  767. if (count($votes = $this->getVoteGoodIds()))
  768. {
  769. foreach ($votes as $id)
  770. {
  771. if ($id == $user_id)
  772. {
  773. return true;
  774. }
  775. }
  776. }
  777. return false;
  778. }
  779. /**
  780. * Retourne vrai si l'utilisateur a demandé qa suivre les commentaires
  781. *
  782. * @param int $user_id identifiant de l'utilisateur
  783. * @return boolean
  784. */
  785. public function userFollowComments($user_id)
  786. {
  787. $cm = new CommentsManager($this->getComments());
  788. return $cm->userFollow($user_id);
  789. }
  790. /**
  791. *
  792. * @param Element $element
  793. */
  794. public function setParent(Element $element = null)
  795. {
  796. $this->parent = $element;
  797. }
  798. /**
  799. *
  800. * @return Element
  801. */
  802. public function getParent()
  803. {
  804. return $this->parent;
  805. }
  806. public function setChilds($elements)
  807. {
  808. $this->childs = $elements;
  809. }
  810. public function getChilds()
  811. {
  812. return $this->childs;
  813. }
  814. /**
  815. *
  816. * @param boolean $need
  817. */
  818. public function setNeedTags($need)
  819. {
  820. if ($need)
  821. {
  822. $this->need_tags = true;
  823. }
  824. else
  825. {
  826. $this->need_tags = false;
  827. }
  828. }
  829. /**
  830. *
  831. * @return boolean
  832. */
  833. public function getNeedTags()
  834. {
  835. if ($this->need_tags)
  836. {
  837. return true;
  838. }
  839. return false;
  840. }
  841. public function getProposedName()
  842. {
  843. if (($title = $this->getData(self::DATA_TITLE)))
  844. {
  845. if (($artist = $this->getData(self::DATA_ARTIST)))
  846. {
  847. $artist = ' - '.$artist;
  848. }
  849. return $title.$artist;
  850. }
  851. return null;
  852. }
  853. /**
  854. *
  855. * @return type
  856. */
  857. public function getProposedTags()
  858. {
  859. if (count($tags = $this->getData(self::DATA_TAGS)))
  860. {
  861. return $tags;
  862. }
  863. return array();
  864. }
  865. public function getRefId($api_context = false)
  866. {
  867. if ($api_context && $this->getType() == 'soundcloud.com')
  868. {
  869. return $this->getData(self::DATA_NORMALIZED_URL);
  870. }
  871. return $this->getData(self::DATA_REF_ID);
  872. }
  873. public function hasTagsProposition()
  874. {
  875. if (count($this->tags_propositions))
  876. {
  877. return true;
  878. }
  879. return false;
  880. }
  881. public function getHasTagsProposition()
  882. {
  883. return $this->hasTagsProposition();
  884. }
  885. }