mixed) $options The initial options to set. */ public function __construct( array $options = array() ) { $this->properties['configurator'] = null; $this->properties['metaStorage'] = null; $this->properties['replacementStrategy'] = 'ezcCacheStackLruReplacementStrategy'; $this->properties['bubbleUpOnRestore'] = false; parent::__construct( $options ); } /** * Sets an option. * This method is called when an option is set. * * @param string $propertyName The name of the option to set. * @param mixed $propertyValue The option value. * @ignore * * @throws ezcBasePropertyNotFoundException * if the given property does not exist. * @throws ezcBaseValueException * if the value to be assigned to a property is invalid. * @throws ezcBasePropertyPermissionException * if the property to be set is a read-only property. */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'configurator': if ( $propertyValue !== null && ( !is_string( $propertyValue ) || ( !class_exists( $propertyValue ) ) || !in_array( 'ezcCacheStackConfigurator', class_implements( $propertyValue ) ) ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'existsing class implementing ezcCacheStackConfigurator or null' ); } break; case 'metaStorage': if ( $propertyValue !== null && !( $propertyValue instanceof ezcCacheStackMetaDataStorage ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcCacheStackMetaDataStorage or null' ); } break; case 'replacementStrategy': if ( !is_string( $propertyValue ) || !class_exists( $propertyValue ) || !in_array( 'ezcCacheStackReplacementStrategy', class_implements( $propertyValue ) ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'existing class implementing ezcCacheStackReplacementStrategy' ); } break; case 'bubbleUpOnRestore': if ( !is_bool( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'bool' ); } break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); } $this->properties[$propertyName] = $propertyValue; } } ?>