コード例 #1
0
ファイル: Record.php プロジェクト: scriptotek/marc
 /**
  * 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];
 }
コード例 #2
0
ファイル: SubjectFieldTest.php プロジェクト: scriptotek/marc
 protected function getNthrecord($n)
 {
     $records = Collection::fromFile('tests/data/sru-alma.xml')->toArray();
     return $records[$n - 1];
 }
コード例 #3
0
ファイル: MarcMrcReader.php プロジェクト: tonyhhyip/marc4php
 /**
  * @inheritdoc
  */
 public function loadFile($file)
 {
     $collection = MarcCollection::fromFile($file);
     return $this->convertRecord($collection->records);
 }
コード例 #4
0
ファイル: CollectionTest.php プロジェクト: scriptotek/marc
 public function testAlmaSample()
 {
     $collection = Collection::fromFile('tests/data/sru-alma.xml');
     $this->assertCount(3, $collection->toArray());
 }