Commit f2bba9c6 authored by Bas de Nooijer's avatar Bas de Nooijer

- improved phpdoc

parent 1d15094e
...@@ -74,9 +74,12 @@ class Solarium_Client extends Solarium_Configurable ...@@ -74,9 +74,12 @@ class Solarium_Client extends Solarium_Configurable
/** /**
* Adapter instance * Adapter instance
* *
* The adapter is lazy-loading, it will be instantiated on first use by * If an adapter instance is set using {@link setAdapter()} this var will
* {@link getAdapter()} based on the 'adapter' entry in {@link $_options}. * contain a reference to that instance.
* This option can be set using {@link setAdapter()} *
* In all other cases the adapter is lazy-loading, it will be instantiated
* on first use by {@link getAdapter()} based on the 'adapter' entry in
* {@link $_options}. This option can be set using {@link setAdapter()}
* *
* @var Solarium_Client_Adapter * @var Solarium_Client_Adapter
*/ */
......
...@@ -35,8 +35,13 @@ ...@@ -35,8 +35,13 @@
*/ */
/** /**
* Base class for creating a class that is configurable using the constructor or * Base class for configurable classes
* setOption calls. Used by many solarium classes. *
* All classes extending this class are configurable using the constructor or
* setOption calls. This is the base for many Solarium classes, providing a
* uniform interface for various models.
*
* @package Solarium
*/ */
class Solarium_Configurable class Solarium_Configurable
{ {
...@@ -52,6 +57,15 @@ class Solarium_Configurable ...@@ -52,6 +57,15 @@ class Solarium_Configurable
/** /**
* Constructor * Constructor
* *
* If options are passed they will be merged with {@link $_options}, with
* new values overwriting any existing (default) values.
*
* If $options is an object it will be converted into an array by called
* it's toArray method. This is compatible with the Zend_Config classes in
* Zend Framework, but can also easily be implemented in any other object.
*
* After handling the options the {@link _init()} method is called.
*
* @throws Solarium_Exception * @throws Solarium_Exception
* @param array|Zend_Config $options * @param array|Zend_Config $options
* @return void * @return void
...@@ -69,11 +83,10 @@ class Solarium_Configurable ...@@ -69,11 +83,10 @@ class Solarium_Configurable
} }
} }
// merge with default values, new values overwrite defaults
$this->_options = array_merge($this->_options, $options); $this->_options = array_merge($this->_options, $options);
} }
// Hook for extending classes (for end user classes)
$this->_init(); $this->_init();
} }
...@@ -87,6 +100,10 @@ class Solarium_Configurable ...@@ -87,6 +100,10 @@ class Solarium_Configurable
* This hook is called by the constructor after saving the constructor * This hook is called by the constructor after saving the constructor
* arguments in {@link $_options} * arguments in {@link $_options}
* *
* @internal This empty implementation can optionally be implemented in
* descending classes. It's not an abstract method on purpose, there are
* many cases where no initialization is needed.
*
* @return void * @return void
*/ */
protected function _init() protected function _init()
...@@ -111,6 +128,8 @@ class Solarium_Configurable ...@@ -111,6 +128,8 @@ class Solarium_Configurable
/** /**
* Get an option value * Get an option value
* *
* If the options is empty or not set a NULL value will be returned.
*
* @param string $name * @param string $name
* @return mixed * @return mixed
*/ */
......
...@@ -35,7 +35,12 @@ ...@@ -35,7 +35,12 @@
*/ */
/** /**
* Custom exception case to allow for catching specific exceptions * Solarium specific exception
*
* All exceptions thrown by Solarium are of this type. This way you can easily
* catch Solarium exception and keep them separate from you own exceptions.
*
* @package Solarium
*/ */
class Solarium_Exception extends Exception class Solarium_Exception extends Exception
{ {
......
...@@ -35,14 +35,20 @@ ...@@ -35,14 +35,20 @@
*/ */
/** /**
* This class can be used to check the library version within your code. * Version indicator
* For example to check for a required version. *
* This class can be used to check the library version within your code. This
* can be important if you rely on a minimal version for the features you use.
*
* @package Solarium
*/ */
class Solarium_Version class Solarium_Version
{ {
/** /**
* Version number * Version number of the Solarium library
*
* @var string
*/ */
const VERSION = '0.1-dev'; const VERSION = '0.1-dev';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment