PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/library/Zend/Service/RememberTheMilk/List.php

https://github.com/Siedrix/BareBones-with-OAuth
PHP | 188 lines | 54 code | 19 blank | 115 comment | 4 complexity | ee75d77b462da69f654277b615656f28 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_Service
  17. * @subpackage RememberTheMilk
  18. * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @category Zend
  24. * @package Zend_Service
  25. * @subpackage RememberTheMilk
  26. * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  27. * @license http://framework.zend.com/license/new-bsd New BSD License
  28. */
  29. class Zend_Service_RememberTheMilk_List
  30. {
  31. /**
  32. * Identifier for the list
  33. *
  34. * @var int
  35. */
  36. protected $_id;
  37. /**
  38. * Name of the list
  39. *
  40. * @var string
  41. */
  42. protected $_name;
  43. /**
  44. * Position of the list
  45. *
  46. * @var int
  47. */
  48. protected $_position;
  49. /**
  50. * Filter setting for the list
  51. *
  52. * @var string
  53. */
  54. protected $_filter;
  55. /**
  56. * Whether or not the list has been deleted
  57. *
  58. * @var bool
  59. */
  60. protected $_deleted;
  61. /**
  62. * Whether or not the list has been locked
  63. *
  64. * @var bool
  65. */
  66. protected $_locked;
  67. /**
  68. * Whether or not the list has been archived
  69. *
  70. * @var bool
  71. */
  72. protected $_archived;
  73. /**
  74. * Whether or not the list is a Smart List
  75. *
  76. * @var bool
  77. */
  78. protected $_smart;
  79. /**
  80. * Constructor to initialize the object with data
  81. *
  82. * @param array $data Associative array containing data from an API
  83. * response
  84. * @return void
  85. */
  86. public function __construct($data)
  87. {
  88. $this->_id = (int) $data->id;
  89. $this->_name = $data->name;
  90. $this->_position = (int) $data->position;
  91. $this->_deleted = ($data->deleted == '1') ? true : false;
  92. $this->_locked = ($data->locked == '1') ? true : false;
  93. $this->_archived = ($data->archived == '1') ? true : false;
  94. $this->_smart = ($data->smart == '1') ? true : false;
  95. }
  96. /**
  97. * Returns the identifier for the list.
  98. *
  99. * @return int
  100. */
  101. public function getId()
  102. {
  103. return $this->_id;
  104. }
  105. /**
  106. * Returns the name of the list.
  107. *
  108. * @return string
  109. */
  110. public function getName()
  111. {
  112. return $this->_name;
  113. }
  114. /**
  115. * Returns the position of the list.
  116. *
  117. * @return int
  118. */
  119. public function getPosition()
  120. {
  121. return $this->_position;
  122. }
  123. /**
  124. * Returns the filter setting for the list, or the empty string if the
  125. * list is not a Smart List.
  126. *
  127. * @return string
  128. */
  129. public function getFilter()
  130. {
  131. return $this->_filter;
  132. }
  133. /**
  134. * Returns whether or not the list has been deleted.
  135. *
  136. * @return bool TRUE if the list has been deleted, FALSE otherwise
  137. */
  138. public function isDeleted()
  139. {
  140. return $this->_deleted;
  141. }
  142. /**
  143. * Returns whether or not the list has been locked.
  144. *
  145. * @return bool TRUE if the list has been locked, FALSE otherwise
  146. */
  147. public function isLocked()
  148. {
  149. return $this->_locked;
  150. }
  151. /**
  152. * Returns whether or not the list has been archived.
  153. *
  154. * @return bool TRUE if the list has been archived, FALSE otherwise
  155. */
  156. public function isArchived()
  157. {
  158. return $this->_archived;
  159. }
  160. /**
  161. * Returns whether or not the list is a Smart List.
  162. *
  163. * @return bool TRUE if the list is a Smart List, FALSE otherwise
  164. */
  165. public function isSmart()
  166. {
  167. return $this->_smart;
  168. }
  169. }