Two ways jump out at me right off the bat. First, think of the default
cake Model as a data access class only, and then define a business-
logic class (that doesn't extend AppModel) to encapsulate your desired
model functionality.

// Get results from data access model
$results = $this->SomeModel->findWhatever();

// Instantiate business logic class, assigning results to it, and then
slice bread
$myModel = new MyModelWithBusinessLogic($results);
$myModel->sliceBread();


Or just use afterFind() in a model, assigning the results to a model
property, and build your business logic into the model that way.

function afterFind( $results ) {
    $this->_results = $results;
}

function sliceBread() {
    if ( empty($this->_results) {
        return false;
    }

    // slice bread!

}


$this->SomeModel->findWhatever();
$this->SomeModel->sliceBread();


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to