/** * Returns the first record found in the file $filename, or null if no records found. * * @param $filename * @return null|Collection */ public static function fromFile($filename) { $records = Collection::fromFile($filename)->toArray(); if (!count($records)) { throw new RecordNotFound(); } return $records[0]; }
protected function getNthrecord($n) { $records = Collection::fromFile('tests/data/sru-alma.xml')->toArray(); return $records[$n - 1]; }
/** * @inheritdoc */ public function loadFile($file) { $collection = MarcCollection::fromFile($file); return $this->convertRecord($collection->records); }
public function testAlmaSample() { $collection = Collection::fromFile('tests/data/sru-alma.xml'); $this->assertCount(3, $collection->toArray()); }