Closed
Description
Magento 2 sometimes changes values in getter methods. This can lead to undesirable side effects.
An example from the product model:
/**
* Get product status
*
* @return int
*/
public function getStatus()
{
if ($this->_getData(self::STATUS) === null) {
$this->setData(self::STATUS, \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
}
return $this->_getData(self::STATUS);
}
I'm aware this is a very general issue and has to be tackled over time during the whole code refactoring process but it is important.