Skip to content

Commit

Permalink
+ Fixed undefined method call `Phalcon\Mvc\Collection\Manager::getCon…
Browse files Browse the repository at this point in the history
…nectionService`
  • Loading branch information
AlexKomrakov committed Apr 28, 2016
1 parent 2953d64 commit 7ff7ea0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Added ability to setLogLevel on multiple logs [#10429](https://github.com/phalcon/cphalcon/pull/10429)
- Fixed regression changes for `Phalcon\Translate\Adapter\Gettext::prepareOptions` [#11429](https://github.com/phalcon/cphalcon/issues/11429)
- Fixed `Phalcon\Mvc\View\Engine\Volt::callMacro` bug. Now it's correctly calling `call_user_func_array` instead of `call_user_func`
- Fixed undefined method call `Phalcon\Mvc\Collection\Manager::getConnectionService`. Now `Phalcon\Mvc\Collection::getConnectionService` works correctly in according to documentation

# [2.0.10](https://github.com/phalcon/cphalcon/releases/tag/phalcon-v2.0.10) (2016-02-04)
- ORM: Added support for DATE columns in Oracle
Expand Down
18 changes: 17 additions & 1 deletion phalcon/mvc/collection/manager.zep
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Manager implements InjectionAwareInterface, EventsAwareInterface
* Returns a custom events manager related to a model
*
* @param \Phalcon\Mvc\CollectionInterface $model
* @return \Phalcon\Events\ManagerInterface
* @return \Phalcon\Events\ManagerInterface
*/
public function getCustomEventsManager(<CollectionInterface> model) //-> <\Phalcon\Events\ManagerInterface>
{
Expand Down Expand Up @@ -181,6 +181,22 @@ class Manager implements InjectionAwareInterface, EventsAwareInterface
let this->_connectionServices[get_class(model)] = connectionService;
}

/**
* Gets a connection service for a specific model
*/
public function getConnectionService(<CollectionInterface> model) -> string
{
var service, entityName;

let service = "mongo";
let entityName = get_class(model);
if isset this->_connectionServices[entityName] {
let service = this->_connectionServices[entityName];
}

return service;
}

/**
* Sets whether a model must use implicit objects ids
*/
Expand Down

0 comments on commit 7ff7ea0

Please sign in to comment.