D
D
droit1742016-11-22 10:27:55
Yii
droit174, 2016-11-22 10:27:55

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);
}
and
public function getSettings()
    {
        return $this->settings;
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-11-22
@qonand

__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 question

Ask a Question

731 491 924 answers to any question