Scalr\Service\Aws\Ec2\V20140615\Ec2Api::_loadVpcData PHP Method

_loadVpcData() protected method

Loads VpcData from simple xml object
protected _loadVpcData ( SimpleXMLElement $v ) : Scalr\Service\Aws\Ec2\DataType\VpcData
$v SimpleXMLElement
return Scalr\Service\Aws\Ec2\DataType\VpcData Returns VpcData
    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;
    }
Ec2Api