Distance Compare Class Part B
This post assumes advanced understanding of PHP and some object orientated knowledge.
In my last post, I outlined a basic class that compares addresses by distance. The class returns a sorted, filtered, or single best match from an array of addresses based on a single comparison address. However, this didn't fulfill my client's needs completely. I needed to extend this class to fill his needs, so I made a new class that utilized my basic class.
The first step was making a construct method that extended to gDistanceCompare's construct method. To do this, all I needed to do is put parent:: in front of the class method from gDistanceCompare.
public function __construct()
{
parent::__construct($this->_readCSV('PL_Locator_Website_Confirmations.csv'));
}
The client's information was in a csv file, so I made a method for turning the CSV information into an array that gDistanceCompare needs.
read more »