-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Model setSource #42
Comments
hi, what OS and PHP version are you using? |
centos PHP 5.3.8 (cli) |
Do the model support separation of read and write? |
This is odd, 0.4.4 passed that test more than two months ago, check the unit-test and the build log: cphalcon/unit-tests/ModelsTest.php Line 162 in 129b8e7
http://travis-ci.org/#!/phalcon/cphalcon/builds/1702635 |
I can get data from db,but it thow Exception when save data |
Anyway to post the code? |
Controller: username = 'test'; $user->truename = 'test'; $user->usertype = 1; $rs = $user->findFirst(); $user->save(); print_r($rs); exit; } ``` } Model: setSource("systemuser"); } } |
Can you write the findFirst as Users::findFirst() ? |
I am sorry, i use Users::findFirst(),but the result is also wrong. |
There seems to be a problem with this, Phalcon is calling the method initialize just once, due to this the second model instantiated does not have the new source. Could you try this: |
yes,it's ok.The framwork is very nice.But i don't know how to use some functions,For example the Db_Pool |
Here's the docs for Db_Pool: http://docs.phalconphp.com/en/latest/reference/db.html#connection-pooling |
I use setSource like this
setSource("systemuser"); } } but it don't work, PhalconException: "Table 'siteadmin.users' doesn't exist" when executing "DESCRIBE `users`"The text was updated successfully, but these errors were encountered: