-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
SEAL CoreSeal Core related issueSeal Core related issuefeaturesNew feature or requestNew feature or request
Description
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.
So the seal
package will be something like what in doctrine is doctrine/dbal
and the odm
or whatever we will call it will be what doctrine/orm
is.
A ODM Impelmentaiton could look like this:
<?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;
// ...
}
Open Points
-
array
<->object
mapping: Find the best way to map array to object maybe look at following components:- Symfony Normalizer and Denormalizer
- Symfony PropertyAccessor
- Symfony ObjectMapper (think does not support array to object)
- Doctrine Object Instantiator
- thephpleague/object-mapper
- JanePHP
- CuyZ/Valinor
- Check what we can keep in mind from @Pierstoval feedback here: Returned documents as objects, for metadata #512
ToDo
- Own seal-attributes package which contains the Attributes and AttributeSchemaLoader based on SchemaLoaderInterface
- Own seal-odm package with ObjectManager which wraps the EngineInterface and maps array result to the object and back.
- Doctrine Implementation Objectmapper? from Entity to our own ODM Documents
Metadata
Metadata
Assignees
Labels
SEAL CoreSeal Core related issueSeal Core related issuefeaturesNew feature or requestNew feature or request