phalcon-devtools icon indicating copy to clipboard operation
phalcon-devtools copied to clipboard

creating model: not including set/getSource

Open ug19 opened this issue 12 years ago • 4 comments

Hi everyone!

I would like to report an error with creating model in a console.

I have a table "users_flowers". The problem is that the name of generated model is "UsersFlowers" but there is no information about a real table name - I mean there is no setSource/getSoruce method.

By the way I have analizyed the docs and still do not understand the difference between setSource and getSource but maybe it's not a place.

I am kind of beginner in terms of frameworks so sorry if it's not really an issue. But voiced lot of "fucks" looking for an error in my hasManyTomany till I found what was wrong, hehe:)

I am using Phalcon 1.3.0, Bitnami WAMP, MySQL, Windows XP.

ug19 avatar Mar 24 '14 20:03 ug19

@ug19 In phalcon when table is "users_flowers" to correspond with Model is "UsersFlowers" in project phalcon. So that get result or qureryv in table "user_flowers" in database .

$result = UsersFlowers::finnd()

duythien avatar Mar 25 '14 03:03 duythien

@duythien Yes, I know that.

My issue is about an error in phalcon developer tool when using it to generate model. The tool does not generate any setSource/getSource method when a table name is sth like "users_flowers" and because of that model does not work.

ug19 avatar Mar 25 '14 08:03 ug19

aha

duythien avatar Mar 25 '14 11:03 duythien

@ug19 Fixed in 2.0.x branch

sergeyklay avatar Oct 13 '15 23:10 sergeyklay