public function setTravelMode($travelMode = null)
    {
        $travelModes = array_diff(TravelMode::getTravelModes(), array(TravelMode::TRANSIT));

        if (!in_array($travelMode, $travelModes) && ($travelMode !== null)) {
            throw DistanceMatrixException::invalidDistanceMatrixRequestTravelMode();
        }

        $this->travelMode = $travelMode;
    }
public function setTravelMode($travelMode = null)
    {
        $travelModes = array_diff(TravelMode::getTravelModes(), array(TravelMode::TRANSIT));

        if (!in_array($travelMode, $travelModes) && ($travelMode !== null)) {
            throw DistanceMatrixException::invalidDistanceMatrixRequestTravelMode();
        }

        $this->travelMode = $travelMode;
    }
public function setTravelMode ( $ travelMode = null ) { $ travelModes = array_diff ( TravelMode :: getTravelModes ( ) , array ( TravelMode :: TRANSIT ) ) ; if ( ! in_array ( $ travelMode , $ travelModes ) && ( $ travelMode !== null ) ) { throw DistanceMatrixException :: invalidDistanceMatrixRequestTravelMode ( ) ; } $ this -> travelMode = $ travelMode ; }
Sets the distance matrix request travel mode.

@param string $travelMode The distance matrix request travel mode.

@throws \Ivory\GoogleMap\Exception\DistanceMatrixException If the travel mode is not valid.
Sets the distance matrix request travel mode .