public function populate($row): void
    {
        if (is_array($row)) {
            $row = (object) $row;
        }

        $requiredFields = ['countryCode', 'vatNumber', 'requestDate', 'valid'];
        foreach ($requiredFields as $requiredField) {
            if (! isset($row->$requiredField)) {
                throw new InvalidArgumentException('Required field "' . $requiredField . '" is missing');
            }
        }

        $this
            // required parameters
            ->setCountryCode($row->countryCode)
             ->setVatNumber($row->vatNumber)
             ->setRequestDate($row->requestDate)
             ->setValid($row->valid)
            // optional parameters
            ->setName($row->traderName ?? '---')
            ->setAddress($row->traderAddress ?? '---')
            ->setIdentifier($row->requestIdentifier ?? '')
            ->setNameMatch($row->traderNameMatch ?? '')
            ->setCompanyTypeMatch($row->traderCompanyTypeMatch ?? '')
            ->setStreetMatch($row->traderStreetMatch ?? '')
            ->setPostcodeMatch($row->traderPostcodeMatch ?? '')
            ->setCityMatch($row->traderCityMatch ?? '')
        ;
    }
public function populate($row): void
    {
        if (is_array($row)) {
            $row = (object) $row;
        }

        $requiredFields = ['countryCode', 'vatNumber', 'requestDate', 'valid'];
        foreach ($requiredFields as $requiredField) {
            if (! isset($row->$requiredField)) {
                throw new InvalidArgumentException('Required field "' . $requiredField . '" is missing');
            }
        }

        $this
            // required parameters
            ->setCountryCode($row->countryCode)
             ->setVatNumber($row->vatNumber)
             ->setRequestDate($row->requestDate)
             ->setValid($row->valid)
            // optional parameters
            ->setName($row->traderName ?? '---')
            ->setAddress($row->traderAddress ?? '---')
            ->setIdentifier($row->requestIdentifier ?? '')
            ->setNameMatch($row->traderNameMatch ?? '')
            ->setCompanyTypeMatch($row->traderCompanyTypeMatch ?? '')
            ->setStreetMatch($row->traderStreetMatch ?? '')
            ->setPostcodeMatch($row->traderPostcodeMatch ?? '')
            ->setCityMatch($row->traderCityMatch ?? '')
        ;
    }
public function populate ( $ row ) : void { if ( is_array ( $ row ) ) { $ row = ( object ) $ row ; } $ requiredFields = [ 'countryCode' , 'vatNumber' , 'requestDate' , 'valid' ] ; foreach ( $ requiredFields as $ requiredField ) { if ( ! isset ( $ row -> $ requiredField ) ) { throw new InvalidArgumentException ( 'Required field "' . $ requiredField . '" is missing' ) ; } } $ this // required parameters -> setCountryCode ( $ row -> countryCode ) -> setVatNumber ( $ row -> vatNumber ) -> setRequestDate ( $ row -> requestDate ) -> setValid ( $ row -> valid ) // optional parameters -> setName ( $ row -> traderName ?? '---' ) -> setAddress ( $ row -> traderAddress ?? '---' ) -> setIdentifier ( $ row -> requestIdentifier ?? '' ) -> setNameMatch ( $ row -> traderNameMatch ?? '' ) -> setCompanyTypeMatch ( $ row -> traderCompanyTypeMatch ?? '' ) -> setStreetMatch ( $ row -> traderStreetMatch ?? '' ) -> setPostcodeMatch ( $ row -> traderPostcodeMatch ?? '' ) -> setCityMatch ( $ row -> traderCityMatch ?? '' ) ; }
Populates this response object with external data

@param array|stdClass $row
Populates this response object with external data