Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data Fields | Protected Member Functions
Swatch Class Reference
Inheritance diagram for Swatch:
AbstractModel DataObject

Data Fields

const SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT = 'swatch_text'
 
const SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT = 'swatch_visual'
 
const SWATCH_INPUT_TYPE_KEY = 'swatch_input_type'
 
const SWATCH_INPUT_TYPE_TEXT = 'text'
 
const SWATCH_INPUT_TYPE_VISUAL = 'visual'
 
const SWATCH_INPUT_TYPE_DROPDOWN = 'dropdown'
 
const SWATCH_TYPE_TEXTUAL = 0
 
const SWATCH_TYPE_VISUAL_COLOR = 1
 
const SWATCH_TYPE_VISUAL_IMAGE = 2
 
const SWATCH_TYPE_EMPTY = 3
 
const SWATCH_IMAGE_NAME = 'swatch_image'
 
const SWATCH_THUMBNAIL_NAME = 'swatch_thumb'
 

Protected Member Functions

 _construct ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Additional Inherited Members

- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

@api

Since
100.0.2

Definition at line 12 of file Swatch.php.

Member Function Documentation

◆ _construct()

_construct ( )
protected

Initialize resource model

@codeCoverageIgnore

Returns
void

Definition at line 60 of file Swatch.php.

61  {
62  $this->_init(\Magento\Swatches\Model\ResourceModel\Swatch::class);
63  }

Field Documentation

◆ SWATCH_IMAGE_NAME

const SWATCH_IMAGE_NAME = 'swatch_image'

Name of swatch image

Definition at line 47 of file Swatch.php.

◆ SWATCH_INPUT_TYPE_DROPDOWN

const SWATCH_INPUT_TYPE_DROPDOWN = 'dropdown'

Value for dropdown input type

Definition at line 30 of file Swatch.php.

◆ SWATCH_INPUT_TYPE_KEY

const SWATCH_INPUT_TYPE_KEY = 'swatch_input_type'

Swatch input type key in array to retrieve the value

Definition at line 21 of file Swatch.php.

◆ SWATCH_INPUT_TYPE_TEXT

const SWATCH_INPUT_TYPE_TEXT = 'text'

Value for text swatch input type

Definition at line 24 of file Swatch.php.

◆ SWATCH_INPUT_TYPE_VISUAL

const SWATCH_INPUT_TYPE_VISUAL = 'visual'

Value for visual swatch input type

Definition at line 27 of file Swatch.php.

◆ SWATCH_THUMBNAIL_NAME

const SWATCH_THUMBNAIL_NAME = 'swatch_thumb'

Name of swatch thumbnail

Definition at line 52 of file Swatch.php.

◆ SWATCH_TYPE_EMPTY

const SWATCH_TYPE_EMPTY = 3

Constant for identifying empty swatch type

Definition at line 42 of file Swatch.php.

◆ SWATCH_TYPE_TEXTUAL

const SWATCH_TYPE_TEXTUAL = 0

Constant for identifying textual swatch type

Definition at line 33 of file Swatch.php.

◆ SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT

const SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT = 'swatch_text'

Constant for identifying attribute frontend type for textual swatch

Definition at line 15 of file Swatch.php.

◆ SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT

const SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT = 'swatch_visual'

Constant for identifying attribute frontend type for visual swatch

Definition at line 18 of file Swatch.php.

◆ SWATCH_TYPE_VISUAL_COLOR

const SWATCH_TYPE_VISUAL_COLOR = 1

Constant for identifying visual swatch type with color number value

Definition at line 36 of file Swatch.php.

◆ SWATCH_TYPE_VISUAL_IMAGE

const SWATCH_TYPE_VISUAL_IMAGE = 2

Constant for identifying visual swatch type with color number value

Definition at line 39 of file Swatch.php.


The documentation for this class was generated from the following file: