src/Application.php
public function getUserPreference($attribute = null)
    {
        if (!ObjectFactoryHelper::getXmlFileWithPath(OPENBIZ_PREFERENCE_SERVICE)) {
            return null;
        }
        $preferenceService = Openbizx::getService(OPENBIZ_PREFERENCE_SERVICE);
        if (method_exists($preferenceService, 'getPreference')) {
            return $preferenceService->getPreference($attribute);
        } else {
            $preference = $this->getSessionContext()->getVar("_USER_PREFERENCE");
            return isset($preference[$attribute]) ? $preference[$attribute] : "";
        }
    }
public function getUserPreference($attribute = null)
    {
        if (!ObjectFactoryHelper::getXmlFileWithPath(OPENBIZ_PREFERENCE_SERVICE)) {
            return null;
        }
        $preferenceService = Openbizx::getService(OPENBIZ_PREFERENCE_SERVICE);
        if (method_exists($preferenceService, 'getPreference')) {
            return $preferenceService->getPreference($attribute);
        } else {
            $preference = $this->getSessionContext()->getVar("_USER_PREFERENCE");
            return isset($preference[$attribute]) ? $preference[$attribute] : "";
        }
    }
Get user preference

@param string $attribute key that representing attribute
@return mixed