Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task
alexander-schranz opened this issue Jan 19, 2023 · 0 comments
Open
1 task
Labels
features New feature or request SEAL Core Seal Core related issue

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Jan 19, 2023

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

@alexander-schranz alexander-schranz added features New feature or request SEAL Core Seal Core related issue labels Jan 19, 2023
@alexander-schranz alexander-schranz changed the title ODM/ORM based Datamapping to Document classes [Core] ODM/ORM based Datamapping to Document classes Jan 19, 2023
@alexander-schranz alexander-schranz changed the title [Core] ODM/ORM based Datamapping to Document classes [New package] ODM/ORM based Datamapping to Document classes Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features New feature or request SEAL Core Seal Core related issue
Projects
None yet
Development

No branches or pull requests

1 participant