diff --git a/ext/phalcon/mvc/model/behavior.zep.c b/ext/phalcon/mvc/model/behavior.zep.c new file mode 100644 index 00000000000..7a9ec49ae19 --- /dev/null +++ b/ext/phalcon/mvc/model/behavior.zep.c @@ -0,0 +1,208 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/object.h" +#include "kernel/memory.h" +#include "kernel/operators.h" +#include "kernel/array.h" +#include "ext/spl/spl_exceptions.h" +#include "kernel/exception.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Phalcon\Mvc\Model\Behavior + * + * This is an optional base class for ORM behaviors + */ +ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior) { + + ZEPHIR_REGISTER_CLASS(Phalcon\\Mvc\\Model, Behavior, phalcon, mvc_model_behavior, phalcon_mvc_model_behavior_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + /** + * @var array + */ + zend_declare_property_null(phalcon_mvc_model_behavior_ce, SL("options"), ZEND_ACC_PROTECTED TSRMLS_CC); + + zend_class_implements(phalcon_mvc_model_behavior_ce TSRMLS_CC, 1, phalcon_mvc_model_behaviorinterface_ce); + return SUCCESS; + +} + +/** + * Phalcon\Mvc\Model\Behavior + */ +PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct) { + + zval *options_param = NULL; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 1, &options_param); + + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); + } + + + zephir_update_property_zval(this_ptr, SL("options"), &options); + ZEPHIR_MM_RESTORE(); + +} + +/** + * Returns the behavior options related to an event + * + * @return array + */ +PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions) { + + zval *eventName_param = NULL, options, eventOptions, _0; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&eventOptions); + ZVAL_UNDEF(&_0); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 1, &eventName_param); + + if (!eventName_param) { + ZEPHIR_INIT_VAR(&eventName); + ZVAL_STRING(&eventName, ""); + } else { + if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { + zephir_get_strval(&eventName, eventName_param); + } else { + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); + } + } + + + zephir_read_property(&_0, this_ptr, SL("options"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&options, &_0); + if (!ZEPHIR_IS_STRING_IDENTICAL(&eventName, "")) { + if (!(zephir_array_isset_fetch(&eventOptions, &options, &eventName, 1 TSRMLS_CC))) { + RETURN_MM_NULL(); + } + RETURN_CTOR(&eventOptions); + } + RETURN_CCTOR(&options); + +} + +/** + * Acts as fallbacks when a missing method is called on the model + */ +PHP_METHOD(Phalcon_Mvc_Model_Behavior, missingMethod) { + + zval arguments; + zval method; + zval *model, model_sub, *method_param = NULL, *arguments_param = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&arguments); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 1, &model, &method_param, &arguments_param); + + zephir_get_strval(&method, method_param); + if (!arguments_param) { + ZEPHIR_INIT_VAR(&arguments); + array_init(&arguments); + } else { + zephir_get_arrval(&arguments, arguments_param); + } + + + RETURN_MM_NULL(); + +} + +/** + * Checks whether the behavior must take action on certain event + */ +PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction) { + + zval *eventName_param = NULL, _0; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &eventName_param); + + if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { + zephir_get_strval(&eventName, eventName_param); + } else { + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); + } + + + zephir_read_property(&_0, this_ptr, SL("options"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &eventName)); + +} + +/** + * This method receives the notifications from the EventsManager + */ +PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify) { + + zval *type_param = NULL, *model, model_sub; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&model_sub); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &type_param, &model); + + zephir_get_strval(&type, type_param); + + + RETURN_MM_NULL(); + +} + diff --git a/ext/phalcon/mvc/model/behavior.zep.h b/ext/phalcon/mvc/model/behavior.zep.h new file mode 100644 index 00000000000..7a2bdafeb77 --- /dev/null +++ b/ext/phalcon/mvc/model/behavior.zep.h @@ -0,0 +1,62 @@ + +extern zend_class_entry *phalcon_mvc_model_behavior_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior); + +PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct); +PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions); +PHP_METHOD(Phalcon_Mvc_Model_Behavior, missingMethod); +PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction); +PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior___construct, 0, 0, 0) + ZEND_ARG_ARRAY_INFO(0, options, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_getoptions, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 1) +#else + ZEND_ARG_INFO(0, eventName) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_missingmethod, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, method) +#endif + ZEND_ARG_ARRAY_INFO(0, arguments, 0) +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_behavior_musttakeaction, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_behavior_musttakeaction, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, eventName) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, type) +#endif + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_mvc_model_behavior_method_entry) { + PHP_ME(Phalcon_Mvc_Model_Behavior, __construct, arginfo_phalcon_mvc_model_behavior___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Mvc_Model_Behavior, getOptions, arginfo_phalcon_mvc_model_behavior_getoptions, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_Model_Behavior, missingMethod, arginfo_phalcon_mvc_model_behavior_missingmethod, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Behavior, mustTakeAction, arginfo_phalcon_mvc_model_behavior_musttakeaction, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_Model_Behavior, notify, arginfo_phalcon_mvc_model_behavior_notify, ZEND_ACC_PUBLIC) + PHP_FE_END +}; diff --git a/ext/phalcon/mvc/model/behaviorinterface.zep.c b/ext/phalcon/mvc/model/behaviorinterface.zep.c new file mode 100644 index 00000000000..9d61f7dc818 --- /dev/null +++ b/ext/phalcon/mvc/model/behaviorinterface.zep.c @@ -0,0 +1,45 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Phalcon\Mvc\Model\BehaviorInterface + * + * Interface for Phalcon\Mvc\Model\Behavior + */ +ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_BehaviorInterface) { + + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Mvc\\Model, BehaviorInterface, phalcon, mvc_model_behaviorinterface, phalcon_mvc_model_behaviorinterface_method_entry); + + return SUCCESS; + +} + +/** + * Calls a method when it's missing in the model + */ +ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_BehaviorInterface, missingMethod); + +/** + * This method receives the notifications from the EventsManager + */ +ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_BehaviorInterface, notify); + diff --git a/ext/phalcon/mvc/model/behaviorinterface.zep.h b/ext/phalcon/mvc/model/behaviorinterface.zep.h new file mode 100644 index 00000000000..b7098b3b37e --- /dev/null +++ b/ext/phalcon/mvc/model/behaviorinterface.zep.h @@ -0,0 +1,29 @@ + +extern zend_class_entry *phalcon_mvc_model_behaviorinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_BehaviorInterface); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behaviorinterface_missingmethod, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, method) +#endif + ZEND_ARG_ARRAY_INFO(0, arguments, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behaviorinterface_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, type) +#endif + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_mvc_model_behaviorinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, missingMethod, arginfo_phalcon_mvc_model_behaviorinterface_missingmethod) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, notify, arginfo_phalcon_mvc_model_behaviorinterface_notify) + PHP_FE_END +}; diff --git a/phalcon/Db/AbstractDb.zep b/phalcon/Db/AbstractDb.zep index a1eb8ac3bb6..e358ac36c9b 100644 --- a/phalcon/Db/AbstractDb.zep +++ b/phalcon/Db/AbstractDb.zep @@ -22,8 +22,8 @@ use \PDO as Pdo; * interact with databases using higher level of abstraction use * Phalcon\Mvc\Model. * - * Phalcon\Db\AbstractDb is an abstract class. You only can use it with a - * database adapter like Phalcon\Db\Adapter\Pdo + * Phalcon\Db is an abstract class. You only can use it with a database adapter + * like Phalcon\Db\Adapter\Pdo * *```php * use Phalcon\Db; diff --git a/phalcon/Di/Injectable.zep b/phalcon/Di/Injectable.zep index 0e4cff072d3..82d2155be2b 100644 --- a/phalcon/Di/Injectable.zep +++ b/phalcon/Di/Injectable.zep @@ -22,29 +22,29 @@ use Phalcon\Session\BagInterface; * This class allows to access services in the services container by just only * accessing a public property with the same name of a registered service * - * @property \Phalcon\Annotations\Adapter\Memory|\Phalcon\Annotations\Adapter $annotations - * @property \Phalcon\Assets\Manager $assets - * @property \Phalcon\Http\Response\Cookies|\Phalcon\Http\Response\CookiesInterface $cookies - * @property \Phalcon\Crypt\Crypt|\Phalcon\Crypt\CryptInterface $crypt - * @property \Phalcon\Db\Adapter\AdapterInterface $db - * @property \Phalcon\Di|\Phalcon\DiInterface $di * @property \Phalcon\Mvc\Dispatcher|\Phalcon\Mvc\DispatcherInterface $dispatcher - * @property \Phalcon\Escaper|\Phalcon\Escaper\EscaperInterface $escaper - * @property \Phalcon\Events\Manager|\Phalcon\Events\ManagerInterface $eventsManager - * @property \Phalcon\Mvc\Model\Manager|\Phalcon\Mvc\Model\ManagerInterface $modelsManager - * @property \Phalcon\Mvc\Model\MetaData\Memory|\Phalcon\Mvc\Model\MetadataInterface $modelsMetadata - * @property \Phalcon\Flash\Direct $flash - * @property \Phalcon\Flash\Session $flashSession - * @property \Phalcon\Filter\FilterLocator $filter - * @property \Phalcon\Session\Bag|\Phalcon\Session\BagInterface $persistent + * @property \Phalcon\Mvc\Router|\Phalcon\Mvc\RouterInterface $router + * @property \Phalcon\Url|\Phalcon\UrlInterface $url * @property \Phalcon\Http\Request|\Phalcon\Http\RequestInterface $request * @property \Phalcon\Http\Response|\Phalcon\Http\ResponseInterface $response - * @property \Phalcon\Mvc\Router|\Phalcon\Mvc\RouterInterface $router + * @property \Phalcon\Http\Response\Cookies|\Phalcon\Http\Response\CookiesInterface $cookies + * @property \Phalcon\Filter\FilterLocator $filter + * @property \Phalcon\Flash\Direct $flash + * @property \Phalcon\Flash\Session $flashSession * @property \Phalcon\Session\ManagerInterface $session + * @property \Phalcon\Events\Manager|\Phalcon\Events\ManagerInterface $eventsManager + * @property \Phalcon\Db\Adapter\AdapterInterface $db * @property \Phalcon\Security\Security $security + * @property \Phalcon\Crypt\Crypt|\Phalcon\Crypt\CryptInterface $crypt * @property \Phalcon\Tag $tag + * @property \Phalcon\Escaper|\Phalcon\Escaper\EscaperInterface $escaper + * @property \Phalcon\Annotations\Adapter\Memory|\Phalcon\Annotations\Adapter $annotations + * @property \Phalcon\Mvc\Model\Manager|\Phalcon\Mvc\Model\ManagerInterface $modelsManager + * @property \Phalcon\Mvc\Model\MetaData\Memory|\Phalcon\Mvc\Model\MetadataInterface $modelsMetadata * @property \Phalcon\Mvc\Model\Transaction\Manager|\Phalcon\Mvc\Model\Transaction\ManagerInterface $transactionManager - * @property \Phalcon\Url|\Phalcon\UrlInterface $url + * @property \Phalcon\Assets\Manager $assets + * @property \Phalcon\Di|\Phalcon\DiInterface $di + * @property \Phalcon\Session\Bag|\Phalcon\Session\BagInterface $persistent * @property \Phalcon\Mvc\View|\Phalcon\Mvc\ViewInterface $view */ abstract class Injectable implements InjectionAwareInterface, EventsAwareInterface diff --git a/phalcon/Mvc/Model.zep b/phalcon/Mvc/Model.zep index 2ac751a1a4d..e5aec1dfec9 100644 --- a/phalcon/Mvc/Model.zep +++ b/phalcon/Mvc/Model.zep @@ -22,7 +22,7 @@ use Phalcon\Events\ManagerInterface as EventsManagerInterface; use Phalcon\Helper\Arr; use Phalcon\Messages\Message; use Phalcon\Messages\MessageInterface; -use Phalcon\Mvc\Model\Behavior\BehaviorInterface; +use Phalcon\Mvc\Model\BehaviorInterface; use Phalcon\Mvc\Model\Criteria; use Phalcon\Mvc\Model\CriteriaInterface; use Phalcon\Mvc\Model\Exception; diff --git a/phalcon/Mvc/Model/Behavior/AbstractBehavior.zep b/phalcon/Mvc/Model/Behavior.zep similarity index 91% rename from phalcon/Mvc/Model/Behavior/AbstractBehavior.zep rename to phalcon/Mvc/Model/Behavior.zep index caf08516ccb..a987dde6139 100644 --- a/phalcon/Mvc/Model/Behavior/AbstractBehavior.zep +++ b/phalcon/Mvc/Model/Behavior.zep @@ -8,15 +8,17 @@ * file that was distributed with this source code. */ -namespace Phalcon\Mvc\Model\Behavior; +namespace Phalcon\Mvc\Model; use Phalcon\Mvc\ModelInterface; -use Phalcon\Mvc\Model\Behavior\BehaviorInterface; +use Phalcon\Mvc\Model\BehaviorInterface; /** + * Phalcon\Mvc\Model\Behavior + * * This is an optional base class for ORM behaviors */ -abstract class AbstractBehavior implements BehaviorInterface +abstract class Behavior implements BehaviorInterface { /** * @var array diff --git a/phalcon/Mvc/Model/Behavior/SoftDelete.zep b/phalcon/Mvc/Model/Behavior/SoftDelete.zep index 2550fdee499..b8587339fbb 100644 --- a/phalcon/Mvc/Model/Behavior/SoftDelete.zep +++ b/phalcon/Mvc/Model/Behavior/SoftDelete.zep @@ -11,14 +11,16 @@ namespace Phalcon\Mvc\Model\Behavior; use Phalcon\Mvc\ModelInterface; -use Phalcon\Mvc\Model\Behavior\AbstractBehavior; +use Phalcon\Mvc\Model\Behavior; use Phalcon\Mvc\Model\Exception; /** + * Phalcon\Mvc\Model\Behavior\SoftDelete + * * Instead of permanently delete a record it marks the record as deleted * changing the value of a flag column */ -class SoftDelete extends AbstractBehavior +class SoftDelete extends Behavior { /** * Listens for notifications from the models manager diff --git a/phalcon/Mvc/Model/Behavior/Timestampable.zep b/phalcon/Mvc/Model/Behavior/Timestampable.zep index 0cd2e1122cb..89451530674 100644 --- a/phalcon/Mvc/Model/Behavior/Timestampable.zep +++ b/phalcon/Mvc/Model/Behavior/Timestampable.zep @@ -12,14 +12,16 @@ namespace Phalcon\Mvc\Model\Behavior; use Closure; use Phalcon\Mvc\ModelInterface; -use Phalcon\Mvc\Model\Behavior\AbstractBehavior; +use Phalcon\Mvc\Model\Behavior; use Phalcon\Mvc\Model\Exception; /** + * Phalcon\Mvc\Model\Behavior\Timestampable + * * Allows to automatically update a model’s attribute saving the datetime when a * record is created or updated */ -class Timestampable extends AbstractBehavior +class Timestampable extends Behavior { /** * Listens for notifications from the models manager diff --git a/phalcon/Mvc/Model/Behavior/BehaviorInterface.zep b/phalcon/Mvc/Model/BehaviorInterface.zep similarity index 90% rename from phalcon/Mvc/Model/Behavior/BehaviorInterface.zep rename to phalcon/Mvc/Model/BehaviorInterface.zep index 573e2d88900..2b8cff00866 100644 --- a/phalcon/Mvc/Model/Behavior/BehaviorInterface.zep +++ b/phalcon/Mvc/Model/BehaviorInterface.zep @@ -8,11 +8,13 @@ * file that was distributed with this source code. */ -namespace Phalcon\Mvc\Model\Behavior; +namespace Phalcon\Mvc\Model; use Phalcon\Mvc\ModelInterface; /** + * Phalcon\Mvc\Model\BehaviorInterface + * * Interface for Phalcon\Mvc\Model\Behavior */ interface BehaviorInterface diff --git a/phalcon/Mvc/Model/Manager.zep b/phalcon/Mvc/Model/Manager.zep index ce861a34a9c..17eaf1507c7 100644 --- a/phalcon/Mvc/Model/Manager.zep +++ b/phalcon/Mvc/Model/Manager.zep @@ -24,7 +24,7 @@ use Phalcon\Mvc\Model\Query; use Phalcon\Mvc\Model\QueryInterface; use Phalcon\Mvc\Model\Query\Builder; use Phalcon\Mvc\Model\Query\BuilderInterface; -use Phalcon\Mvc\Model\Behavior\BehaviorInterface; +use Phalcon\Mvc\Model\BehaviorInterface; use Phalcon\Events\ManagerInterface as EventsManagerInterface; /** diff --git a/phalcon/Mvc/Model/ManagerInterface.zep b/phalcon/Mvc/Model/ManagerInterface.zep index a3186b0e41d..868675ce08a 100644 --- a/phalcon/Mvc/Model/ManagerInterface.zep +++ b/phalcon/Mvc/Model/ManagerInterface.zep @@ -12,7 +12,7 @@ namespace Phalcon\Mvc\Model; use Phalcon\Db\Adapter\AdapterInterface; use Phalcon\Mvc\ModelInterface; -use Phalcon\Mvc\Model\Behavior\BehaviorInterface; +use Phalcon\Mvc\Model\BehaviorInterface; use Phalcon\Mvc\Model\RelationInterface; use Phalcon\Mvc\Model\Query\BuilderInterface; use Phalcon\Mvc\Model\QueryInterface;