The current abstraction requires json like arrays to be indexed and return that indexes. There should be in future another package build on top of seal package which will do mapping from PHP Classes so Document Object to this array and back to it.
<?php
use Schranz\Search\SEAL\Schema\Field;
use Schranz\Search\SEAL\Schema\Index;
#[Index(name: 'news')]
class News {
#[Field\IdentifierField('id')]
private string $id;
#[Field\TextField('title')]
private string $title;
#[Field\TypedField('header', 'type', [
'image' => [
'media' => new Field\IntegerField('media'),
],
'video' => [
'media' => new Field\TextField('media', searchable: false),
],
])]
private array $header;
// ...
}
The current abstraction requires json like arrays to be indexed and return that indexes. There should be in future another package build on top of
sealpackage which will do mapping fromPHP ClassessoDocument Objectto this array and back to it.So the
sealpackage will be something like what in doctrine isdoctrine/dbaland theodmor whatever we will call it will be whatdoctrine/ormis.A ODM Impelmentaiton could look like this:
Open Points
array<->objectmapping: Find the best way to map array to object maybe look at following components:ToDo