/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. /**#@+ @ignore */
  24. require_once 'Zend/Media/Id3/DateFrame.php';
  25. /**#@-*/
  26. /**
  27. * The <i>Year</i> frame is a numeric string with a year of the recording.
  28. *
  29. * @category Zend
  30. * @package Zend_Media
  31. * @subpackage ID3
  32. * @author Sven Vollbehr <sven@vollbehr.eu>
  33. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  34. * @license http://framework.zend.com/license/new-bsd New BSD License
  35. * @version $Id: Tyer.php 177 2010-03-09 13:13:34Z svollbehr $
  36. * @deprecated ID3v2.3.0
  37. */
  38. final class Zend_Media_Id3_Frame_Tyer extends Zend_Media_Id3_DateFrame
  39. {
  40. /**
  41. * Constructs the class with given parameters and parses object related
  42. * data.
  43. *
  44. * @param Zend_Io_Reader $reader The reader object.
  45. * @param Array $options The options array.
  46. */
  47. public function __construct($reader = null, &$options = array())
  48. {
  49. parent::__construct($reader, $options, 'Y');
  50. }
  51. /**
  52. * Returns the year.
  53. *
  54. * @return integer
  55. */
  56. public function getYear()
  57. {
  58. return intval($this->getText());
  59. }
  60. /**
  61. * Sets the year.
  62. *
  63. * @param integer $year The year given in four digits.
  64. */
  65. public function setYear($year)
  66. {
  67. $this->setText(strval($year));
  68. }
  69. }