Skip to content

Commit 014a466

Browse files
committed
[TASK] Define protected function with leading underscore / Only save store id when present
1 parent b90752b commit 014a466

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

  • src/app/code/community/FireGento/AdminMonitoring/Model/History

src/app/code/community/FireGento/AdminMonitoring/Model/History/Data.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ public function getContent()
6262
// have to re-load the model as based on database datatypes the format of values changes
6363
$className = get_class($this->_savedModel);
6464
$model = new $className;
65-
$model->setStoreId($this->_savedModel->getStoreId());
65+
66+
// Add store id if given
67+
if ($storeId = $this->_savedModel->getStoreId()) {
68+
$model->setStoreId($storeId);
69+
}
6670
$model->load($this->_savedModel->getId());
6771

68-
return $this->filterObligatoryFields($model->getData());
72+
return $this->_filterObligatoryFields($model->getData());
6973
}
7074

7175
/**
@@ -74,7 +78,7 @@ public function getContent()
7478
* @param array $data Data
7579
* @return array Filtered Data
7680
*/
77-
protected function filterObligatoryFields($data)
81+
protected function _filterObligatoryFields($data)
7882
{
7983
$fields = Mage::getSingleton('firegento_adminmonitoring/config')->getFieldExcludes();
8084
foreach ($fields as $field) {
@@ -92,7 +96,7 @@ protected function filterObligatoryFields($data)
9296
public function getOrigContent()
9397
{
9498
$data = $this->_savedModel->getOrigData();
95-
return $this->filterObligatoryFields($data);
99+
return $this->_filterObligatoryFields($data);
96100
}
97101

98102
/**

0 commit comments

Comments
 (0)