06.24 php saved
MarcMendez
Tags add more
afterFind, behavior and model  
Note
If you use this behavior, $results does not contain retrieved data. But if you put the afterFind in the model, it works
  1.  
  2. <?php
  3. // This is the Behavior I want to use in my model
  4. class TransactionBehavior extends ModelBehavior
  5. {
  6.  
  7. function afterFind($results, $primaryKey = false)
  8. {
  9.       var_dump($results);
  10.       return $results;
  11. }
  12.    
  13.    
  14. }
  15. ?>
  16.  
  17.  
  18. <?php
  19. // This is the model
  20. class Essai extends AppModel {
  21.  
  22.     var $name = 'Essai';
  23.     var $actsAs   = array('Transaction');
  24.     
  25.  
  26. }
  27. ?>
Parsed in 0.022 seconds, using GeSHi 1.0.7.14

Modify this Paste