This package bundles common functionality for the Liszt Portal. This comprises the elasticsearch connection and translation of file formats.
You can obtain a Controller with easy access to elasticsearch by inheriting from ClientEnabledController.
use Slub\LisztCommon\Controller\ClientEnabledController;
class ActionController extends ClientEnabledController
{
public function ExampleAction()
{
$this->initializeClient();
$params = ...
$entity = $this->elasticClient->search($params);
...
}
}
You can read in an XML document and translate it to a PHP array or JSON.
use Slub\LisztCommon\Common\XmlDocument;
...
$xmlDocument = XmlDocument::from($xmlString);
$array = $xmlDocument->toArray();
$json = $xmlDocument->toJson();
If you have any questions or encounter any problems, please do not hesitate to contact me.