# |
Oct 22nd 2009, 06:43 |
ADmad |
georgious: surely not for your exactly issue but you should get an exampel on how to properly use the callbacks |
# |
Oct 22nd 2009, 06:43 |
TehTreag |
georgious: Tell us more. Like a summation of some fields? |
# |
Oct 22nd 2009, 06:43 |
young-apacher |
Phally: ..or do you have any good link ? |
# |
Oct 22nd 2009, 06:42 |
georgious |
TehTreag: retrieving |
# |
Oct 22nd 2009, 06:42 |
georgious |
ADmad: soo.. I can find a solution in the book ? |
# |
Oct 22nd 2009, 06:42 |
TehTreag |
georgious: This is a task you want to do when saving, or retrieving data? |
# |
Oct 22nd 2009, 06:42 |
young-apacher |
Phally: Maybe i have to google :) |
# |
Oct 22nd 2009, 06:42 |
ADmad |
georgious: thats why is said you need before and after both |
# |
Oct 22nd 2009, 06:42 |
Phally |
young-apacher: lots. |
# |
Oct 22nd 2009, 06:41 |
young-apacher |
Any documentation about that ? |
# |
Oct 22nd 2009, 06:41 |
georgious |
ADmad: I can use afterFind but then I will have to go through each results and request from the DB once again |
# |
Oct 22nd 2009, 06:41 |
ADmad |
you are not doing it correctly then |
# |
Oct 22nd 2009, 06:41 |
georgious |
TehTreag: you mean? |
# |
Oct 22nd 2009, 06:41 |
georgious |
ADmad: I tried beforeFind but if I insert a field there, it will be the only one |
# |
Oct 22nd 2009, 06:40 |
TehTreag |
georgious: Is it something you can add to the query? |
# |
Oct 22nd 2009, 06:40 |
Phally |
young-apacher: depends on the engine |
# |
Oct 22nd 2009, 06:40 |
tPl0ch |
young-apacher: with InnoDB Engine, yes |
# |
Oct 22nd 2009, 06:40 |
ADmad |
georgious: you need to use callback beforeFind and afterFind... check manaul |
# |
Oct 22nd 2009, 06:40 |
georgious |
can I do that easily? |
# |
Oct 22nd 2009, 06:40 |
young-apacher |
Is transaction supported when usin mysql ? |
# |
Oct 22nd 2009, 06:39 |
tPl0ch |
paginate is a controller method, too |
# |
Oct 22nd 2009, 06:39 |
georgious |
I need to append a calculated field to every request to a model |
# |
Oct 22nd 2009, 06:39 |
TehTreag |
tPl0ch: Both are model methods. |
# |
Oct 22nd 2009, 06:39 |
georgious |
hey gyuys |
# |
Oct 22nd 2009, 06:39 |
TehTreag |
) |
# |
Oct 22nd 2009, 06:39 |
Ceeram |
http://book.cakephp.org/view/701/env |
# |
Oct 22nd 2009, 06:39 |
ADmad |
ACTION smacks Ceeram from spoon feeding :) |
# |
Oct 22nd 2009, 06:39 |
tPl0ch |
If I want to have a custom paginate function, do I have to override it in the controller or in the model? |
# |
Oct 22nd 2009, 06:38 |
TehTreag |
Ceeram: Thanks. |
# |
Oct 22nd 2009, 06:38 |
Ceeram |
function env($key) in basiscs.php |
# |
Oct 22nd 2009, 06:38 |
ADmad |
TehTreag: ;) |
# |
Oct 22nd 2009, 06:37 |
tPl0ch |
TehTreag: you mean getenv()? |
# |
Oct 22nd 2009, 06:37 |
TehTreag |
ADmad: You are just too good for me. |
# |
Oct 22nd 2009, 06:37 |
ADmad |
right that doesnt automatically make it a php func :) |
# |
Oct 22nd 2009, 06:37 |
tPl0ch |
env is a linux command |
# |
Oct 22nd 2009, 06:36 |
ADmad |
TehTreag: since when is env() a php func ? |
# |
Oct 22nd 2009, 06:36 |
Phally |
TehTreag: orly? |
# |
Oct 22nd 2009, 06:36 |
tPl0ch |
or as well in the Model? |
# |
Oct 22nd 2009, 06:36 |
TehTreag |
ADmad: That's a php func, not CakePHP. ;) |
# |
Oct 22nd 2009, 06:36 |
tPl0ch |
TehTreag: but override paginate in the Controller? |
# |
Oct 22nd 2009, 06:36 |
tomoyuki28jp` |
ADmad: thanks! |