/** * Create ManifestStatistics from array * * @param array $options Array containing values for object properties * * @return WindowsAzure\MediaServices\Models\IngestManifestStatistics */ public static function createFromOptions($options) { $statistics = new IngestManifestStatistics(); $statistics->fromArray($options); return $statistics; }
/** * Fill manifest from array * * @param array $options Array containing values for object properties * * @return none */ public function fromArray($options) { if (isset($options['Id'])) { Validate::isString($options['Id'], 'options[Id]'); $this->_id = $options['Id']; } if (isset($options['State'])) { Validate::isInteger($options['State'], 'options[State]'); $this->_state = $options['State']; } if (isset($options['Created'])) { Validate::isDateString($options['Created'], 'options[Created]'); $this->_created = new \DateTime($options['Created']); } if (isset($options['LastModified'])) { Validate::isDateString($options['LastModified'], 'options[LastModified]'); $this->_lastModified = new \DateTime($options['LastModified']); } if (isset($options['Name'])) { Validate::isString($options['Name'], 'options[Name]'); $this->_name = $options['Name']; } if (isset($options['BlobStorageUriForUpload'])) { Validate::isValidUri($options['BlobStorageUriForUpload'], 'options[BlobStorageUriForUpload]'); $this->_blobStorageUriForUpload = $options['BlobStorageUriForUpload']; } if (isset($options['Statistics'])) { $this->_statistics = null; if (is_array($options['Statistics'])) { $this->_statistics = IngestManifestStatistics::createFromOptions($options['Statistics']); } } if (isset($options['StorageAccountName'])) { Validate::isString($options['StorageAccountName'], 'options[StorageAccountName]'); $this->_storageAccountName = $options['StorageAccountName']; } }
/** * @covers WindowsAzure\MediaServices\Models\IngestManifestStatistics::getPendingFilesCount */ public function testGetPendingFilesCount() { // Setup $pendingFilesCount = 2; $options = array('PendingFilesCount' => $pendingFilesCount); $manifestStatistics = IngestManifestStatistics::createFromOptions($options); // Test $result = $manifestStatistics->getPendingFilesCount(); // Assert $this->assertEquals($pendingFilesCount, $result); }