Parser
Defines the contract for all parsers. A parser receives a single row as input and generates a key => value array with the result.
getValidFields(string $type) : array
Get which fields are considered valid in a specific Parser subclass. The mechanism is very simple: valid fields are declared as protected properties in the subclass, and named with a typeValidFields nomenclature.
Example:
class CSVActivateParser extends CSVParser { protected $activateValidFields = array( "loanid" => "loanId", "activate" => "activate" ); }
In this case 'activate' is the type, so to get this class valid fields:
getValidFields('activate');
string
The valid fields type
array
parse(array $row) : array
Abstract function that must be implemented by subclasses to define the parsing strategy.
array
The current row to parse
array