|
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\ResourceModel\Review\Product\CollectionFactory $productFactory, \Magento\Review\Model\ResourceModel\Review\Status\CollectionFactory $statusFactory, \Magento\Review\Model\ResourceModel\Review\Summary\CollectionFactory $summaryFactory, \Magento\Review\Model\Review\SummaryFactory $summaryModFactory, \Magento\Review\Model\Review\Summary $reviewSummary, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $urlModel, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[]) | |
| getProductCollection () | |
| getStatusCollection () | |
| getTotalReviews ($entityPkValue, $approvedOnly=false, $storeId=0) | |
| aggregate () | |
| getEntitySummary ($product, $storeId=0) | |
| getPendingStatus () | |
| getReviewUrl () | |
| getProductUrl ($productId, $storeId) | |
| validate () | |
| afterDeleteCommit () | |
| appendSummary ($collection) | |
| isApproved () | |
| isAvailableOnStore ($store=null) | |
| getEntityIdByCode ($entityCode) | |
| getIdentities () | |
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) | |
Data Fields | |
| const | CACHE_TAG = 'review_block' |
| const | ENTITY_PRODUCT_CODE = 'product' |
| const | ENTITY_CUSTOMER_CODE = 'customer' |
| const | ENTITY_CATEGORY_CODE = 'category' |
| const | STATUS_APPROVED = 1 |
| const | STATUS_PENDING = 2 |
| const | STATUS_NOT_APPROVED = 3 |
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) | |
Protected Attributes | |
| $_eventPrefix = 'review' | |
| $productCollectionFactory | |
| $_statusFactory | |
| $_summaryFactory | |
| $_summaryModFactory | |
| $_reviewSummary | |
| $_storeManager | |
| $_urlModel | |
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 | |
Static Protected Attributes inherited from DataObject | |
| static | $_underscoreCache = [] |
Review model
@api @method string getCreatedAt() @method \Magento\Review\Model\Review setCreatedAt(string $value) @method \Magento\Review\Model\Review setEntityId(int $value) @method int getEntityPkValue() @method \Magento\Review\Model\Review setEntityPkValue(int $value) @method int getStatusId() @method \Magento\Review\Model\Review setStatusId(int $value) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 27 of file Review.php.
| __construct | ( | \Magento\Framework\Model\Context | $context, |
| \Magento\Framework\Registry | $registry, | ||
| \Magento\Review\Model\ResourceModel\Review\Product\CollectionFactory | $productFactory, | ||
| \Magento\Review\Model\ResourceModel\Review\Status\CollectionFactory | $statusFactory, | ||
| \Magento\Review\Model\ResourceModel\Review\Summary\CollectionFactory | $summaryFactory, | ||
| \Magento\Review\Model\Review\SummaryFactory | $summaryModFactory, | ||
| \Magento\Review\Model\Review\Summary | $reviewSummary, | ||
| \Magento\Store\Model\StoreManagerInterface | $storeManager, | ||
| \Magento\Framework\UrlInterface | $urlModel, | ||
| \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\ResourceModel\Review\Product\CollectionFactory | $productFactory | |
| \Magento\Review\Model\ResourceModel\Review\Status\CollectionFactory | $statusFactory | |
| \Magento\Review\Model\ResourceModel\Review\Summary\CollectionFactory | $summaryFactory | |
| \Magento\Review\Model\Review\SummaryFactory | $summaryModFactory | |
| \Magento\Review\Model\Review\Summary | $reviewSummary | |
| \Magento\Store\Model\StoreManagerInterface | $storeManager | |
| \Magento\Framework\UrlInterface | $urlModel | |
| \Magento\Framework\Model\ResourceModel\AbstractResource | $resource | |
| \Magento\Framework\Data\Collection\AbstractDb | $resourceCollection | |
| array | $data | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 135 of file Review.php.
|
protected |
| afterDeleteCommit | ( | ) |
Perform actions after object delete
Definition at line 296 of file Review.php.
| aggregate | ( | ) |
| appendSummary | ( | $collection | ) |
Append review summary to product collection
| ProductCollection | $collection |
Definition at line 308 of file Review.php.
| getEntityIdByCode | ( | $entityCode | ) |
Get review entity type id by code
| string | $entityCode |
Definition at line 366 of file Review.php.
| getEntitySummary | ( | $product, | |
$storeId = 0 |
|||
| ) |
Get entity summary
| Product | $product | |
| int | $storeId |
Definition at line 220 of file Review.php.
| getIdentities | ( | ) |
Return unique ID(s) for each object in system
Implements IdentityInterface.
Definition at line 376 of file Review.php.
| getPendingStatus | ( | ) |
| getProductCollection | ( | ) |
| getProductUrl | ( | $productId, | |
| $storeId | |||
| ) |
Get product view url
| string | int | $productId | |
| string | int | $storeId |
Definition at line 255 of file Review.php.
| getReviewUrl | ( | ) |
| getStatusCollection | ( | ) |
| getTotalReviews | ( | $entityPkValue, | |
$approvedOnly = false, |
|||
$storeId = 0 |
|||
| ) |
Get total reviews
| int | $entityPkValue | |
| bool | $approvedOnly | |
| int | $storeId |
Definition at line 197 of file Review.php.
| isApproved | ( | ) |
| isAvailableOnStore | ( | $store = null | ) |
Check if current review available on passed store
| int | \Magento\Store\Model\Store | $store |
Definition at line 351 of file Review.php.
| validate | ( | ) |
Validate review summary fields
Definition at line 269 of file Review.php.
|
protected |
Definition at line 34 of file Review.php.
|
protected |
Definition at line 104 of file Review.php.
|
protected |
Definition at line 83 of file Review.php.
|
protected |
Definition at line 111 of file Review.php.
|
protected |
Definition at line 90 of file Review.php.
|
protected |
Definition at line 97 of file Review.php.
|
protected |
Definition at line 118 of file Review.php.
|
protected |
Definition at line 76 of file Review.php.
| const CACHE_TAG = 'review_block' |
Cache tag
Definition at line 39 of file Review.php.
| const ENTITY_CATEGORY_CODE = 'category' |
Category entity review code
Definition at line 54 of file Review.php.
| const ENTITY_CUSTOMER_CODE = 'customer' |
Customer entity review code
Definition at line 49 of file Review.php.
| const ENTITY_PRODUCT_CODE = 'product' |
Product entity review code
Definition at line 44 of file Review.php.
| const STATUS_APPROVED = 1 |
Approved review status code
Definition at line 59 of file Review.php.
| const STATUS_NOT_APPROVED = 3 |
Not Approved review status code
Definition at line 69 of file Review.php.
| const STATUS_PENDING = 2 |
Pending review status code
Definition at line 64 of file Review.php.