Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.31 KB

README.md

File metadata and controls

50 lines (34 loc) · 1.31 KB

Common Tools for the Liszt Portal

TYPO3 11 CC-BY

This package bundles common functionality for the Liszt Portal. This comprises the elasticsearch connection and translation of file formats.

Features

ClientEnabledController

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);
      ...
        
  }

}

Translation between XML and JSON

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();

Maintainer

If you have any questions or encounter any problems, please do not hesitate to contact me.