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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/in memory behavior #590

Draft
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

nikophil
Copy link
Member

@nikophil nikophil commented Apr 9, 2024

Here is a first draft for "in memory" behavior

see #533

This still needs a bit of polish, and some thinking on how is the best way to achieve this 馃槃

NB: In a follow up PR, I'll introduce InMemoryRepositoryDecorator, so it will be easier to make assertions

@nikophil nikophil changed the base branch from 1.x to 2.x April 9, 2024 07:07
@nikophil nikophil force-pushed the feat/in-memory-behavior branch 3 times, most recently from 4add46a to 57bbc01 Compare May 1, 2024 18:55
Comment on lines 19 to 23
/**
* @var array<class-string<T>, GenericInMemoryRepository<T>>
*/
private array $genericInMemoryRepositories = [];
Copy link
Member Author

@nikophil nikophil May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those should not be stored here... I think I'll introduce a InMemoryRepositroyRegistry

*/
function enable_in_memory(): void
{
Configuration::instance()->enableInMemory();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first, I did something like:

Configuration::instance()->persistence()->enableInMemory();

and the $inMemory boolean was stored in PersistenceManager. But then, all InMemoryTest did not worked when no persistence is activated, which is a non-sense 馃し

Then I decided to store this in the Configuration class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant