vendor/pimcore/pimcore/models/Document/Editable/Select.php line 23

Open in your IDE?
  1. <?php
  2. /**
  3. * Pimcore
  4. *
  5. * This source file is available under two different licenses:
  6. * - GNU General Public License version 3 (GPLv3)
  7. * - Pimcore Commercial License (PCL)
  8. * Full copyright and license information is available in
  9. * LICENSE.md which is distributed with this source code.
  10. *
  11. * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12. * @license http://www.pimcore.org/license GPLv3 and PCL
  13. */
  14. namespace Pimcore\Model\Document\Editable;
  15. use Pimcore\Model;
  16. /**
  17. * @method \Pimcore\Model\Document\Editable\Dao getDao()
  18. */
  19. class Select extends Model\Document\Editable
  20. {
  21. /**
  22. * Contains the current selected value
  23. *
  24. * @internal
  25. *
  26. * @var string|null
  27. */
  28. protected $text;
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function getType()
  33. {
  34. return 'select';
  35. }
  36. /**
  37. * @return mixed
  38. */
  39. public function getData()
  40. {
  41. return $this->text;
  42. }
  43. /**
  44. * @return string
  45. */
  46. public function getText()
  47. {
  48. return $this->getData();
  49. }
  50. /**
  51. * {@inheritdoc}
  52. */
  53. public function frontend()
  54. {
  55. return $this->text;
  56. }
  57. /**
  58. * {@inheritdoc}
  59. */
  60. public function setDataFromResource($data)
  61. {
  62. $this->text = $data;
  63. return $this;
  64. }
  65. /**
  66. * {@inheritdoc}
  67. */
  68. public function setDataFromEditmode($data)
  69. {
  70. $this->text = $data;
  71. return $this;
  72. }
  73. /**
  74. * {@inheritdoc}
  75. */
  76. public function isEmpty()
  77. {
  78. return empty($this->text);
  79. }
  80. }