CSVInsuranceParser

Extends \APAPI\Parser\CSVParser

Base CSV Parser

Implements functionality that all CSV Parsers must have. Implementation of the inherited abstract parse method is left to concrete classes.

Methods

withHeaders

withHeaders($headers) 
static

Arguments

$headers

withFile

withFile($file) 
static

Arguments

$file

parse

parse($row) 

Arguments

$row

setHeaders

setHeaders(array $headers) 
inherited

Set the headers to use

Arguments

$headers

array

The headers

getHeaders

getHeaders() : array
inherited

Get the current headers in use

Response

array

parseFile

parseFile(string $file) : array|bool
inherited

Reads a CSV file and executes a concrete parse method on each one, returning an array of parsed rows (or false if the file can't be read). The first line is not parsed, as it's considered headers which must be set prior to calling parseFile via setHeaders

Arguments

$file

string

Path to the CSV file on disc

Response

array|bool

Properties


                                
inherited

headers

headers
inherited

Stores headers in use by this parser


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited