34 lines
688 B
PHP
34 lines
688 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OaiSymfony\OAI\Verb;
|
|
|
|
use OaiSymfony\OAI\OaiIdentify;
|
|
use OaiSymfony\OAI\OaiBase;
|
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
|
|
|
/**
|
|
* Identify data for the repository
|
|
*/
|
|
final class Identify
|
|
{
|
|
public readonly OaiIdentify $identify;
|
|
|
|
public function __construct(
|
|
private readonly ?ParameterBagInterface $params
|
|
)
|
|
{
|
|
$this->identify = new OaiIdentify($this->params);
|
|
}
|
|
|
|
/**
|
|
* Returns the XML response
|
|
*/
|
|
public function response(): string
|
|
{
|
|
$xml = $this->identify->toXML();
|
|
return OaiBase::create($this->params, $xml, 'Identify');
|
|
}
|
|
}
|