Skip to content

Commit

Permalink
Merge pull request #1048 from sjinks/interfaces-bug-fix
Browse files Browse the repository at this point in the history
Fix wrong interface check in mvc/collection.c
  • Loading branch information
Phalcon committed Aug 10, 2013
2 parents 623af11 + 2bba604 commit f89d1bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ext/mvc/collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ PHP_METHOD(Phalcon_Mvc_Collection, __construct){
return;
}

PHALCON_VERIFY_INTERFACE(models_manager, phalcon_mvc_model_managerinterface_ce);
PHALCON_VERIFY_INTERFACE(models_manager, phalcon_mvc_collection_managerinterface_ce);
}

/**
Expand Down Expand Up @@ -2095,7 +2095,7 @@ PHP_METHOD(Phalcon_Mvc_Collection, unserialize){
return;
}

PHALCON_VERIFY_INTERFACE(manager, phalcon_mvc_model_managerinterface_ce);
PHALCON_VERIFY_INTERFACE(manager, phalcon_mvc_collection_managerinterface_ce);

/**
* Update the models manager
Expand Down
6 changes: 3 additions & 3 deletions ext/mvc/collection/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ PHALCON_INIT_CLASS(Phalcon_Mvc_Collection_Manager){
zend_declare_property_null(phalcon_mvc_collection_manager_ce, SL("_connectionServices"), ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_null(phalcon_mvc_collection_manager_ce, SL("_implicitObjectsIds"), ZEND_ACC_PROTECTED TSRMLS_CC);

zend_class_implements(phalcon_mvc_collection_manager_ce TSRMLS_CC, 2, phalcon_di_injectionawareinterface_ce, phalcon_events_eventsawareinterface_ce);
zend_class_implements(phalcon_mvc_collection_manager_ce TSRMLS_CC, 3, phalcon_di_injectionawareinterface_ce, phalcon_events_eventsawareinterface_ce, phalcon_mvc_collection_managerinterface_ce);

return SUCCESS;
}
Expand Down Expand Up @@ -371,7 +371,7 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, isUsingImplicitObjectIds){
* Returns the connection related to a model
*
* @param Phalcon\Mvc\CollectionInterface $model
* @return Phalcon\Db\AdapterInterface
* @return Phalcon\Db\AdapterInterface(?) MongoDB
*/
PHP_METHOD(Phalcon_Mvc_Collection_Manager, getConnection){

Expand Down Expand Up @@ -423,7 +423,7 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getConnection){
return;
}

PHALCON_VERIFY_INTERFACE(connection, phalcon_db_adapterinterface_ce);
/* PHALCON_VERIFY_INTERFACE(connection, phalcon_db_adapterinterface_ce); */
RETURN_CCTOR(connection);
}

Expand Down
1 change: 1 addition & 0 deletions unit-tests/ci/mongo.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=mongo.so

0 comments on commit f89d1bb

Please sign in to comment.