Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Bookmark Class Reference
Inheritance diagram for Bookmark:
AbstractExtensibleModel BookmarkInterface AbstractModel CustomAttributesDataInterface BookmarkExtensionInterface DataObject ExtensibleDataInterface ExtensionAttributesInterface

Public Member Functions

 __construct (Context $context, Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, ResourceBookmark $resource, Collection $resourceCollection, DecoderInterface $jsonDecoder, array $data=[], \Magento\Framework\Serialize\Serializer\Json $serializer=null)
 
 getId ()
 
 getUserId ()
 
 getNamespace ()
 
 getIdentifier ()
 
 isCurrent ()
 
 getTitle ()
 
 getConfig ()
 
 getCreatedAt ()
 
 getUpdatedAt ()
 
 setId ($id)
 
 setUserId ($userId)
 
 setNamespace ($namespace)
 
 setIdentifier ($identifier)
 
 setCurrent ($isCurrent)
 
 setTitle ($title)
 
 setConfig ($config)
 
 setCreatedAt ($createdAt)
 
 setUpdatedAt ($updatedAt)
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Ui\Api\Data\BookmarkExtensionInterface $extensionAttributes)
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- 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)
 
- Public Member Functions inherited from BookmarkInterface
 setExtensionAttributes (\Magento\Ui\Api\Data\BookmarkExtensionInterface $extensionAttributes)
 

Protected Attributes

 $jsonDecoder
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- 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 = []
 

Additional Inherited Members

- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from BookmarkInterface
const BOOKMARK_ID = 'bookmark_id'
 
const USER_ID = 'user_id'
 
const BOOKMARKSPACE = 'namespace'
 
const IDENTIFIER = 'identifier'
 
const TITLE = 'title'
 
const CONFIG = 'config'
 
const CREATED_AT = 'created_at'
 
const UPDATED_AT = 'updated_at'
 
const CURRENT = 'current'
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- 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)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Domain class Bookmark @codeCoverageIgnore

Definition at line 22 of file Bookmark.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Context  $context,
Registry  $registry,
ExtensionAttributesFactory  $extensionFactory,
AttributeValueFactory  $customAttributeFactory,
ResourceBookmark  $resource,
Collection  $resourceCollection,
DecoderInterface  $jsonDecoder,
array  $data = [],
\Magento\Framework\Serialize\Serializer\Json  $serializer = null 
)
Parameters
Context$context
Registry$registry
ExtensionAttributesFactory$extensionFactory
AttributeValueFactory$customAttributeFactory
ResourceBookmark$resource
Collection$resourceCollection
DecoderInterface$jsonDecoder
array$data
\Magento\Framework\Serialize\Serializer\Json | null$serializer
Exceptions

Definition at line 47 of file Bookmark.php.

57  {
58  $this->jsonDecoder = $jsonDecoder;
60  ->get(\Magento\Framework\Serialize\Serializer\Json::class);
61  parent::__construct(
62  $context,
63  $registry,
64  $extensionFactory,
66  $resource,
67  $resourceCollection,
68  $data
69  );
70  }
$resource
Definition: bulk.php:12

Member Function Documentation

◆ getConfig()

getConfig ( )

Get config

Returns
array

Implements BookmarkInterface.

Definition at line 137 of file Bookmark.php.

138  {
139  $config = $this->getData(self::CONFIG);
140  if ($config) {
141  return $this->serializer->unserialize($config);
142  }
143  return [];
144  }
$config
Definition: fraud_order.php:17

◆ getCreatedAt()

getCreatedAt ( )

Get created at

Returns
string

Implements BookmarkInterface.

Definition at line 151 of file Bookmark.php.

152  {
153  return $this->getData(self::CREATED_AT);
154  }

◆ getExtensionAttributes()

getExtensionAttributes ( )

{Retrieve existing extension attributes object or create a new one

Returns
\Magento\Ui\Api\Data\BookmarkExtensionInterface|null
}

Returns
\Magento\Ui\Api\Data\BookmarkExtensionInterface|null

Implements BookmarkInterface.

Definition at line 270 of file Bookmark.php.

◆ getId()

getId ( )

Get Id

Returns
int

Implements BookmarkInterface.

Definition at line 77 of file Bookmark.php.

78  {
79  return $this->getData(self::BOOKMARK_ID);
80  }

◆ getIdentifier()

getIdentifier ( )

