protected function _loadVolumeData(\SimpleXMLElement $v)
{
$item = null;
if ($this->exist($v)) {
$volumeId = (string) $v->volumeId;
$item = $this->ec2->getEntityManagerEnabled() ? $this->ec2->volume->get($volumeId) : null;
if ($item === null) {
$item = new VolumeData();
$item->setEc2($this->ec2);
$bAttach = true;
} else {
$item->resetObject();
$bAttach = false;
}
$item->volumeId = $volumeId;
$item->volumeType = $this->exist($v->volumeType) ? (string) $v->volumeType : null;
$item->iops = $this->exist($v->iops) ? (int) $v->iops : null;
$item->availabilityZone = $this->exist($v->availabilityZone) ? (string) $v->availabilityZone : null;
$item->createTime = $this->exist($v->createTime) ? new DateTime((string) $v->createTime, new DateTimeZone('UTC')) : null;
$item->size = $this->exist($v->size) ? (string) $v->size : null;
$item->snapshotId = $this->exist($v->snapshotId) ? (string) $v->snapshotId : null;
$item->status = $this->exist($v->status) ? (string) $v->status : null;
$item->encrypted = $this->exist($v->encrypted) ? (string) $v->encrypted == 'true' : null;
$item->kmsKeyId = $this->exist($v->kmsKeyId) ? (string) $v->kmsKeyId : null;
$item->setTagSet($this->_loadResourceTagSetList($v->tagSet))->setAttachmentSet($this->_loadAttachmentSetResponseList($v->attachmentSet));
if ($bAttach && $this->ec2->getEntityManagerEnabled()) {
$this->getEntityManager()->attach($item);
}
}
return $item;
}