Comments on: ExpectsBehavior, model unbinding in CakePHP 1.2 /cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/ A glimpse at a coder's troubled mind Tue, 21 Jun 2011 13:27:40 +0000 hourly 1 http://wordpress.org/?v=3.2.1 By: mariano.iglesias [Member]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-105 mariano.iglesias [Member] Fri, 23 Nov 2007 18:53:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-105 @all: <strong>UPDATE</strong>: the first beta version has been released, and renamed to Bindable Behavior. Check it out at its bakery tutorial:<br /> <br /> <a href="http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings" rel="nofollow">Bindable Behavior: control your model bindings</a> @all: UPDATE: the first beta version has been released, and renamed to Bindable Behavior. Check it out at its bakery tutorial:

Bindable Behavior: control your model bindings

]]>
By: mariano.iglesias [Member]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-104 mariano.iglesias [Member] Wed, 21 Nov 2007 23:09:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-104 @landor: Model::$alias an array?? Are you declaring that variable yourself? It is used internally by CakePHP core, and it should *allways* be a string.<br /> <br /> Can you report a new bug ticket on the project page at:<br /> <br /> http://sourceforge.net/tracker/?func=add&group_id=209331&atid=1009286<br /> <br /> So I can keep a closer track of it? Also I'd really appreciate if you can attach the models with which that is happening to you (model declarations + bindings). Did this happen while you were running the test case or just on your own models?<br /> <br /> Thanks! :) @landor: Model::$alias an array?? Are you declaring that variable yourself? It is used internally by CakePHP core, and it should *allways* be a string.

Can you report a new bug ticket on the project page at:

http://sourceforge.net/tracker/?func=add&group_id=209331&atid=1009286

So I can keep a closer track of it? Also I’d really appreciate if you can attach the models with which that is happening to you (model declarations + bindings). Did this happen while you were running the test case or just on your own models?

Thanks! :)

]]>
By: landor [Visitor]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-103 landor [Visitor] Wed, 21 Nov 2007 22:59:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-103 Using nightlies rev 6030, php5, I get a bunch of warnings:<br /> <br /> Warning (2): Illegal offset type in isset or empty [APP/models/behaviors/expects.php, line 63]<br /> Warning (2): Illegal offset type [APP/models/behaviors/expects.php, line 65]<br /> etc...<br /> <br /> referring to<br /> $this->__settings[$Model->alias]<br /> because $Model->alias is an array.<br /> <br /> I am not using it extensively, but it seems to be working despite the warnings. Using nightlies rev 6030, php5, I get a bunch of warnings:

Warning (2): Illegal offset type in isset or empty [APP/models/behaviors/expects.php, line 63]
Warning (2): Illegal offset type [APP/models/behaviors/expects.php, line 65]
etc…

referring to
$this->__settings[$Model->alias]
because $Model->alias is an array.

I am not using it extensively, but it seems to be working despite the warnings.

]]>
By: mariano.iglesias [Member]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-102 mariano.iglesias [Member] Tue, 20 Nov 2007 12:55:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-102 @Aaron: yeah, actually I have it committed to a publicly available SVN server, but I have not yet released it since I'm finishing the tutorial. But for all of you who are interested in an early release (I won't publish this anywhere else) here's the SVN address from where you can checkout expects:<br /> <br /> svn co https://cake-syrup.svn.sourceforge.net/svnroot/cake-syrup/expects<br /> <br /> Or browse the expects SVN branch online:<br /> <br /> http://cake-syrup.svn.sourceforge.net/viewvc/cake-syrup/expects<br /> <br /> As you'll see there are two files:<br /> <br /> * app/models/behaviors/expects.php - The ExpectsBehavior<br /> * app/tests/cases/behaviors/expects.test.php - The test cases for ExpectsBehavior<br /> <br /> The code is stable, but since I have not yet finalized its documentation consider it to be an early release. @Aaron: yeah, actually I have it committed to a publicly available SVN server, but I have not yet released it since I’m finishing the tutorial. But for all of you who are interested in an early release (I won’t publish this anywhere else) here’s the SVN address from where you can checkout expects:

