Re: cake 3 - issue saving null datetime

2014-04-29 Thread Alberto Pagliarini
yep :) 2014-04-29 0:07 GMT+02:00 euromark dereurom...@gmail.com: See - already fixed after not even 1 hour :) Am Montag, 28. April 2014 22:35:02 UTC+2 schrieb bato: I opened an issue https://github.com/cakephp/cakephp/issues/3410 Il giorno lunedì 28 aprile 2014 18:46:28 UTC+2, euromark

Re: cake 3 - is it possible to use formatResults to stacking multiple operations like mapper/reducer?

2014-04-16 Thread Alberto Pagliarini
ok it works! To me remain a mistery why using first() the callback in $results-map() is called twice while not using first is called once. Could it be a bug? 2014-04-16 13:11 GMT+02:00 José Lorenzo jose@gmail.com: Try this public findFlat($query, $options = []) { return

Re: cake 3 - is it possible to use formatResults to stacking multiple operations like mapper/reducer?

2014-04-16 Thread Alberto Pagliarini
uhm... I found when it repeats twice. try $table = TableRegistry::get('Articles'); $table -find() -formatResults(function($r) { return $r-map(function($r) { debug('a'); return $r; }); }) -first(); debug($table-toArray()); I have debug($table-toArray()); after the find chain. I suppose that

Re: cake 3 - is it possible to use formatResults to stacking multiple operations like mapper/reducer?

2014-04-16 Thread Alberto Pagliarini
OK, I've got it. I will have a look to compile() method. Thanks for your help Il 16/apr/2014 21:06 José Lorenzo jose@gmail.com ha scritto: Yeah, it will execute it as many times as you iterate the results. If you want to cache the results of a set of formatters call compile() on the

Re: cake 3 - is it possible to use formatResults to stacking multiple operations like mapper/reducer?

2014-04-15 Thread Alberto Pagliarini
uhm... maybe I'm wrong to use map() function... return $results-map(function($row) { foreach ($row['content']-toArray() as $key = $value) { $row[$key] = $value; } unset($row['content']); return $row;

Re: cake 3 - best practice to develop backend app with one or more frontend apps sharing cake lib

2014-03-30 Thread Alberto Pagliarini
I think you are right about http comunications and probably we will introduce also a complete backend API rest to use backend data with every type of frontend app (not only cake app). But having the possibility to use directly backend core in your frontend app is more flexible and you don't lose

Re: cake 3 - best practice to develop backend app with one or more frontend apps sharing cake lib

2014-03-27 Thread Alberto Pagliarini
Well, I think you're right, for classic simple frontend/backend app (one frontend with one backend). But what about have two completely different frontends with different urls? Our backend handle multiple sites data and can share content between them. Every frontend is a completely separate

Re: cake 3 - best practice to develop backend app with one or more frontend apps sharing cake lib

2014-03-26 Thread Alberto Pagliarini
Hi Mark, thanks for the answer :) Do you intend using Plugin for backend or frontend? However the common use case we have to handle is: - frontends and backend live on the same server and are served by the same web server - one backend used to manage data for two or more frontends -

Re: Using ORM Entity mutators to change value doesn't work

2014-02-19 Thread Alberto Pagliarini
:04 PM, Alberto Pagliarini bat...@gmail.com wrote: Thanks José for the answer. Let me know what you decide and if I can help. Anyway my example is born because I often need to save data in different format from original (serialize/unserialize, json_encode, json_decode, etc..) and I think

Re: Help saving data with CakePHP 3.0 ORM

2014-02-05 Thread Alberto Pagliarini
Yeah! using Entity class and $_accessible property all works as expected! thanks José 2014-02-04 José Lorenzo jose@gmail.com: Currently that is the most confusing part of the ORM and I'd like to make it easier to understand in the next release preview. By default entities are protected

Re: Help saving data with CakePHP 3.0 ORM

2014-02-05 Thread Alberto Pagliarini
Hi Carlos, PHP 5.4 permits the ['key' = 'value'] array syntax. The issue I had was resolved by using Entity class and $_accessible property. 2014-02-04 Carlos Javier Baeza Negroni carlos.ba...@gmail.com: Also check the array: $data = ['name' = 'Walter White']; Should be: $data =

Re: Poll: what do you hate about CakePHP?

2009-05-08 Thread Alberto Pagliarini
Simple way to initialize a component on the fly. ClassRegistry::init is very useful for model... I'd like it (or something similar) works with component -- -- bato --- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the