protected function _loadVpcData(\SimpleXMLElement $v)
{
$item = null;
if ($this->exist($v)) {
$vpcId = (string) $v->vpcId;
$item = $this->ec2->getEntityManagerEnabled() ? $this->ec2->vpc->get($vpcId) : null;
if ($item === null) {
$item = new VpcData();
$item->setEc2($this->ec2);
$bAttach = true;
} else {
$item->resetObject();
$bAttach = false;
}
$item->vpcId = $vpcId;
$item->cidrBlock = $this->exist($v->cidrBlock) ? (string) $v->cidrBlock : null;
$item->dhcpOptionsId = $this->exist($v->dhcpOptionsId) ? (string) $v->dhcpOptionsId : null;
$item->instanceTenancy = $this->exist($v->instanceTenancy) ? (string) $v->instanceTenancy : null;
$item->isDefault = $this->exist($v->isDefault) ? (string) $v->isDefault == 'true' : null;
$item->state = $this->exist($v->state) ? (string) $v->state : null;
$item->setTagSet($this->_loadResourceTagSetList($v->tagSet));
if ($bAttach && $this->ec2->getEntityManagerEnabled()) {
$this->getEntityManager()->attach($item);
}
}
return $item;
}