svn co https://cake-syrup.svn.sourceforge.net/svnroot/cake-syrup/expects

Or browse the expects SVN branch online:

http://cake-syrup.svn.sourceforge.net/viewvc/cake-syrup/expects

As you’ll see there are two files:

* app/models/behaviors/expects.php – The ExpectsBehavior
* app/tests/cases/behaviors/expects.test.php – The test cases for ExpectsBehavior

The code is stable, but since I have not yet finalized its documentation consider it to be an early release.

]]>
By: Aaron Shafovaloff [Visitor]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-101 Aaron Shafovaloff [Visitor] Tue, 20 Nov 2007 04:06:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-101 How is this coming along? Will it be done soon? How is this coming along? Will it be done soon?

]]>
By: @martin [Visitor]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-100 @martin [Visitor] Mon, 12 Nov 2007 20:56:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-100 Siempre brindando una bocanada de aire fresco a la comunidad de Cakephp. No hace falta decirte que muchos te seguimos los pasos.<br /> Siempre hablando de behaviors, podes dar un consejo para solucionar los problemas que surgen con los behaviors y la recursividad en las asociaciones de modelos?<br /> <br /> Un abrazo. Siempre brindando una bocanada de aire fresco a la comunidad de Cakephp. No hace falta decirte que muchos te seguimos los pasos.
Siempre hablando de behaviors, podes dar un consejo para solucionar los problemas que surgen con los behaviors y la recursividad en las asociaciones de modelos?

Un abrazo.

]]>
By: mariano.iglesias [Member]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-99 mariano.iglesias [Member] Wed, 07 Nov 2007 03:32:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-99 @gonzalo: currently these are the settings that can be overriden through expects: 'conditions', 'fields', 'limit', 'offset', 'order'.<br /> <br /> I am already committing the code to a public SVN and preparing the tutorial, so it will be on very soon. @gonzalo: currently these are the settings that can be overriden through expects: ‘conditions’, ‘fields’, ‘limit’, ‘offset’, ‘order’.

I am already committing the code to a public SVN and preparing the tutorial, so it will be on very soon.

]]>
By: gonzalo [Visitor]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-98 gonzalo [Visitor] Tue, 06 Nov 2007 19:34:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-98 Excellent work, really waiting for this!<br /> Do you expect that in the final release the conditions setting of the relationship could be overrided too? Or the only ones modifiable (¿?) are limit, order and offset? Excellent work, really waiting for this!
Do you expect that in the final release the conditions setting of the relationship could be overrided too? Or the only ones modifiable (¿?) are limit, order and offset?

]]>
By: mariano.iglesias [Member]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-97 mariano.iglesias [Member] Tue, 30 Oct 2007 16:07:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-97 @dericknwq: There's a method to restore the original associations right in the behavior. You would just do: $this->Article->resetExpects(). About paginate, it may even get simplier than that in the near future, though you could use ExpectsBehavior now by implementing the paginateCount() and paginate() method on your models. @dericknwq: There’s a method to restore the original associations right in the behavior. You would just do: $this->Article->resetExpects(). About paginate, it may even get simplier than that in the near future, though you could use ExpectsBehavior now by implementing the paginateCount() and paginate() method on your models.

]]>
By: dericknwq [Visitor]/cakephp/expectsbehavior-model-unbinding-in-cakephp-1-2/comment-page-1/#comment-96 dericknwq [Visitor] Tue, 30 Oct 2007 11:45:00 +0000 /1/expectsbehavior-model-unbinding-in-cakephp-1-2/#comment-96 Aye, release it soon! :) Will be good if there are ways to make it permanent to work with Controller::paginate. Also, could have a restore original association method! In that case, we can have a permanent call when using paginate, then restore the original associations for the other lines of code after it. Aye, release it soon! :) Will be good if there are ways to make it permanent to work with Controller::paginate. Also, could have a restore original association method! In that case, we can have a permanent call when using paginate, then restore the original associations for the other lines of code after it.

]]>