Skip to content

[New package] ODM/ORM based Datamapping to Document classes #81

@alexander-schranz

Description

@alexander-schranz

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

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

No one assigned

    Labels

    SEAL CoreSeal Core related issuefeaturesNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions