File_IMC
[ class tree: File_IMC ] [ index: File_IMC ] [ all elements ]

Source for file Event.php

Documentation is available at Event.php

  1. <?php
  2. /*
  3.  * +----------------------------------------------------------------------+
  4.  * | Copyright (c) 1997-2008 The PHP Group                                |
  5.  * +----------------------------------------------------------------------+
  6.  * | All rights reserved.                                                 |
  7.  * |                                                                      |
  8.  * | Redistribution and use in source and binary forms, with or without   |
  9.  * | modification, are permitted provided that the following conditions   |
  10.  * | are met:                                                             |
  11.  * |                                                                      |
  12.  * | - Redistributions of source code must retain the above copyright     |
  13.  * | notice, this list of conditions and the following disclaimer.        |
  14.  * | - Redistributions in binary form must reproduce the above copyright  |
  15.  * | notice, this list of conditions and the following disclaimer in the  |
  16.  * | documentation and/or other materials provided with the distribution. |
  17.  * | - Neither the name of the The PEAR Group nor the names of its        |
  18.  * | contributors may be used to endorse or promote products derived from |
  19.  * | this software without specific prior written permission.             |
  20.  * |                                                                      |
  21.  * | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  |
  22.  * | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT    |
  23.  * | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS    |
  24.  * | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE       |
  25.  * | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,  |
  26.  * | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
  27.  * | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;     |
  28.  * | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER     |
  29.  * | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT   |
  30.  * | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN    |
  31.  * | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE      |
  32.  * | POSSIBILITY OF SUCH DAMAGE.                                          |
  33.  * +----------------------------------------------------------------------+
  34.  *
  35.  * PHP Version 5
  36.  *
  37.  * @category File_Formats
  38.  * @package  File_IMC
  39.  * @author   Till Klampaeckel <till@php.net>
  40.  * @license  http://www.opensource.org/licenses/bsd-license.php The BSD License
  41.  * @version  SVN: $Id$
  42.  * @link     http://pear.php.net/package/File_IMC
  43.  */
  44.  
  45. /**
  46. * File_IMC_Parse_Vcalendar_Event
  47. *
  48. * <code>
  49. *   $parser = File_IMC::parse('vcalendar');
  50. *   $parser->fromFile('path/to/sample.vcs');
  51. *
  52. *   $events = $parser->getEvents();
  53. *
  54. *   while ($events->valid()) {
  55. *       $event = $events->current(); // File_IMC_Parse_Vcalendar_Event
  56. *       $events->next();
  57. *   }
  58. * </code>
  59. *
  60. @category File_Formats
  61. @package  File_IMC
  62. @author   Till Klampaeckel <till@php.net>
  63. @license  http://www.opensource.org/licenses/bsd-license.php The BSD License
  64. @version  Release: 0.5.0
  65. @link     http://pear.php.net/package/File_IMC
  66. */
  67. {
  68.     protected $data;
  69.  
  70.     public function __construct(array $data)
  71.     {
  72.         $this->data  = $data;
  73.     }
  74.  
  75.     public function getDescription()
  76.     {
  77.         return $this->data['DESCRIPTION'][0]['value'][0][0];
  78.     }
  79.  
  80.     public function getEnd()
  81.     {
  82.         return $this->data['DTEND'][0]['value'][0][0];
  83.     }
  84.  
  85.     public function getStart()
  86.     {
  87.         return $this->data['DTSTART'][0]['value'][0][0];
  88.     }
  89.  
  90.     public function getSummary()
  91.     {
  92.         return $this->data['SUMMARY'][0]['value'][0][0];
  93.     }
  94.  
  95.     public function toArray()
  96.     {
  97.         return $this->data;
  98.     }
  99. }

Documentation generated on Mon, 11 Mar 2019 15:49:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.