src/Porter.php
public function importOne(ImportSpecification $specification)
    {
        $results = $this->import($specification);

        if (!$results->valid()) {
            return null;
        }

        $one = $results->current();

        if ($results->next() || $results->valid()) {
            throw new ImportException('Cannot import one: more than one record imported.');
        }

        return $one;
    }
public function importOne(ImportSpecification $specification)
    {
        $results = $this->import($specification);

        if (!$results->valid()) {
            return null;
        }

        $one = $results->current();

        if ($results->next() || $results->valid()) {
            throw new ImportException('Cannot import one: more than one record imported.');
        }

        return $one;
    }
public function importOne ( ImportSpecification $ specification ) { $ results = $ this -> import ( $ specification ) ; if ( ! $ results -> valid ( ) ) { return null ; } $ one = $ results -> current ( ) ; if ( $ results -> next ( ) || $ results -> valid ( ) ) { throw new ImportException ( 'Cannot import one: more than one record imported.' ) ; } return $ one ; }
Imports one record according to the design of the specified import specification.

@param ImportSpecification $specification Import specification.

@return array|null Record.

@throws ImportException More than one record was imported.
Imports one record according to the design of the specified import specification .