apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Auth_PrefManager2_Container

Source Location: /Auth_PrefManager2-2.0.0dev1/PrefManager2/Container.php

Class Overview




Variables

Methods


Child classes:

Auth_PrefManager2_Container_Mock
Auth_PrefManager2_Container_DB
The PEAR DB container for Auth_PrefManager2

Inherited Variables

Inherited Methods


Class Details

[line 4]


[ Top ]


Class Variables

$_errorStack =  null

[line 22]

The PEAR_ErrorStack object to use for error handling.
  • Since: 0.1.0
  • Access: protected

Type:   PEAR_ErrorStack


[ Top ]

$_options = array()

[line 13]

An array of options to use.
  • Since: 0.1.0
  • Access: protected

Type:   array


[ Top ]



Method Detail

Auth_PrefManager2_Container (Constructor)   [line 35]

void Auth_PrefManager2_Container( [array $options = array()])

Constructor

Applications should never call this constructor directly, instead create a container with the factory method.

  • See: Auth_PrefManager2::&factory()
  • Access: protected

Parameters:

array   $options   —  An associative array of options.

[ Top ]

deletePref   [line 106]

bool deletePref( string $preference, [string $owner = null], [string $application = null])

Deletes a preference for the specified owner and application.
  • Return: Success/failure
  • Access: public

Parameters:

string   $preference   —  The name of the preference to delete.
string   $owner   —  The owner to delete the preference for.
string   $application   —  The application to delete from, if left as null the default application will be used.

[ Top ]

getPref   [line 53]

mixed|null getPref( string $preference, [string $owner = null], [string $application = null], [bool $returnDefaults = true])

Gets a preference for the specified owner and application.
  • Return: The value, or null of no value was available.
  • Access: public

Parameters:

string   $preference   —  The name of the preference to retrieve.
string   $owner   —  The owner to retrieve the preference for.
string   $application   —  The application to retrieve from, if left as null the default application will be used.
bool   $returnDefaults   —  Should a default value be returned if no user preference is available?

[ Top ]

setPref   [line 83]

bool setPref( string $preference, mixed $value, [string $owner = null], [string $application = null])

Sets a preference for the specified owner and application.
  • Return: Success/failure
  • Access: public

Parameters:

string   $preference   —  The name of the preference to retrieve.
mixed   $value   —  The value to set the preference to.
string   $owner   —  The owner to retrieve the preference for.
string   $application   —  The application to retrieve from, if left as null the default application will be used.

[ Top ]

_decodeValue   [line 221]

mixed _decodeValue( mixed $value)

Reverts any preparation that was done to store the value.

Containers that override this method should always call parent::_decodeValue() to do unserialization.

  • Return: The unprepared value.
  • Access: protected

Parameters:

mixed   $value   —  The value to decode.

[ Top ]

_delete   [line 168]

bool _delete( string $owner, string $preference, string $application)

Deletes a value from the container.

This method should be overridden by container classes to do whatever needs doing.

  • Return: Success/failure
  • Abstract:
  • Access: protected

Overridden in child classes as:

Auth_PrefManager2_Container_Mock::_delete()
Deletes a value from the container.
Auth_PrefManager2_Container_DB::_delete()
Deletes a value from the container.

Parameters:

string   $owner   —  The owner to delete the preference for.
string   $preference   —  The name of the preference to delete.
string   $application   —  The application to delete from.

[ Top ]

_encodeValue   [line 203]

mixed _encodeValue( mixed $value)

Prepares a value for saving in the data container.

Containers that override this method should always call parent::_encodeValue() to do serialization.

  • Return: The prepared value.
  • Access: protected

Parameters:

mixed   $value   —  The value to prepare.

[ Top ]

_exists   [line 188]

bool _exists( string $owner, string $preference, string $application)

Checks if the specified preference exists in the data container.

This method should be overridden by container classes to do whatever needs doing.

Returns null if an error occurs.

  • Return: Does the pref exist?
  • Abstract:
  • Access: protected

Overridden in child classes as:

Auth_PrefManager2_Container_Mock::_exists()
Checks if the specified preference exists in the data container.
Auth_PrefManager2_Container_DB::_exists()
Checks if the specified preference exists in the data container.

Parameters:

string   $owner   —  The owner to delete the preference for.
string   $preference   —  The name of the preference to delete.
string   $application   —  The application to delete from.

[ Top ]

_get   [line 150]

bool _get( string $owner, string $preference, string $application, mixed $value)

Gets a value from the container.

This method should be overridden by container classes to do whatever needs doing.

  • Return: Success/failure
  • Abstract:
  • Access: protected

Overridden in child classes as:

Auth_PrefManager2_Container_Mock::_get()
Gets a value from the container.
Auth_PrefManager2_Container_DB::_get()
Gets a value from the container.

Parameters:

string   $owner   —  The owner to set the preference for.
string   $preference   —  The name of the preference to set.
mixed   $value   —  The value to set the preference to.
string   $application   —  The application to set for.

[ Top ]

_parseOptions   [line 241]

void _parseOptions( array $options)

Reads the options array, and sets default values for anything which isn't set.

Container classes should override this method, set any defaults that they need, and then pass the options to parent::_parseOptions().

  • Access: protected

Overridden in child classes as:

Auth_PrefManager2_Container_DB::_parseOptions()
Reads the options array, and sets default values for anything which isn't set.

Parameters:

array   $options   —  An array of options.

[ Top ]

_set   [line 131]

bool _set( string $owner, string $preference, $value, string $application)

Sets a value with the container.

This method should be overridden by container classes to do whatever needs doing.

  • Return: Success/failure
  • Abstract:
  • Access: protected

Overridden in child classes as:

Auth_PrefManager2_Container_Mock::_set()
Sets a value with the container.
Auth_PrefManager2_Container_DB::_set()
Sets a value with the container.

Parameters:

string   $owner   —  The owner to set the preference for.
string   $preference   —  The name of the preference to set.
string   $application   —  The application to set for.
   $value   — 

[ Top ]

_throwError   [line 287]

void _throwError( int $code, [string $level = 'error'], [array $params = array()], [ $repackage = null])

Throws an error, using the current locale if it exists, or en if it doesn't.
  • Access: protected

Parameters:

int   $code   —  The error code.
string   $level   —  The level of the error.
array   $params   —  Any other information to include with the error.
   $repackage   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:54:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.