public function addAddress(AddressInterface $address)
    {
        if ($this->addresses->contains($address)) {
            throw new \InvalidArgumentException('This contact already owns this address');
        }

        $this->addresses->add($address);

        if (!$this->defaultAddress) {
            $this->setDefaultAddress($address);
        }
    }
public function addAddress(AddressInterface $address)
    {
        if ($this->addresses->contains($address)) {
            throw new \InvalidArgumentException('This contact already owns this address');
        }

        $this->addresses->add($address);

        if (!$this->defaultAddress) {
            $this->setDefaultAddress($address);
        }
    }
public function addAddress ( AddressInterface $ address ) { if ( $ this -> addresses -> contains ( $ address ) ) { throw new \ InvalidArgumentException ( 'This contact already owns this address' ) ; } $ this -> addresses -> add ( $ address ) ; if ( ! $ this -> defaultAddress ) { $ this -> setDefaultAddress ( $ address ) ; } }
Add an Address to the collection.

@param AddressInterface $address
Add an Address to the collection .