# jc-importer/2.7.5/class/Common/Importer/Parser/CSVParser.php

Import WP – CSV &amp; XML Import Export for WordPress, version 2.7.5. 35 lines.

- Page: https://pluginprobe.com/plugins/jc-importer/2.7.5/code/class/Common/Importer/Parser/CSVParser.php
- Raw: https://pluginprobe.com/plugins/jc-importer/2.7.5/raw/class/Common/Importer/Parser/CSVParser.php
- Modified: 2022-12-12T22:53:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jc-importer/2.7.5/code/class/Common/Importer/Parser/CSVParser.php#L10-L20`.

```php
<?php

namespace ImportWP\Common\Importer\Parser;

use ImportWP\Common\Importer\File\CSVFile;
use ImportWP\Common\Importer\ParserInterface;

/**
 * @property CSVFile $file
 */
class CSVParser extends AbstractParser implements ParserInterface
{
    /**
     * CSV Record
     *
     * @var array
     */
    private $csv_record;

    public function query($query)
    {
        return isset($this->csv_record[$query]) ? $this->csv_record[$query] : '';
    }

    protected function onRecordLoaded()
    {
        $this->csv_record = str_getcsv($this->record, $this->file->getDelimiter(), $this->file->getEnclosure());
    }

    public function record()
    {
        return $this->csv_record;
    }
}

```
