app\models\User::getPreference PHP Method

getPreference() public method

Get a preference item of the current user.
public getPreference ( string $key ) : string | null
$key string
return string | null
    public function getPreference($key)
    {
        // We can't use $this->preferences directly, since the data has been tampered
        // by getPreferencesAttribute().
        return array_get((array) unserialize($this->attributes['preferences']), $key);
    }