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

[NFR]: Global variable for reusable in ORM #14788

Closed
zak-wojtek77 opened this issue Jan 29, 2020 · 6 comments
Closed

[NFR]: Global variable for reusable in ORM #14788

zak-wojtek77 opened this issue Jan 29, 2020 · 6 comments
Labels
new feature request Planned Feature or New Feature Request

Comments

@zak-wojtek77
Copy link

In every model every relationship does not use cache. If I want to use cache I have to write 'reusable' => true:

$this->hasOne(
            'inv_cst_id',
            Customers::class,
            'cst_id',
            [
                'alias'    => 'customers',
                'reusable' => true,
            ]
        );

My proposal: add new global option:
phalcon..orm.reusable = false
if I don't write in relationship "'reusable' => true" but I write
phalcon..orm.reusable = true
then will be the same like I write "'reusable' => true".

Priority of global variable would be less than option "reusable" written in relationship.

@zak-wojtek77 zak-wojtek77 added the new feature request Planned Feature or New Feature Request label Jan 29, 2020
@TimurFlush
Copy link

The offer is good, but dangerous

@zak-wojtek77
Copy link
Author

why dangerous?

@TimurFlush
Copy link

@zak-wojtek77 A very large amount of data from the DBMS may get into the cache. If you do this thing, you should turn it off by default.

@niden
Copy link
Member

niden commented Jan 30, 2020

I agree with @TimurFlush. This can be abused if set to true by default.

@niden niden changed the title global variable for reusable in ORM [NFR]: [NFR]: Global variable for reusable in ORM Jan 30, 2020
@niden
Copy link
Member

niden commented Jan 30, 2020

Closing in favor of #14608

Please vote for this feature there

@niden niden closed this as completed Jan 30, 2020
@zak-wojtek77
Copy link
Author

I agree with @TimurFlush. This can be abused if set to true by default.

Of course by default it should be 'false'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request Planned Feature or New Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants