\Amelaye\BioPHP\Domain\Database\Interfaces RecordStorageInterface

Interface RecordStorageInterface

Summary

Methods
Constants
store()
storeFile()
find()
No public constants found

Methods

store()

store(string  $sDbFormat, array  $aLines, \Amelaye\BioPHP\Domain\Database\Entity\Collection|null  $oCollection = null) : \Amelaye\BioPHP\Domain\Database\Entity\ParsedRecord

Parses the lines of one record and stores what was read. A record already stored under the same format and identifier is updated rather than duplicated.

Parameters

string $sDbFormat

Database format, e.g. "GENBANK"

array $aLines

The lines of the record

\Amelaye\BioPHP\Domain\Database\Entity\Collection|null $oCollection

The collection the record belongs to

Throws

\Exception

Returns

\Amelaye\BioPHP\Domain\Database\Entity\ParsedRecord —

storeFile()

storeFile(string  $sDbName, string  $sDbFormat, string  ...$aDataFiles) : int

Parses every record of one or several data files and stores them in a collection.

Parameters

string $sDbName

Name of the collection, created when it does not exist

string $sDbFormat

Database format, e.g. "GENBANK"

string $aDataFiles variadic

Files to parse

Throws

\Exception

Returns

int —

Number of records stored

find()

find(string  $sDbFormat, string  $sEntryId) : \Amelaye\BioPHP\Domain\Database\Entity\ParsedRecord|null

Parameters

string $sDbFormat

Database format, e.g. "GENBANK"

string $sEntryId

Identifier of the record

Returns

\Amelaye\BioPHP\Domain\Database\Entity\ParsedRecord|null —