Answer the question
In order to leave comments, you need to log in
What is the difference between _get and get entries?
how is record data different in yii2 model
public function __get($name) {
if ($name === 'settings')
return $this->getAttribute('settings');
return parent::__get($name);
}
andpublic function getSettings()
{
return $this->settings;
}
Answer the question
In order to leave comments, you need to log in
__get is a PHP level magic method , getSettings() is just a more convenient framework level implementation based on the __get magic method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question