PageRenderTime 13ms CodeModel.GetById 8ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Zend/Media/Id3/Frame/Tyer.php

http://php-reader.googlecode.com/
PHP | 73 lines | 17 code | 4 blank | 52 comment | 0 complexity | f593ae489d31cadb189fb6c04ddf9c7d MD5 | raw file
 1<?php
 2/**
 3 * Zend Framework
 4 *
 5 * LICENSE
 6 *
 7 * This source file is subject to the new BSD license that is bundled
 8 * with this package in the file LICENSE.txt.
 9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
14 *
15 * @category   Zend
16 * @package    Zend_Media
17 * @subpackage ID3
18 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) 
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
20 * @version    $Id: Tyer.php 177 2010-03-09 13:13:34Z svollbehr $
21 * @deprecated ID3v2.3.0
22 */
23
24/**#@+ @ignore */
25require_once 'Zend/Media/Id3/DateFrame.php';
26/**#@-*/
27
28/**
29 * The <i>Year</i> frame is a numeric string with a year of the recording.
30 *
31 * @category   Zend
32 * @package    Zend_Media
33 * @subpackage ID3
34 * @author     Sven Vollbehr <sven@vollbehr.eu>
35 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) 
36 * @license    http://framework.zend.com/license/new-bsd     New BSD License
37 * @version    $Id: Tyer.php 177 2010-03-09 13:13:34Z svollbehr $
38 * @deprecated ID3v2.3.0
39 */
40final class Zend_Media_Id3_Frame_Tyer extends Zend_Media_Id3_DateFrame
41{
42    /**
43     * Constructs the class with given parameters and parses object related
44     * data.
45     *
46     * @param Zend_Io_Reader $reader The reader object.
47     * @param Array $options The options array.
48     */
49    public function __construct($reader = null, &$options = array())
50    {
51        parent::__construct($reader, $options, 'Y');
52    }
53
54    /**
55     * Returns the year.
56     *
57     * @return integer
58     */
59    public function getYear()
60    {
61        return intval($this->getText());
62    }
63
64    /**
65     * Sets the year.
66     *
67     * @param integer $year The year given in four digits.
68     */
69    public function setYear($year)
70    {
71        $this->setText(strval($year));
72    }
73}