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

Fix #2319 In Model::_postSaveRelatedRecords add check whether value is object #2325

Merged
merged 3 commits into from
Apr 12, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updated
  • Loading branch information
dreamsxin committed Apr 11, 2014
commit ef335fe0a76337e78bbc4a9dc113b6c3e9ade3e1
6 changes: 3 additions & 3 deletions ext/mvc/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -6361,15 +6361,15 @@ PHP_METHOD(Phalcon_Mvc_Model, __set){
PHALCON_GET_HKEY(key, ah0, hp0);
PHALCON_GET_HVALUE(item);

PHALCON_INIT_NVAR(lower_key);
phalcon_fast_strtolower(lower_key, key);

if (Z_TYPE_P(item) == IS_OBJECT) {
if (instanceof_function_ex(Z_OBJCE_P(item), phalcon_mvc_modelinterface_ce, 1 TSRMLS_CC)) {
i++;
phalcon_array_append(&related, item, 0);
}
} else {
PHALCON_INIT_NVAR(lower_key);
phalcon_fast_strtolower(lower_key, key);

phalcon_update_property_zval_zval(this_ptr, lower_key, item TSRMLS_CC);

PHALCON_CALL_METHOD(&relation, manager, "getrelationbyalias", model_name, lower_property);
Expand Down