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

Some keywords for models don't support getters/setters #11548

Closed
nsossonko opened this issue Mar 15, 2016 · 7 comments
Closed

Some keywords for models don't support getters/setters #11548

nsossonko opened this issue Mar 15, 2016 · 7 comments
Labels
stale Stale issue - automatically closed

Comments

@nsossonko
Copy link
Contributor

In relation to #11253 some of the keywords don't support getters and setters because Phalcon has conflicting function names. The ones I've found: source and transaction (probably schema too, but I haven't tried that).

@valVk
Copy link

valVk commented Mar 15, 2016

I've read #11253 issue.

And I disagree that functional words which are used in relational DB have to be used as columns names. it can cause many problems, so I do not see any reasons why they are can be used here. This is really, really, really strange decision.

@nsossonko
Copy link
Contributor Author

So don't use them. Why should your opinion prohibit others from using perfectly ok functionality?

@Jurigag
Copy link
Contributor

Jurigag commented Mar 16, 2016

Its obvious that they dont support them beacause Phalcon\Mvc\Model already have methods like get/setSource, get/setTransaction etc

There is no way to fix it. This problem can occur always. Its not a bug.

https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/model.zep

Anything after set/getAnything from here cant occur in your class as property or getters/setters wouldnt work. I think its obvious ?

That's why many frameworks dont provide themselves with classes like Model or Entity, which you have to extend. It's one of bad things in phalcon that you have extends Phalcons' model class to have models in your application.

Fixing this problem would need to introduce repository classes in phalcon where it mostly would be like current Phalcon\Mvc\Model but with many more things. Its too much effort right now i guess.

@nsossonko
Copy link
Contributor Author

There are ways to fix this (you, in fact, mention some options) and, while it's not necessarily a bug, it's certainly a valid feature request.

@Jurigag
Copy link
Contributor

Jurigag commented Mar 16, 2016

I think it's too much effort for now. Better to focus on finally supporting php 7. I guess in something like version 3 maybe they will think about changing model related things to working without extending classes.

@nsossonko
Copy link
Contributor Author

I could not agree more with the last statement (php 7). Thanks.

@stale
Copy link

stale bot commented Apr 17, 2018

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

@stale stale bot added the stale Stale issue - automatically closed label Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issue - automatically closed
Projects
None yet
Development

No branches or pull requests

4 participants