parent
8f1a3b228b
commit
512676ec1a
|
@ -18,7 +18,7 @@ settings are this:
|
||||||
type=ini
|
type=ini
|
||||||
|
|
||||||
The ini provider uses the directory **config/preferences** to create one ini
|
The ini provider uses the directory **config/preferences** to create one ini
|
||||||
file per user and persists the data into a single file. If your want to drop your
|
file per user and persists the data into a single file. If you want to drop your
|
||||||
preferences just drop the file from disk and you'll start with a new profile.
|
preferences just drop the file from disk and you'll start with a new profile.
|
||||||
|
|
||||||
## Database provider
|
## Database provider
|
||||||
|
@ -68,13 +68,13 @@ database and a writable user you need to import the initial table file:
|
||||||
mysql> exit
|
mysql> exit
|
||||||
# mysql -u root -p icingaweb < /path/to/icingaweb/etc/schema/preferences.mysql.sql
|
# mysql -u root -p icingaweb < /path/to/icingaweb/etc/schema/preferences.mysql.sql
|
||||||
|
|
||||||
After following this steps above you can configure your preferences provider.
|
After following these steps above you can configure your preferences provider.
|
||||||
|
|
||||||
## Coding API
|
## Coding API
|
||||||
|
|
||||||
Preferenecs are controlled by the Preferences object which was injected into the
|
You can set, update or remove preferences using the Preference data object
|
||||||
User object on application start (You do not have to think about). For example
|
which is bound to the user. Here are some simple examples how to work with
|
||||||
if you have gathered the user object:
|
that:
|
||||||
|
|
||||||
$preferences = $user->getPreferences();
|
$preferences = $user->getPreferences();
|
||||||
// Get language with en_US as fallback
|
// Get language with en_US as fallback
|
||||||
|
|
|
@ -78,13 +78,10 @@ class Preferences implements SplSubject, \Countable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (PHP 5 >= 5.1.0)<br/>
|
|
||||||
* Attach an SplObserver
|
* Attach an SplObserver
|
||||||
|
*
|
||||||
* @link http://php.net/manual/en/splsubject.attach.php
|
* @link http://php.net/manual/en/splsubject.attach.php
|
||||||
* @param SplObserver $observer <p>
|
* @param SplObserver $observer
|
||||||
* The <b>SplObserver</b> to attach.
|
|
||||||
* </p>
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function attach(SplObserver $observer)
|
public function attach(SplObserver $observer)
|
||||||
{
|
{
|
||||||
|
@ -92,13 +89,10 @@ class Preferences implements SplSubject, \Countable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (PHP 5 >= 5.1.0)<br/>
|
|
||||||
* Detach an observer
|
* Detach an observer
|
||||||
|
*
|
||||||
* @link http://php.net/manual/en/splsubject.detach.php
|
* @link http://php.net/manual/en/splsubject.detach.php
|
||||||
* @param SplObserver $observer <p>
|
* @param SplObserver $observer
|
||||||
* The <b>SplObserver</b> to detach.
|
|
||||||
* </p>
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function detach(SplObserver $observer)
|
public function detach(SplObserver $observer)
|
||||||
{
|
{
|
||||||
|
@ -109,10 +103,9 @@ class Preferences implements SplSubject, \Countable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (PHP 5 >= 5.1.0)<br/>
|
|
||||||
* Notify an observer
|
* Notify an observer
|
||||||
|
*
|
||||||
* @link http://php.net/manual/en/splsubject.notify.php
|
* @link http://php.net/manual/en/splsubject.notify.php
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function notify()
|
public function notify()
|
||||||
{
|
{
|
||||||
|
@ -124,13 +117,10 @@ class Preferences implements SplSubject, \Countable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (PHP 5 >= 5.1.0)<br/>
|
|
||||||
* Count elements of an object
|
* Count elements of an object
|
||||||
|
*
|
||||||
* @link http://php.net/manual/en/countable.count.php
|
* @link http://php.net/manual/en/countable.count.php
|
||||||
* @return int The custom count as an integer.
|
* @return int The custom count as an integer
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* The return value is cast to an integer.
|
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue