## 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. */
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. class ezcAuthenticationOpenidDbStoreOptions extends ezcAuthenticationOpenidStoreOptions
64. {
65. /**
66. * Constructs an object with the specified values.
67. *
68. * @throws ezcBasePropertyNotFoundException
69. * if $options contains a property not defined
70. * @throws ezcBaseValueException
71. * if $options contains a property with a value not allowed
72. * @param array(string=>mixed) $options Options for this class
73. */
74. public function __construct ( array $options = array() )
75. {
76. $this->tableNonces = array( 'name' => 'openid_nonces', 'fields' => array( 'nonce' => 'nonce', 'timestamp' => 'timestamp' ) );
77. $this->tableAssociations = array( 'name' => 'openid_associations', 'fields' => array( 'url' => 'url', 'association' => 'association' ) );
79. parent:: __construct ( $options );
80. }
82. /**
83. * Sets the option $name to $value.
84. *
85. * @throws ezcBasePropertyNotFoundException
86. * if the property $name is not defined
87. * @throws ezcBaseValueException
88. * if $value is not correct for the property $name
89. * @param string $name The name of the property to set
90. * @param mixed $value The new value of the property
91. * @ignore
92. */
93. public function __set( $name, $value )
94. {
95. switch ( $name )
96. {
97. case 'tableNonces':
98. case 'tableAssociations':
99. if ( ! is_array ( $value ) )
100. {
101. throw new ezcBaseValueException ( $name, $value, 'array' );
102. }
103. $this-> properties [$name] = $value;
104. break;
106. default:
107. parent::__set( $name, $value );
108. }
109. }
110. }
111. ?>

Documentation generated by phpDocumentor 1.4.3