/**
  * Converts this object to array with XML tags
  * 
  * @return array. 
  */
 public function toArray()
 {
     $array = array('Enabled' => Utilities::booleanToString($this->_enabled));
     if (isset($this->_days)) {
         $array['Days'] = strval($this->_days);
     }
     return $array;
 }
Example #2
0
 /**
  * Converts this object to array with XML tags
  * 
  * @return array. 
  */
 public function toArray()
 {
     return array('Version' => $this->_version, 'Delete' => Utilities::booleanToString($this->_delete), 'Read' => Utilities::booleanToString($this->_read), 'Write' => Utilities::booleanToString($this->_write), 'RetentionPolicy' => !empty($this->_retentionPolicy) ? $this->_retentionPolicy->toArray() : null);
 }
 /**
  * @covers MicrosoftAzure\Storage\Common\Internal\Utilities::booleanToString
  */
 public function testBooleanToString()
 {
     // Setup
     $expected = 'true';
     $value = true;
     // Test
     $actual = Utilities::booleanToString($value);
     // Assert
     $this->assertEquals($expected, $actual);
 }
Example #4
0
 /**
  * Converts this object to array with XML tags
  * 
  * @return array. 
  */
 public function toArray()
 {
     $array = array('Version' => $this->_version, 'Enabled' => Utilities::booleanToString($this->_enabled));
     if ($this->_enabled) {
         $array['IncludeAPIs'] = Utilities::booleanToString($this->_includeAPIs);
     }
     $array['RetentionPolicy'] = !empty($this->_retentionPolicy) ? $this->_retentionPolicy->toArray() : null;
     return $array;
 }