Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • Calendar
  • CalendarCollection
  • DateFormatter
  • DateTimeFormatter
  • FileCache
  • Locale
  • LocaleCollection
  • LocalizedDateTime
  • LocalizedObject
  • Provider
  • Repository
  • Retriever
  • RunTimeCache
  • Supplemental
  • TimeFormatter

Interfaces

  • Cache

Exceptions

  • ResourceNotFound
 1 <?php
 2 
 3 /*
 4  * This file is part of the ICanBoogie package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace ICanBoogie\CLDR;
13 
14 use ICanBoogie\OffsetNotWritable;
15 
16 /**
17  * Representation of a calendar collection.
18  *
19  * <pre>
20  * <?php
21  *
22  * $calendar_collection = $repository->locales['fr']->calendars;
23  * $gregorian_callendar = $calendar_collection['gregorian'];
24  * </pre>
25  */
26 class CalendarCollection implements \ArrayAccess
27 {
28     /**
29      * Representation of a locale.
30      *
31      * @var Locale
32      */
33     protected $repository;
34 
35     /**
36      * Calendar instances.
37      *
38      * @var Calendar[]
39      */
40     protected $collection = array();
41 
42     /**
43      * Initialiazes the {@link $repository} property.
44      *
45      * @param Repository $repository Representation of a CLDR.
46      */
47     public function __construct(Locale $locale)
48     {
49         $this->locale = $locale;
50     }
51 
52     public function offsetExists($offset)
53     {
54         throw new \BadMethodCallException("The method is not implemented");
55     }
56 
57     public function offsetGet($offset)
58     {
59         if (empty($this->collection[$offset]))
60         {
61             $this->collection[$offset] = new Calendar($this->locale, $this->locale["ca-{$offset}"]);
62         }
63 
64         return $this->collection[$offset];
65     }
66 
67     public function offsetSet($offset, $value)
68     {
69         throw new OffsetNotWritable(array($offset, $this));
70     }
71 
72     public function offsetUnset($offset)
73     {
74         throw new OffsetNotWritable(array($offset, $this));
75     }
76 }
Autodoc API documentation generated by ApiGen 2.8.0