Skip to content

Commit

Permalink
Merge pull request #644 from xboston/master
Browse files Browse the repository at this point in the history
Update Interfaces and Phalcon_DI
  • Loading branch information
Phalcon committed May 16, 2013
2 parents 0c0a927 + c490429 commit 14a3d9e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 35 deletions.
34 changes: 17 additions & 17 deletions ext/di.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,19 +524,19 @@ PHP_METHOD(Phalcon_DI, getServices){
/**
* Check if a service is registered using the array syntax
*
* @param string $alias
* @param string $offset
* @return boolean
*/
PHP_METHOD(Phalcon_DI, offsetExists){

zval *alias, *exists;
zval *offset, *exists;

PHALCON_MM_GROW();

phalcon_fetch_params(1, 1, 0, &alias);
phalcon_fetch_params(1, 1, 0, &offset);

PHALCON_INIT_VAR(exists);
PHALCON_CALL_METHOD_PARAMS_1(exists, this_ptr, "has", alias);
PHALCON_CALL_METHOD_PARAMS_1(exists, this_ptr, "has", offset);
RETURN_CCTOR(exists);
}

Expand All @@ -547,18 +547,18 @@ PHP_METHOD(Phalcon_DI, offsetExists){
* $di['request'] = new Phalcon\Http\Request();
*</code>
*
* @param string $alias
* @param mixed $definition
* @param string $offset
* @param mixed $value
*/
PHP_METHOD(Phalcon_DI, offsetSet){

zval *alias, *definition;
zval *offset, *value;

PHALCON_MM_GROW();

phalcon_fetch_params(1, 2, 0, &alias, &definition);
phalcon_fetch_params(1, 2, 0, &offset, &value);

PHALCON_CALL_METHOD_PARAMS_2_NORETURN(this_ptr, "setshared", alias, definition);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(this_ptr, "setshared", offset, value);

PHALCON_MM_RESTORE();
}
Expand All @@ -570,34 +570,34 @@ PHP_METHOD(Phalcon_DI, offsetSet){
* var_dump($di['request']);
*</code>
*
* @param string $alias
* @param string $offset
* @return mixed
*/
PHP_METHOD(Phalcon_DI, offsetGet){

zval *alias, *service;
zval *offset, *service;

PHALCON_MM_GROW();

phalcon_fetch_params(1, 1, 0, &alias);
phalcon_fetch_params(1, 1, 0, &offset);

PHALCON_INIT_VAR(service);
PHALCON_CALL_METHOD_PARAMS_1(service, this_ptr, "getshared", alias);
PHALCON_CALL_METHOD_PARAMS_1(service, this_ptr, "getshared", offset);
RETURN_CCTOR(service);
}

/**
* Removes a service from the services container using the array syntax
*
* @param string $alias
* @param string $offset
*/
PHP_METHOD(Phalcon_DI, offsetUnset){

zval *alias;
zval *offset;

phalcon_fetch_params(0, 1, 0, &alias);
phalcon_fetch_params(0, 1, 0, &offset);

RETURN_CCTORW(alias);
RETURN_CCTORW(offset);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions ext/di.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_has, 0, 0, 1)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetexists, 0, 0, 1)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetset, 0, 0, 2)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, definition)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetget, 0, 0, 1)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetunset, 0, 0, 1)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di___call, 0, 0, 1)
Expand Down
12 changes: 6 additions & 6 deletions ext/diinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern zend_class_entry *phalcon_diinterface_ce;
PHALCON_INIT_CLASS(Phalcon_DiInterface);

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_set, 0, 0, 2)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, definition)
ZEND_ARG_INFO(0, shared)
ZEND_END_ARG_INFO()
Expand All @@ -33,22 +33,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_setshared, 0, 0, 2)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_remove, 0, 0, 1)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_attempt, 0, 0, 2)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, definition)
ZEND_ARG_INFO(0, shared)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_get, 0, 0, 1)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, parameters)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_getshared, 0, 0, 1)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, parameters)
ZEND_END_ARG_INFO()

Expand All @@ -66,7 +66,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_getservice, 0, 0, 1)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_has, 0, 0, 1)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_setdefault, 0, 0, 1)
Expand Down
11 changes: 6 additions & 5 deletions ext/mvc/model/managerinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,29 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_load, 0, 0, 1)
ZEND_ARG_INFO(0, modelName)
ZEND_ARG_INFO(0, newInstance)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasone, 0, 0, 4)
ZEND_ARG_INFO(0, model)
ZEND_ARG_INFO(0, fields)
ZEND_ARG_INFO(0, referenceModel)
ZEND_ARG_INFO(0, referencedModel)
ZEND_ARG_INFO(0, referencedFields)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addbelongsto, 0, 0, 4)
ZEND_ARG_INFO(0, model)
ZEND_ARG_INFO(0, fields)
ZEND_ARG_INFO(0, referenceModel)
ZEND_ARG_INFO(0, referencedModel)
ZEND_ARG_INFO(0, referencedFields)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasmany, 0, 0, 4)
ZEND_ARG_INFO(0, model)
ZEND_ARG_INFO(0, fields)
ZEND_ARG_INFO(0, referenceModel)
ZEND_ARG_INFO(0, referencedModel)
ZEND_ARG_INFO(0, referencedFields)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -117,8 +118,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getrelations,
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getrelationsbetween, 0, 0, 2)
ZEND_ARG_INFO(0, firstModel)
ZEND_ARG_INFO(0, secondModel)
ZEND_ARG_INFO(0, first)
ZEND_ARG_INFO(0, second)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_createquery, 0, 0, 1)
Expand Down
7 changes: 7 additions & 0 deletions ext/mvc/model/query/builderinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_join, 0,
ZEND_ARG_INFO(0, model)
ZEND_ARG_INFO(0, conditions)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, type)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_where, 0, 0, 1)
ZEND_ARG_INFO(0, conditions)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_andwhere, 0, 0, 1)
ZEND_ARG_INFO(0, conditions)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_orwhere, 0, 0, 1)
ZEND_ARG_INFO(0, conditions)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_orderby, 0, 0, 1)
Expand Down
9 changes: 7 additions & 2 deletions ext/mvc/modelinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresultmap, 0, 0,
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, columnMap)
ZEND_ARG_INFO(0, dirtyState)
ZEND_ARG_INFO(0, keepSnapshots)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresult, 0, 0, 2)
ZEND_ARG_INFO(0, base)
ZEND_ARG_INFO(0, result)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, dirtyState)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresultmaphydrate, 0, 0, 3)
Expand Down Expand Up @@ -111,14 +113,17 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_save, 0, 0, 0)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, whiteList)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_create, 0, 0, 0)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, whiteList)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_update, 0, 0, 0)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, whiteList)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_readattribute, 0, 0, 1)
Expand All @@ -131,7 +136,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_writeattribute, 0, 0,
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_getrelated, 0, 0, 1)
ZEND_ARG_INFO(0, modelName)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, arguments)
ZEND_END_ARG_INFO()

Expand Down

0 comments on commit 14a3d9e

Please sign in to comment.