1 | <?php |
||
17 | class SongLoader |
||
18 | { |
||
19 | const CODE_LENGTH = 6; // min to avoid clashes |
||
20 | |||
21 | protected $startRow = 2; |
||
22 | |||
23 | protected $showProgress = false; |
||
24 | |||
25 | /** |
||
26 | * Store contents of specified XLS file to the given database handle |
||
27 | * |
||
28 | * @param string $sourceFile Path to file |
||
29 | * @param Connection $dbConn DB connection |
||
30 | * @return int Number of non-duplicate songs stored |
||
31 | * @throws \PHPExcel_Exception |
||
32 | * @throws \PHPExcel_Reader_Exception |
||
33 | * @throws \Doctrine\DBAL\DBALException |
||
34 | */ |
||
35 | public function run($sourceFile, Connection $dbConn) |
||
84 | |||
85 | /** |
||
86 | * @param bool $showProgress |
||
87 | * @return SongLoader |
||
88 | */ |
||
89 | public function setShowProgress($showProgress) |
||
94 | |||
95 | /** |
||
96 | * @param $i |
||
97 | */ |
||
98 | protected function printProgressMarker($i) |
||
113 | |||
114 | /** |
||
115 | * FIXME redefine as return RowMapperInterface |
||
116 | * |
||
117 | * @param $dataStore |
||
118 | * @return RclRowMapper |
||
119 | */ |
||
120 | protected function getRowMapper($dataStore) |
||
124 | } |
||
125 |