# jc-importer/2.8.3/class/Common/Importer/Parser/JSONParser.php

Import WP – CSV &amp; XML Import Export for WordPress, version 2.8.3. 31 lines.

- Page: https://pluginprobe.com/plugins/jc-importer/2.8.3/code/class/Common/Importer/Parser/JSONParser.php
- Raw: https://pluginprobe.com/plugins/jc-importer/2.8.3/raw/class/Common/Importer/Parser/JSONParser.php
- Modified: 2020-09-22T19:27:48+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.8.3/code/class/Common/Importer/Parser/JSONParser.php#L10-L20`.

```php
<?php

namespace ImportWP\Common\Importer\Parser;

use ImportWP\Common\Importer\ParserInterface;

class JSONParser extends AbstractParser implements ParserInterface
{
    /**
     * JSON Record
     *
     * @var array
     */
    private $json_record;

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

    protected function onRecordLoaded()
    {
        $this->json_record = json_decode($this->record, true);
    }

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

```
