1 | <?php |
||
9 | abstract class Base implements BulkImportFileHandler |
||
10 | { |
||
11 | protected $file; |
||
12 | protected $fields; |
||
13 | protected $filePath; |
||
14 | protected $fileHandle; |
||
15 | |||
16 | /** |
||
17 | * Base constructor. |
||
18 | * @param $filePath |
||
19 | * |
||
20 | * @throws \Dyrynda\Artisan\Exceptions\ImportFileException |
||
21 | */ |
||
22 | 16 | public function __construct(SplFileInfo $file) |
|
40 | |||
41 | /** |
||
42 | * Checks file for valid syntax. |
||
43 | * |
||
44 | * @return void |
||
45 | * @throws \Dyrynda\Artisan\Exceptions\ImportFileException |
||
46 | */ |
||
47 | abstract protected function validateSyntax(); |
||
48 | |||
49 | /** |
||
50 | * Get the info from the file. |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | abstract public function getData(); |
||
55 | } |
||
56 |