本文整理匯總了PHP中Magento\Framework\Model\AbstractModel::getStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractModel::getStatus方法的具體用法?PHP AbstractModel::getStatus怎麽用?PHP AbstractModel::getStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\Model\AbstractModel
的用法示例。
在下文中一共展示了AbstractModel::getStatus方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: decorateStatus
/**
* Decorate status column values
*
* @param string $value
* @param \Magento\Framework\Model\AbstractModel $row
* @param \Magento\Backend\Block\Widget\Grid\Column $column
* @param bool $isExport
* @return string
*/
public function decorateStatus($value, $row, $column, $isExport)
{
if ($row->getIsActive() || $row->getStatus()) {
$cell = '<span class="grid-severity-notice"><span>' . $value . '</span></span>';
} else {
$cell = '<span class="grid-severity-critical"><span>' . $value . '</span></span>';
}
return $cell;
}
示例2: decorateStatus
/**
* Decorate status column values
*
* @param string $value
* @param \Magento\Framework\Model\AbstractModel $row
* @param \Magento\Backend\Block\Widget\Grid\Column $column
* @param bool $isExport
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function decorateStatus($value, $row, $column, $isExport)
{
$invalidedTypes = $this->_cacheTypeList->getInvalidated();
if (isset($invalidedTypes[$row->getId()])) {
$cell = '<span class="grid-severity-minor"><span>' . __('Invalidated') . '</span></span>';
} else {
if ($row->getStatus()) {
$cell = '<span class="grid-severity-notice"><span>' . $value . '</span></span>';
} else {
$cell = '<span class="grid-severity-critical"><span>' . $value . '</span></span>';
}
}
return $cell;
}
示例3: _afterSave
/**
* Save status labels per store
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
{
if ($object->hasStoreLabels()) {
$labels = $object->getStoreLabels();
$this->getConnection()->delete($this->labelsTable, ['status = ?' => $object->getStatus()]);
$data = [];
foreach ($labels as $storeId => $label) {
if (empty($label)) {
continue;
}
$data[] = ['status' => $object->getStatus(), 'store_id' => $storeId, 'label' => $label];
}
if (!empty($data)) {
$this->getConnection()->insertMultiple($this->labelsTable, $data);
}
}
return parent::_afterSave($object);
}
示例4: getStatus
/**
* Return status
*
* @return string
*/
public function getStatus()
{
return parent::getStatus();
}