Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\IO\EntityIdReader Class Reference

EntityIdReader reads entity IDs from a file, one per line. More...

+ Inheritance diagram for Wikibase\Repo\IO\EntityIdReader:
+ Collaboration diagram for Wikibase\Repo\IO\EntityIdReader:

Public Member Functions

 __construct (LineReader $reader, EntityIdParser $parser, $entityType=null)
 
 setExceptionHandler (ExceptionHandler $exceptionHandler)
 
 getExceptionHandler ()
 
 dispose ()
 Closes the underlying input stream. More...
 
 fetchIds ( $limit)
 Fetches the next batch of IDs. More...
 

Protected Member Functions

 lineToId ( $line)
 
 next ()
 Returns the next ID (or null if there are no more ids). More...
 

Private Attributes

 $reader
 
 $parser
 
 $entityType
 
 $exceptionHandler
 

Detailed Description

EntityIdReader reads entity IDs from a file, one per line.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\IO\EntityIdReader::__construct ( LineReader  $reader,
EntityIdParser  $parser,
  $entityType = null 
)
Parameters
LineReader$reader
EntityIdParser$parser
null | string$entityTypeThe desired entity type, or null for any type.

Member Function Documentation

◆ dispose()

Wikibase\Repo\IO\EntityIdReader::dispose ( )

Closes the underlying input stream.

◆ fetchIds()

Wikibase\Repo\IO\EntityIdReader::fetchIds (   $limit)

Fetches the next batch of IDs.

Calling this has the side effect of advancing the internal state of the page, typically implemented by some underlying resource such as a file pointer or a database connection.

Note
After some finite number of calls, this method should eventually return an empty list of IDs, indicating that no more IDs are available.
Parameters
int$limitThe maximum number of IDs to return.
Returns
EntityId[] A list of EntityIds matching the given parameters. Will be empty if there are no more entities to list from the given offset.

◆ getExceptionHandler()

Wikibase\Repo\IO\EntityIdReader::getExceptionHandler ( )
Returns
ExceptionHandler

◆ lineToId()

Wikibase\Repo\IO\EntityIdReader::lineToId (   $line)
protected
Parameters
string$line
Returns
EntityId|null

◆ next()

Wikibase\Repo\IO\EntityIdReader::next ( )
protected

Returns the next ID (or null if there are no more ids).

Returns
EntityId|null

◆ setExceptionHandler()

Wikibase\Repo\IO\EntityIdReader::setExceptionHandler ( ExceptionHandler  $exceptionHandler)

Member Data Documentation

◆ $entityType

Wikibase\Repo\IO\EntityIdReader::$entityType
private

◆ $exceptionHandler

Wikibase\Repo\IO\EntityIdReader::$exceptionHandler
private

◆ $parser

Wikibase\Repo\IO\EntityIdReader::$parser
private

◆ $reader

Wikibase\Repo\IO\EntityIdReader::$reader
private

The documentation for this class was generated from the following file: