AbstractAdapter.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. /**
  3. * LICENSE
  4. *
  5. * This source file is subject to the new BSD license that is bundled
  6. * with this package in the file LICENSE.txt.
  7. * It is also available through the world-wide-web at this URL:
  8. * http://framework.zend.com/license/new-bsd
  9. * If you did not receive a copy of the license and are unable to
  10. * obtain it through the world-wide-web, please send an email
  11. * to license@zend.com so we can send you a copy immediately.
  12. *
  13. * @category Zend
  14. * @package Zend_Cloud
  15. * @subpackage DocumentService
  16. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  17. * @license http://framework.zend.com/license/new-bsd New BSD License
  18. */
  19. require_once 'Zend/Cloud/DocumentService/Adapter.php';
  20. require_once 'Zend/Cloud/DocumentService/Document.php';
  21. require_once 'Zend/Cloud/DocumentService/DocumentSet.php';
  22. require_once 'Zend/Cloud/DocumentService/Query.php';
  23. /**
  24. * Abstract document service adapter
  25. *
  26. * Provides functionality surrounding setting classes for each of:
  27. * - document objects
  28. * - document set objects
  29. * - query class objects
  30. *
  31. * @category Zend
  32. * @package Zend_Cloud
  33. * @subpackage DocumentService
  34. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  35. * @license http://framework.zend.com/license/new-bsd New BSD License
  36. */
  37. abstract class Zend_Cloud_DocumentService_Adapter_AbstractAdapter
  38. implements Zend_Cloud_DocumentService_Adapter
  39. {
  40. const DOCUMENT_CLASS = 'document_class';
  41. const DOCUMENTSET_CLASS = 'documentset_class';
  42. const QUERY_CLASS = 'query_class';
  43. /**
  44. * Class to utilize for new document objects
  45. * @var string
  46. */
  47. protected $_documentClass = 'Zend_Cloud_DocumentService_Document';
  48. /**
  49. * Class to utilize for new document set objects
  50. * @var string
  51. */
  52. protected $_documentSetClass = 'Zend_Cloud_DocumentService_DocumentSet';
  53. /**
  54. * Class to utilize for new query objects
  55. *
  56. * @var string
  57. */
  58. protected $_queryClass = 'Zend_Cloud_DocumentService_Query';
  59. /**
  60. * Set the class for document objects
  61. *
  62. * @param string $class
  63. * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter
  64. */
  65. public function setDocumentClass($class)
  66. {
  67. $this->_documentClass = (string) $class;
  68. return $this;
  69. }
  70. /**
  71. * Get the class for document objects
  72. *
  73. * @return string
  74. */
  75. public function getDocumentClass()
  76. {
  77. return $this->_documentClass;
  78. }
  79. /**
  80. * Set the class for document set objects
  81. *
  82. * @param string $class
  83. * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter
  84. */
  85. public function setDocumentSetClass($class)
  86. {
  87. $this->_documentSetClass = (string) $class;
  88. return $this;
  89. }
  90. /**
  91. * Get the class for document set objects
  92. *
  93. * @return string
  94. */
  95. public function getDocumentSetClass()
  96. {
  97. return $this->_documentSetClass;
  98. }
  99. /**
  100. * Set the query class for query objects
  101. *
  102. * @param string $class
  103. * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter
  104. */
  105. public function setQueryClass($class)
  106. {
  107. $this->_queryClass = (string) $class;
  108. return $this;
  109. }
  110. /**
  111. * Get the class for query objects
  112. *
  113. * @return string
  114. */
  115. public function getQueryClass()
  116. {
  117. return $this->_queryClass;
  118. }
  119. }