src/Batch/BatchGeocoded.php
public function fromArray(array $data = [])
    {
        if (isset($data['providerName'])) {
            $this->providerName = $data['providerName'];
        }
        if (isset($data['query'])) {
            $this->query = $data['query'];
        }
        if (isset($data['exception'])) {
            $this->exception = $data['exception'];
        }

        //GeoCoder Address::createFromArray expects longitude/latitude keys
        $data['address']['longitude'] = $data['address']['coordinates']['longitude'] ?? null;
        $data['address']['latitude'] = $data['address']['coordinates']['latitude'] ?? null;

        // Shortcut to create the address and set it in this class
        $this->setAddress(Address::createFromArray($data['address']));
    }
public function fromArray(array $data = [])
    {
        if (isset($data['providerName'])) {
            $this->providerName = $data['providerName'];
        }
        if (isset($data['query'])) {
            $this->query = $data['query'];
        }
        if (isset($data['exception'])) {
            $this->exception = $data['exception'];
        }

        //GeoCoder Address::createFromArray expects longitude/latitude keys
        $data['address']['longitude'] = $data['address']['coordinates']['longitude'] ?? null;
        $data['address']['latitude'] = $data['address']['coordinates']['latitude'] ?? null;

        // Shortcut to create the address and set it in this class
        $this->setAddress(Address::createFromArray($data['address']));
    }
public function fromArray ( array $ data = [ ] ) { if ( isset ( $ data [ 'providerName' ] ) ) { $ this -> providerName = $ data [ 'providerName' ] ; } if ( isset ( $ data [ 'query' ] ) ) { $ this -> query = $ data [ 'query' ] ; } if ( isset ( $ data [ 'exception' ] ) ) { $ this -> exception = $ data [ 'exception' ] ; } //GeoCoder Address::createFromArray expects longitude/latitude keys $ data [ 'address' ] [ 'longitude' ] = $ data [ 'address' ] [ 'coordinates' ] [ 'longitude' ] ?? null ; $ data [ 'address' ] [ 'latitude' ] = $ data [ 'address' ] [ 'coordinates' ] [ 'latitude' ] ?? null ; // Shortcut to create the address and set it in this class $ this -> setAddress ( Address :: createFromArray ( $ data [ 'address' ] ) ) ; }
Create an instance from an array, used from cache libraries.

@param array $data
Create an instance from an array used from cache libraries .