* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:record_drivers Wiki */ namespace VuFind\Marc\Serialization; /** * MARC serialization interface. * * @category VuFind * @package MARC * @author Ere Maijala * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:record_drivers Wiki */ interface SerializationInterface { /** * Check if the serialization class can parse the given MARC string * * @param string $marc MARC * * @return bool */ public static function canParse(string $marc): bool; /** * Check if the serialization class can parse the given MARC collection string * * @param string $marc MARC * * @return bool */ public static function canParseCollection(string $marc): bool; /** * Parse MARC collection from a string into an array of MarcReader classes * * @param string $collection MARC record collection in the format supported by * the serialization class * * @throws Exception * @return array */ public static function collectionFromString(string $collection): array; /** * Parse MARC from a string * * @param string $marc MARC record in the format supported by the serialization * class * * @throws Exception * @return array */ public static function fromString(string $marc): array; /** * Convert record to a string representing the format supported by the * serialization class * * @param array $data Record data * * @return string */ public static function toString(array $data): string; }