Get identifier

Returns
string

Implements BookmarkInterface.

Definition at line 107 of file Bookmark.php.

108  {
109  return $this->getData(self::IDENTIFIER);
110  }

◆ getNamespace()

getNamespace ( )

Get namespace

Returns
string

Implements BookmarkInterface.

Definition at line 97 of file Bookmark.php.

98  {
99  return $this->getData(self::BOOKMARKSPACE);
100  }

◆ getTitle()

getTitle ( )

Get title

Returns
string

Implements BookmarkInterface.

Definition at line 127 of file Bookmark.php.

128  {
129  return $this->getData(self::TITLE);
130  }

◆ getUpdatedAt()

getUpdatedAt ( )

Get updated at

Returns
string

Implements BookmarkInterface.

Definition at line 161 of file Bookmark.php.

162  {
163  return $this->getData(self::UPDATED_AT);
164  }

◆ getUserId()

getUserId ( )

Get user Id

Returns
int

Implements BookmarkInterface.

Definition at line 87 of file Bookmark.php.

88  {
89  return $this->getData(self::USER_ID);
90  }

◆ isCurrent()

isCurrent ( )

Is current

Returns
bool

Implements BookmarkInterface.

Definition at line 117 of file Bookmark.php.

118  {
119  return (bool)$this->getData(self::CURRENT);
120  }

◆ setConfig()

setConfig (   $config)

Set config

Parameters
string$config
Returns
$this

Implements BookmarkInterface.

Definition at line 238 of file Bookmark.php.

239  {
240  return $this->setData(self::CONFIG, $config);
241  }
$config
Definition: fraud_order.php:17

◆ setCreatedAt()

setCreatedAt (   $createdAt)

Set created at

Parameters
string$createdAt
Returns
$this

Implements BookmarkInterface.

Definition at line 249 of file Bookmark.php.

250  {
251  return $this->setData(self::CREATED_AT, $createdAt);
252  }

◆ setCurrent()

setCurrent (   $isCurrent)

Set current

Parameters
bool$isCurrent
Returns
$this

Implements BookmarkInterface.

Definition at line 216 of file Bookmark.php.

217  {
218  return $this->setData(self::CURRENT, $isCurrent);
219  }

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Ui\Api\Data\BookmarkExtensionInterface  $extensionAttributes)

{}

Parameters
\Magento\Ui\Api\Data\BookmarkExtensionInterface$extensionAttributes
Returns
$this

Definition at line 281 of file Bookmark.php.

282  {
284  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setId()

setId (   $id)

Set Id

Parameters
int$id
Returns
$this

Implements BookmarkInterface.

Definition at line 172 of file Bookmark.php.

173  {
174  return $this->setData(self::BOOKMARK_ID, $id);
175  }
$id
Definition: fieldset.phtml:14

◆ setIdentifier()

setIdentifier (   $identifier)

Set identifier

Parameters
string$identifier
Returns
$this

Implements BookmarkInterface.

Definition at line 205 of file Bookmark.php.

206  {
207  return $this->setData(self::IDENTIFIER, $identifier);
208  }

◆ setNamespace()

setNamespace (   $namespace)

Set namespace

Parameters
string$namespace
Returns
$this

Implements BookmarkInterface.

Definition at line 194 of file Bookmark.php.

195  {
196  return $this->setData(self::BOOKMARKSPACE, $namespace);
197  }

◆ setTitle()

setTitle (   $title)

Set title

Parameters
string$title
Returns
$this

Implements BookmarkInterface.

Definition at line 227 of file Bookmark.php.

228  {
229  return $this->setData(self::TITLE, $title);
230  }
$title
Definition: default.phtml:14

◆ setUpdatedAt()

setUpdatedAt (   $updatedAt)

Set updated at

Parameters
string$updatedAt
Returns
$this

Implements BookmarkInterface.

Definition at line 260 of file Bookmark.php.

261  {
262  return $this->setData(self::UPDATED_AT, $updatedAt);
263  }

◆ setUserId()

setUserId (   $userId)

Set user Id

Parameters
int$userId
Returns
$this

Implements BookmarkInterface.

Definition at line 183 of file Bookmark.php.

184  {
185  return $this->setData(self::USER_ID, $userId);
186  }

Field Documentation

◆ $jsonDecoder

$jsonDecoder
protected

Definition at line 28 of file Bookmark.php.


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