/zf/library/Zend/Gdata/YouTube/Extension/Position.php

http://github.com/eryx/php-framework-benchmark · PHP · 90 lines · 26 code · 10 blank · 54 comment · 0 complexity · 2913eef4bd63346b2fea6d3f7d058799 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_Gdata
  17. * @subpackage YouTube
  18. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: Position.php 23775 2011-03-01 17:25:24Z ralph $
  21. */
  22. /**
  23. * @see Zend_Gdata_Extension
  24. */
  25. require_once 'Zend/Gdata/Extension.php';
  26. /**
  27. * Data model class to represent a playlist item's position in the list (yt:position)
  28. *
  29. * @category Zend
  30. * @package Zend_Gdata
  31. * @subpackage YouTube
  32. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Gdata_YouTube_Extension_Position extends Zend_Gdata_Extension
  36. {
  37. protected $_rootElement = 'position';
  38. protected $_rootNamespace = 'yt';
  39. /**
  40. * Constructs a new Zend_Gdata_YouTube_Extension_Position object.
  41. *
  42. * @param string $value (optional) The 1-based position in the playlist
  43. */
  44. public function __construct($value = null)
  45. {
  46. $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces);
  47. parent::__construct();
  48. $this->_text = $value;
  49. }
  50. /**
  51. * Get the value for the position in the playlist
  52. *
  53. * @return int The 1-based position in the playlist
  54. */
  55. public function getValue()
  56. {
  57. return $this->_text;
  58. }
  59. /**
  60. * Set the value for the position in the playlist
  61. *
  62. * @param int $value The 1-based position in the playlist
  63. * @return Zend_Gdata_Extension_Visibility The element being modified
  64. */
  65. public function setValue($value)
  66. {
  67. $this->_text = $value;
  68. return $this;
  69. }
  70. /**
  71. * Magic toString method allows using this directly via echo
  72. * Works best in PHP >= 4.2.0
  73. *
  74. * @return string
  75. */
  76. public function __toString()
  77. {
  78. return $this->getValue();
  79. }
  80. }