VuFind API Documentation

IndexReservesCommand extends AbstractSolrAndIlsCommand
in package

Console command: index course reserves into Solr.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$catalog  : Connection
ILS connection
$defaultDelimiter  : string
Default delimiter for reading files
$defaultTemplate  : string
Default template for reading files
$requiredKeys  : array<string|int, string>
Keys required in the data to create a valid reserves index.
$solr  : Writer
Solr writer
__construct()  : mixed
Constructor
buildReservesIndex()  : UpdateDocument
Build the reserves index from date returned by the ILS driver, specifically: getInstructors, getDepartments, getCourses, findReserves
configure()  : void
Configure the command.
execute()  : int
Run the command.
getCsvReader()  : CsvReader
Construct a CSV reader.

Properties

$defaultDelimiter

Default delimiter for reading files

protected string $defaultDelimiter = ','

$defaultTemplate

Default template for reading files

protected string $defaultTemplate = 'BIB_ID,COURSE,INSTRUCTOR,DEPARTMENT'

$requiredKeys

Keys required in the data to create a valid reserves index.

protected array<string|int, string> $requiredKeys = ['INSTRUCTOR_ID', 'COURSE_ID', 'DEPARTMENT_ID']

Methods

__construct()

Constructor

public __construct(Writer $solr[, string|null $name = null ]) : mixed
Parameters
$solr : Writer

Solr writer

$name : string|null = null

The name of the command; passing null means it must be set in configure()

Return values
mixed

buildReservesIndex()

Build the reserves index from date returned by the ILS driver, specifically: getInstructors, getDepartments, getCourses, findReserves

protected buildReservesIndex(array<string|int, mixed> $instructors, array<string|int, mixed> $courses, array<string|int, mixed> $departments, array<string|int, mixed> $reserves) : UpdateDocument
Parameters
$instructors : array<string|int, mixed>

Array of instructors $instructor_id => $instructor

$courses : array<string|int, mixed>

Array of courses $course_id => $course

$departments : array<string|int, mixed>

Array of department $dept_id => $department

$reserves : array<string|int, mixed>

Array of reserves records from driver's findReserves.

Return values
UpdateDocument

execute()

Run the command.

protected execute(InputInterface $input, OutputInterface $output) : int
Parameters
$input : InputInterface

Input object

$output : OutputInterface

Output object

Return values
int

0 for success

getCsvReader()

Construct a CSV reader.

protected getCsvReader(array<string|int, mixed>|string $files, string $delimiter, string $template) : CsvReader
Parameters
$files : array<string|int, mixed>|string

Array of files to load (or single filename).

$delimiter : string

Delimiter used by file(s).

$template : string

Template showing field positions within file(s). Comma-separated list containing BIB_ID, INSTRUCTOR, COURSE, DEPARTMENT and/or SKIP. Default = BIB_ID,COURSE,INSTRUCTOR,DEPARTMENT

Return values
CsvReader

Search results