properties['tableClassName'] = 'ezcDbSchemaTable'; $this->properties['fieldClassName'] = 'ezcDbSchemaField'; $this->properties['indexClassName'] = 'ezcDbSchemaIndex'; $this->properties['indexFieldClassName'] = 'ezcDbSchemaIndexField'; $this->properties['tableNamePrefix'] = ''; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @throws ezcBaseValueException * if $value is not correct for the property $name * @throws ezcBaseInvalidParentClassException * if the class name passed as replacement for any of the built-in * classes do not inherit from the built-in classes. * @return void */ public function __set( $propertyName, $propertyValue ) { $parentClassMap = array( 'tableClassName' => 'ezcDbSchemaTable', 'fieldClassName' => 'ezcDbSchemaField', 'indexClassName' => 'ezcDbSchemaIndex', 'indexFieldClassName' => 'ezcDbSchemaIndexField', ); switch ( $propertyName ) { case 'tableClassName': case 'fieldClassName': case 'indexClassName': case 'indexFieldClassName': if ( !is_string( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'string that contains a class name' ); } // Check if the passed classname actually implements the // correct parent class. if ( $parentClassMap[$propertyName] !== $propertyValue && !in_array( $parentClassMap[$propertyName], class_parents( $propertyValue ) ) ) { throw new ezcBaseInvalidParentClassException( $parentClassMap[$propertyName], $propertyValue ); } $this->properties[$propertyName] = $propertyValue; break; case 'tableNamePrefix': if ( !is_string( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'string' ); } $this->properties[$propertyName] = $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } } ?>