PHP Class 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.
显示文件
Open project: ec-cube/ec-cube
Class Usage Examples
Protected Properties
Public Methods
Protected Methods
Method Details
__construct()
public method
convertEncodingRows()
protected method
Windows 版 PHP7 環境では、ファイルエンコーディングが CP932 になるため UTF-8 に変換する.
それ以外の環境では何もしない。
If a header row has been set, an associative array will be returned
getColumnHeaders()
public method
getErrors()
public method
Get rows that have an invalid number of columns
getFields()
public method
hasErrors()
public method
Does the reader contain any invalid rows?
mergeDuplicates()
protected method
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()
public method
Property Details
$columnHeaders protected_oe property
Column headers as read from the CSV file
protected array $columnHeaders |
return |
array |
|
$count protected_oe property
Total number of rows in the CSV file
protected int $count |
return |
integer |
|
$errors protected_oe property
protected array $errors |
return |
array |
|
$file protected_oe property
protected SplFileObject $file |
return |
SplFileObject |
|