ConfigurationDirectories.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_WindowsAzure
  17. * @subpackage Diagnostics
  18. * @copyright Copyright (c) 2005-2015 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. * @see Zend_Service_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
  24. */
  25. require_once 'Zend/Service/WindowsAzure/Diagnostics/ConfigurationObjectBaseAbstract.php';
  26. /**
  27. * @see Zend_Service_WindowsAzure_Diagnostics_DirectoryConfigurationSubscription
  28. */
  29. require_once 'Zend/Service/WindowsAzure/Diagnostics/DirectoryConfigurationSubscription.php';
  30. /**
  31. * @category Zend
  32. * @package Zend_Service_WindowsAzure
  33. * @subpackage Diagnostics
  34. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  35. * @license http://framework.zend.com/license/new-bsd New BSD License
  36. *
  37. * @property int BufferQuotaInMB Buffer quota in MB
  38. * @property int ScheduledTransferPeriodInMinutes Scheduled transfer period in minutes
  39. * @property array Subscriptions Subscriptions
  40. */
  41. class Zend_Service_WindowsAzure_Diagnostics_ConfigurationDirectories
  42. extends Zend_Service_WindowsAzure_Diagnostics_ConfigurationObjectBaseAbstract
  43. {
  44. /**
  45. * Constructor
  46. *
  47. * @param int $bufferQuotaInMB Buffer quota in MB
  48. * @param int $scheduledTransferPeriodInMinutes Scheduled transfer period in minutes
  49. */
  50. public function __construct($bufferQuotaInMB = 0, $scheduledTransferPeriodInMinutes = 0)
  51. {
  52. $this->_data = array(
  53. 'bufferquotainmb' => $bufferQuotaInMB,
  54. 'scheduledtransferperiodinminutes' => $scheduledTransferPeriodInMinutes,
  55. 'subscriptions' => array()
  56. );
  57. }
  58. /**
  59. * Add subscription
  60. *
  61. * @param string $path Path
  62. * @param string $container Container
  63. * @param int $directoryQuotaInMB Directory quota in MB
  64. */
  65. public function addSubscription($path, $container, $directoryQuotaInMB = 1024)
  66. {
  67. $this->_data['subscriptions'][$path] = new Zend_Service_WindowsAzure_Diagnostics_DirectoryConfigurationSubscription($path, $container, $directoryQuotaInMB);
  68. }
  69. /**
  70. * Remove subscription
  71. *
  72. * @param string $path Path
  73. */
  74. public function removeSubscription($path)
  75. {
  76. if (isset($this->_data['subscriptions'][$path])) {
  77. unset($this->_data['subscriptions'][$path]);
  78. }
  79. }
  80. }