1<?php
2
3/**
4 * Class ilBiblFileReaderFactory
5 *
6 * @author Fabian Schmid <fs@studer-raimann.ch>
7 */
8class ilBiblFileReaderFactory implements ilBiblFileReaderFactoryInterface
9{
10
11    /**
12     * @inheritDoc
13     */
14    public function getByType($type, ilBiblEntryFactoryInterface $entry_factory, ilBiblFieldFactoryInterface $field_factory, ilBiblAttributeFactoryInterface $attribute_factory)
15    {
16        switch ($type) {
17            case ilBiblTypeFactoryInterface::DATA_TYPE_BIBTEX:
18                return new ilBiblTexFileReader($entry_factory, $field_factory, $attribute_factory);
19            case ilBiblTypeFactoryInterface::DATA_TYPE_RIS:
20                return new ilBiblRisFileReader($entry_factory, $field_factory, $attribute_factory);
21            default:
22                throw new ilException("bibliografic type not found");
23        }
24    }
25}
26