Get the locaton coordinates.

@param Description $description The location description.

@return Coordinates|null
499259
private function getCoordinates(Description $description)
    {
        $latitude  = $description->getOptionalProperty('lat');
        $longitude = $description->getOptionalProperty('lng');

        if ($latitude === null || $longitude === null) {
            return null;
        }

        return new Coordinates($latitude, $longitude);
    }
615265
private function loadLocation(): ?Location
    {
        if (!$this->context->has('ez_location_id')) {
            return null;
        }

        return $this->locationService->loadLocation(
            (int) $this->context->get('ez_location_id')
        );
    }
996560
public function getNearestStreetPoint(Coordinate $coordinate) {
        $this->prepareServerUrl();
        
        $requestUrl = $this->server . 'nearest?' . $coordinate;
        $curl = curl_init();
        curl_setopt_array($curl, array(
           CURLOPT_RETURNTRANSFER => 1,
           CURLOPT_URL => $requestUrl,
        ));
        
        $resp = curl_exec($curl);
        
        curl_close($curl);
        $json = json_decode($resp);
        
        if($json->status === 0) {
            $latitude = $json->mapped_coordinate[0];
            $longitude = $json->mapped_coordinate[1];
            $name = $json->name;
            
            $retCoord = new Coordinate($latitude, $longitude);
            $retCoord->setName($name);
            
            return $retCoord;
        } else {
            throw new OsrmException("Osrm status error", $json->{'status'});
            return null;
        }
    }
358421
public function getLocation()
    {
        if ($this->location === null) {
            $this->location = new GeoLocation($this->getLat(), $this->getLng());
        }

        return $this->location;
    }
927877
public function setDescription($description)
    {
        $this->content = null;
        $this->parsedDescription = null;
        $this->description = trim($description);

        return $this;
    }
922189
public function parse($description)
    {
        $prices = array();

        $possiblePriceDescriptions = preg_split('/\s*;\s*/', $description);

        try {
            foreach ($possiblePriceDescriptions as $possiblePriceDescription) {
                $price = $this->parseSinglePriceDescription($possiblePriceDescription);
                $prices += $price;
            }
        } catch (RuntimeException $e) {
            $prices = array();
        }

        return $prices;
    }
662616
public static function convertLocationCoordinates(Location $location)
    {
        $coordinates = $location->getCoordinates()->getCoordinates();
        $coordinate = doubleval($coordinates[1]) . '%' . doubleval($coordinates[0]);
        $coordinate = strtr($coordinate, [
            '%'=>',',
            ','=>'.'
        ]);
        return $coordinate;
    }
543359
public function fetchLocation(AnCommandContext $context)
   {
       $data = $context->data;

       if($data->location_id){
           $attr = array('id' => $data->location_id);
       } else {
           $attr = array(
              'latitude' => $data->latitude,
              'longitude' => $data->longitude,
              'name' => $data->name,
              'address' => $data->address,
              'city' => $data->city,
              'state_province' => $data->state_province,
              'country' => $data->country,
              'postalcode' => $data->postalcode
           );
       }

       $this->_location = $this->getService('repos:locations.location')->findOrAddNew($attr);

       return $this->_location;
   }
889567
function step( $description )
    {
        if ( is_string( $description ) )
        {
            foreach (  $this->StepTable as $step )
            {
                if ( $step['class'] == $description )
                {
                    return $step;
                }
            }
        }
        else if ( is_int( $description ) )
        {
            if ( isset( $this->StepTable[$description] ) )
            {
                return $this->StepTable[$description];
            }
        }
        $retValue = null;
        return $retValue;
    }
515715
public function setDescription($description)
    {
        if ((strlen($description) > 500)) {
            throw new \InvalidArgumentException('invalid length for $description when calling PostCharactersCharacterIdFittingsFitting., must be smaller than or equal to 500.');
        }
        if ((strlen($description) < 0)) {
            throw new \InvalidArgumentException('invalid length for $description when calling PostCharactersCharacterIdFittingsFitting., must be bigger than or equal to 0.');
        }

        $this->container['description'] = $description;

        return $this;
    }
912143
private function getCategories(Description $description)
    {
        return array_map(
            function (\stdClass $categoryDescription) {
                return $this->categoryFactory->create(new Description($categoryDescription));
            },
            $description->getOptionalProperty('categories', [])
        );
    }
143953
public function getDocumentListEntry($location = null)
    {
        if ($location === null) {
            require_once 'Zend/Gdata/App/InvalidArgumentException.php';
            throw new Zend_Gdata_App_InvalidArgumentException(
                    'Location must not be null'
            );
        } else if ($location instanceof Zend_Gdata_Query) {
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }
        return parent::getEntry($uri, 'Zend_Gdata_Docs_DocumentListEntry');
    }
1089964
public function getLocator($type)
    {
        $result = null;

        if(isset($this->_locators[$type])) {
            $result = $this->_locators[$type];
        }

        return $result;
    }
46618
public function format_description($description) {
        $description = format_text($description, FORMAT_HTML, array('para' => false));
        $description = break_up_long_words($description, 30);

        return $description;
    }
1234356
public function editDescription(Description $description)
    {
        $this->guardNotDeleted();

        if ($description !== $this->description) {
            $this->apply(new DescriptionEdited($this->id, $description));
        }
    }
29992
public function setDescription($description)
    {
        if (!is_string($description)) {
            throw new \InvalidArgumentException('The attribute description on the class Entity has to be string (' . gettype($description) . ('object' === gettype($description) ? ' ' . get_class($description) : '') . ' given).');
        }

        $this->description = $description;

        return $this;
    }
162658
public function setDescription($description)
    {
        $this->description = (empty((string) $description) ? false : (string) $description);
    }