PHP Class PartKeepr\SystemPreferenceBundle\Service\SystemPreferenceService

Show file Open project: partkeepr/PartKeepr Class Usage Examples

Public Methods

Method Description
__construct ( EntityManager $entityManager )
deletePreference ( string $key ) Removes a specific system preference
getPreference ( string $key ) : SystemPreference Returns a specific preference object
getPreferences ( ) : SystemPreference[] Returns all system preferences
getSystemPreferenceValue ( string $key ) : string Returns a specific preference value
setSystemPreference ( string $key, string $value ) : SystemPreference Creates or updates a preference for a given user.

Method Details

__construct() public method

public __construct ( EntityManager $entityManager )
$entityManager Doctrine\ORM\EntityManager

deletePreference() public method

Removes a specific system preference
public deletePreference ( string $key )
$key string The key to delete

getPreference() public method

Returns a specific preference object
public getPreference ( string $key ) : SystemPreference
$key string The preference key to retrieve
return PartKeepr\SystemPreferenceBundle\Entity\SystemPreference The preference object

getPreferences() public method

Returns all system preferences
public getPreferences ( ) : SystemPreference[]
return PartKeepr\SystemPreferenceBundle\Entity\SystemPreference[] An array of SystemPreference objects

getSystemPreferenceValue() public method

Returns a specific preference value
public getSystemPreferenceValue ( string $key ) : string
$key string The preference key to retrieve
return string The preference string

setSystemPreference() public method

Creates or updates a preference for a given user.
public setSystemPreference ( string $key, string $value ) : SystemPreference
$key string The key to set
$value string The value to set
return PartKeepr\SystemPreferenceBundle\Entity\SystemPreference The user preference