PHP Класс Eccube\Service\CsvImportService
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Показать файл
Открыть проект
Примеры использования класса
Защищенные свойства (Protected)
Открытые методы
Защищенные методы
Описание методов
__construct()
публичный Метод
convertEncodingRows()
защищенный Метод
Windows 版 PHP7 環境では、ファイルエンコーディングが CP932 になるため UTF-8 に変換する.
それ以外の環境では何もしない。
current()
публичный Метод
If a header row has been set, an associative array will be returned
getColumnHeaders()
публичный Метод
getErrors()
публичный Метод
Get rows that have an invalid number of columns
getFields()
публичный Метод
hasErrors()
публичный Метод
Does the reader contain any invalid rows?
mergeDuplicates()
защищенный Метод
So the following line:
|duplicate|duplicate|duplicate|
|first |second |third |
Yields value:
$duplicate => ['first', 'second', 'third']
If a header row has been set, the pointer is set just below the header
row. That way, when you iterate over the rows, that header row is
skipped.
setColumnHeaders()
публичный Метод
Описание свойств
$columnHeaders защищенное свойство
Column headers as read from the CSV file
protected array $columnHeaders |
Результат |
array |
|
$count защищенное свойство
Total number of rows in the CSV file
protected int $count |
Результат |
integer |
|
$errors защищенное свойство
protected array $errors |
Результат |
array |
|
$file защищенное свойство
protected SplFileObject $file |
Результат |
SplFileObject |
|