Swatch.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Swatches\Model;
  7. /**
  8. * @api
  9. * @since 100.0.2
  10. */
  11. class Swatch extends \Magento\Framework\Model\AbstractModel
  12. {
  13. /** Constant for identifying attribute frontend type for textual swatch */
  14. const SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT = 'swatch_text';
  15. /** Constant for identifying attribute frontend type for visual swatch */
  16. const SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT = 'swatch_visual';
  17. /** Swatch input type key in array to retrieve the value */
  18. const SWATCH_INPUT_TYPE_KEY = 'swatch_input_type';
  19. /** Value for text swatch input type */
  20. const SWATCH_INPUT_TYPE_TEXT = 'text';
  21. /** Value for visual swatch input type */
  22. const SWATCH_INPUT_TYPE_VISUAL = 'visual';
  23. /** Value for dropdown input type */
  24. const SWATCH_INPUT_TYPE_DROPDOWN = 'dropdown';
  25. /** Constant for identifying textual swatch type */
  26. const SWATCH_TYPE_TEXTUAL = 0;
  27. /** Constant for identifying visual swatch type with color number value */
  28. const SWATCH_TYPE_VISUAL_COLOR = 1;
  29. /** Constant for identifying visual swatch type with color number value */
  30. const SWATCH_TYPE_VISUAL_IMAGE = 2;
  31. /** Constant for identifying empty swatch type */
  32. const SWATCH_TYPE_EMPTY = 3;
  33. /**
  34. * Name of swatch image
  35. */
  36. const SWATCH_IMAGE_NAME = 'swatch_image';
  37. /**
  38. * Name of swatch thumbnail
  39. */
  40. const SWATCH_THUMBNAIL_NAME = 'swatch_thumb';
  41. /**
  42. * Initialize resource model
  43. *
  44. * @codeCoverageIgnore
  45. * @return void
  46. */
  47. protected function _construct()
  48. {
  49. $this->_init(\Magento\Swatches\Model\ResourceModel\Swatch::class);
  50. }
  51. }