Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Review\Model\Rating\OptionFactory $ratingOptionFactory, \Magento\Review\Model\ResourceModel\Rating\Option\CollectionFactory $ratingCollectionF, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[]) | |
addOptionVote ($optionId, $entityPkValue) | |
updateOptionVote ($optionId) | |
getOptions () | |
getEntitySummary ($entityPkValue, $onlyForCurrentStore=true) | |
getReviewSummary ($reviewId, $onlyForCurrentStore=true) | |
getEntityIdByCode ($entityCode) | |
getIdentities () | |
![]() | |
__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 () | |
![]() | |
__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) | |
Data Fields | |
const | ENTITY_PRODUCT_CODE = 'product' |
const | ENTITY_PRODUCT_REVIEW_CODE = 'product_review' |
const | ENTITY_REVIEW_CODE = 'review' |
Protected Member Functions | |
_construct () | |
![]() | |
_construct () | |
_init ($resourceModel) | |
_setResourceModel ($resourceName, $collectionName=null) | |
_getResource () | |
_getEventData () | |
_beforeLoad ($modelId, $field=null) | |
_afterLoad () | |
_hasModelChanged () | |
_getValidatorBeforeSave () | |
_createValidatorBeforeSave () | |
_getValidationRulesBeforeSave () | |
_clearReferences () | |
_clearData () | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$_ratingOptionFactory | |
$_ratingCollectionF | |
![]() | |
$_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 = [] | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
Rating model
@api @method array getRatingCodes() @method \Magento\Review\Model\Rating setRatingCodes(array $value) @method array getStores() @method \Magento\Review\Model\Rating setStores(array $value) @method string getRatingCode()
Definition at line 23 of file Rating.php.
__construct | ( | \Magento\Framework\Model\Context | $context, |
\Magento\Framework\Registry | $registry, | ||
\Magento\Review\Model\Rating\OptionFactory | $ratingOptionFactory, | ||
\Magento\Review\Model\ResourceModel\Rating\Option\CollectionFactory | $ratingCollectionF, | ||
\Magento\Framework\Model\ResourceModel\AbstractResource | $resource = null , |
||
\Magento\Framework\Data\Collection\AbstractDb | $resourceCollection = null , |
||
array | $data = [] |
||
) |
\Magento\Framework\Model\Context | $context | |
\Magento\Framework\Registry | $registry | |
\Magento\Review\Model\Rating\OptionFactory | $ratingOptionFactory | |
\Magento\Review\Model\ResourceModel\Rating\Option\CollectionFactory | $ratingCollectionF | |
\Magento\Framework\Model\ResourceModel\AbstractResource | $resource | |
\Magento\Framework\Data\Collection\AbstractDb | $resourceCollection | |
array | $data |
Definition at line 53 of file Rating.php.
|
protected |
addOptionVote | ( | $optionId, | |
$entityPkValue | |||
) |
getEntityIdByCode | ( | $entityCode | ) |
Get rating entity type id by code
string | $entityCode |
Definition at line 162 of file Rating.php.
getEntitySummary | ( | $entityPkValue, | |
$onlyForCurrentStore = true |
|||
) |
Get rating collection object
int | $entityPkValue | |
bool | $onlyForCurrentStore |
Definition at line 139 of file Rating.php.
getIdentities | ( | ) |
Return unique ID(s) for each object in system
Implements IdentityInterface.
Definition at line 172 of file Rating.php.
getOptions | ( | ) |
getReviewSummary | ( | $reviewId, | |
$onlyForCurrentStore = true |
|||
) |
int | $reviewId | |
bool | $onlyForCurrentStore |
Definition at line 150 of file Rating.php.
updateOptionVote | ( | $optionId | ) |
|
protected |
Definition at line 42 of file Rating.php.
|
protected |
Definition at line 37 of file Rating.php.
const ENTITY_PRODUCT_CODE = 'product' |
rating entity codes
Definition at line 28 of file Rating.php.
const ENTITY_PRODUCT_REVIEW_CODE = 'product_review' |
Definition at line 30 of file Rating.php.
const ENTITY_REVIEW_CODE = 'review' |
Definition at line 32 of file Rating.php.