DatabaseSchema
[ ]
[ ]
[ ]
[ ]
[ ]
Source for file index.php
Documentation is available at index.php
1. <?php
2. /**
3. * @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
4. * @license http://ez.no/licenses/new_bsd New BSD License
5. * @version 1.3.1
6. * @filesource
7. * @package DatabaseSchema
8. */
9. /**
10. * A container to store a table index in.
11. *
12. * @package DatabaseSchema
13. * @version 1.3.1
14. */
15. class ezcDbSchemaIndex extends ezcBaseStruct
16. {
17. /**
18. * The fields that make up this index
19. *
20. * @var array(string=>ezcDbSchemaIndexField)
21. */
22. public $indexFields;
23.
24. /**
25. * Whether this is the primary index for a table.
26. *
27. * @var bool
28. */
29. public $primary;
30.
31. /**
32. * Whether entries in this index need to be unique.
33. *
34. * @var bool
35. */
36. public $unique;
37.
38. /**
39. * Constructs an ezcDbSchemaIndex object.
40. *
41. * @param array(string=>ezcDbSchemaIndexField) $indexFields
42. * @param bool $primary
43. * @param bool $unique
44. */
45. function __construct( $indexFields, $primary = false, $unique = true )
46. {
47. ksort( $indexFields );
48. $this->indexFields = $indexFields;
49. $this->primary = (bool) $primary;
50. $this->unique = (bool) $unique;
51. }
52.
53. static public function __set_state( array $array )
54. {
55. return new ezcDbSchemaIndex(
56. $array['indexFields'], $array['primary'], $array['unique']
57. );
58. }
59. }
60. ?>
Last updated: Thu, 31 Jan 2008