## Apache Zeta Components Manual :: File Source for context_read_interface.php

## Source for file context_read_interface.php

Documentation is available at context_read_interface.php

1. <?php
2. /**
3. *
4. * Licensed to the Apache Software Foundation (ASF) under one
5. * or more contributor license agreements. See the NOTICE file
6. * distributed with this work for additional information
7. * regarding copyright ownership. The ASF licenses this file
8. * to you under the Apache License, Version 2.0 (the
9. * "License"); you may not use this file except in compliance
10. * with the License. You may obtain a copy of the License at
11. *
12. * http://www.apache.org/licenses/LICENSE-2.0
13. *
14. * Unless required by applicable law or agreed to in writing,
15. * software distributed under the License is distributed on an
16. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17. * KIND, either express or implied. See the License for the
18. * specific language governing permissions and limitations
19. * under the License.
20. *
21. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
22. * @version //autogentag//
23. * @filesource
24. * @package Translation
25. */
27. /**
28. * Common interface for all context readers.
29. *
30. * This interface specifies the methods that a backend should implement if it
31. * wants to act as a general purpose translation context reader. It extends on
32. * the built-in Iterator interface.
33. *
34. * Example (see {@link ezcTranslationTsBackend} for a more elaborate example):
35. * <code>
36. * <?php
37. * $r = new ezcTranslationTsBackend( 'usr/share/translations' );
38. * $r->setOptions( array( 'format' => 'translation-[LOCALE].xml' ) );
39. * $r->initReader( 'nl_NL' );
40. * $r->next();
41. * while ( $r->valid() )
42. * {
43. * $ctxt = $r->current();
44. * $r->next();
45. * }
46. * $r->deinitReader();
47. * ?>
48. * </code>
49. *
50. * @package Translation
51. * @version //autogentag//
52. */
53. interface ezcTranslationContextRead extends Iterator
54. {
55. /**
56. * Initializes the reader to read from the locale $locale.
57. *
58. * Before starting to request context through the reader, you should call
59. * this method to initialize it.
60. *
61. * @param string $locale
62. * @throws TranslationException when the path of the translation and the
63. * fileformat of the translation are not set before
64. * this method is called.
65. * @return void
66. */
67. public function initReader ( $locale );
69. /**
70. * Deinitializes the reader.
71. *
72. * This method should be called after the haveMore() method returns false
73. * to cleanup resources.
74. *
75. * @throws TranslationException when the reader is not initialized with
76. * initReader().
77. * @return void
78. */
79. public function deinitReader ();
80. }
81. ?>

Documentation generated by phpDocumentor 1.4.3