doctrine / doctrine/phpcr-odm

Allow serialized objects?

Open
#727 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
181
Forks
102
PR merge metrics
No merged PRs in 30d

Description

Currently if you want to store an object as a property of a document, you need to map it as a child document

Doctrine ORM has the option to store ojects as serialized PHP, this is can be more desireable than mapping a child document for performance reasons.

So I would propose something like:

``` php
/**
* @PHPCRODM\Field(type="php_object")
*/
```

(FTR Doctrine ORM uses `object`, not sure if that would be better here).

Alternatively we could make it possible for users to implement custom types (I don't think this is already possible?).

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing field type and mapping behavior in PHPCR-ODM, then investigate whether custom types are currently supported. Define the intended behavior for storing serialized PHP objects and compare it with the alternative of exposing user-defined types; done means one documented, supported approach with appropriate coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.