Apache Zeta Components Manual :: File Source for openid_db_store_options.php

Source for file openid_db_store_options.php

Documentation is available at openid_db_store_options.php

  1. <?php
  2. /**
  3.  * File containing the ezcAuthenticationOpenidDbStoreOptions class.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  23.  * @filesource
  24.  * @package AuthenticationDatabaseTiein
  25.  * @version //autogentag//
  26.  */
  27.  
  28. /**
  29.  * Class containing the options for the OpenID database store.
  30.  *
  31.  * Example of use:
  32.  * <code>
  33.  * // create an options object
  34.  * $options = new ezcAuthenticationOpenidDbStoreOptions();
  35.  * $options->tableNonces = array( 'name' => 'openid_nonces', 'fields' => array( 'nonce' => 'id', 'timestamp' => 'time' ) );
  36.  * $options->tableAssociations = array( 'name' => 'openid_associations', 'fields' => array( 'url' => 'id', 'association' => 'assoc' ) );
  37.  *
  38.  * // use the options object
  39.  * $store = new ezcAuthenticationOpenidDbStore( ezcDbInstance::get(), $options );
  40.  *
  41.  * // alternatively, you can set the options to an existing object
  42.  * $store = new ezcAuthenticationOpenidDbStore( ezcDbInstance::get() );
  43.  * $store->setOptions( $options );
  44.  * </code>
  45.  *
  46.  * @property array(string=>mixed) $tableNonces 
  47.  *            A structure defining how the table which holds the nonces looks like.
  48.  *            The default is array( 'name' => 'openid_nonces', 'fields' => array(
  49.  *            'nonce' => 'nonce', 'timestamp' => 'timestamp' ) ). The column
  50.  *            nonce is a key in the table. The names of the columns and of the
  51.  *            table name can be changed ('nonce', 'timestamp', 'openid_nonces').
  52.  *
  53.  * @property array(string=>mixed) $tableAssociations 
  54.  *            A structure defining how the table which holds the nonces looks like.
  55.  *            The default is array( 'name' => 'openid_associations', 'fields' => array(
  56.  *            'url' => 'url', 'association' => 'association' ) ). The column
  57.  *            nonce is a key in the table. The names of the columns and of the
  58.  *            table name can be changed ('nonce', 'timestamp', 'openid_associations').
  59.  *
  60.  * @package AuthenticationDatabaseTiein
  61.  * @version //autogentag//
  62.  */
  63. {
  64.     /**
  65.      * Constructs an object with the specified values.
  66.      *
  67.      * @throws ezcBasePropertyNotFoundException
  68.      *          if $options contains a property not defined
  69.      * @throws ezcBaseValueException
  70.      *          if $options contains a property with a value not allowed
  71.      * @param array(string=>mixed) $options Options for this class
  72.      */
  73.     public function __constructarray $options array() )
  74.     {
  75.         $this->tableNonces array'name' => 'openid_nonces''fields' => array'nonce' => 'nonce''timestamp' => 'timestamp' ) );
  76.         $this->tableAssociations array'name' => 'openid_associations''fields' => array'url' => 'url''association' => 'association' ) );
  77.  
  78.         parent::__construct$options );
  79.     }
  80.  
  81.     /**
  82.      * Sets the option $name to $value.
  83.      *
  84.      * @throws ezcBasePropertyNotFoundException
  85.      *          if the property $name is not defined
  86.      * @throws ezcBaseValueException
  87.      *          if $value is not correct for the property $name
  88.      * @param string $name The name of the property to set
  89.      * @param mixed $value The new value of the property
  90.      * @ignore
  91.      */
  92.     public function __set$name$value )
  93.     {
  94.         switch $name )
  95.         {
  96.             case 'tableNonces':
  97.             case 'tableAssociations':
  98.                 if !is_array$value ) )
  99.                 {
  100.                     throw new ezcBaseValueException$name$value'array' );
  101.                 }
  102.                 $this->properties[$name$value;
  103.                 break;
  104.  
  105.             default:
  106.                 parent::__set$name$value );
  107.         }
  108.     }
  109. }
  110. ?>
Documentation generated by phpDocumentor 1.4.3