protected function _loadSubnetData(\SimpleXMLElement $v)
{
$item = null;
if ($this->exist($v)) {
$subnetId = (string) $v->subnetId;
$item = $this->ec2->getEntityManagerEnabled() ? $this->ec2->subnet->get($subnetId) : null;
if ($item === null) {
$item = new SubnetData();
$bAttach = true;
} else {
$item->resetObject();
$bAttach = false;
}
$item->setEc2($this->ec2);
$item->availabilityZone = $this->exist($v->availabilityZone) ? (string) $v->availabilityZone : null;
$item->availableIpAddressCount = $this->exist($v->availableIpAddressCount) ? (int) $v->availableIpAddressCount : null;
$item->cidrBlock = $this->exist($v->cidrBlock) ? (string) $v->cidrBlock : null;
$item->state = $this->exist($v->state) ? (string) $v->state : null;
$item->subnetId = $subnetId;
$item->vpcId = $this->exist($v->vpcId) ? (string) $v->vpcId : null;
$item->setTagSet($this->_loadResourceTagSetList($v->tagSet));
if ($bAttach && $this->ec2->getEntityManagerEnabled()) {
$this->getEntityManager()->attach($item);
}
}
return $item;
}