Created
January 29, 2010 22:17
-
-
Save AD7six/290210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// In a model, far far away.... there was some DRY action | |
function doesComplexWork($id, $conditions) { | |
return "Complex shenanigans"; | |
} | |
function doesMoreComplexWork($id) { | |
return "More Complex shenanigans"; | |
} | |
// In a controller | |
function actionOne() { | |
// We don't even know we're being cached, we don't care | |
// We don't even know if we're going to instanciate the model, we don't care | |
$data = MiCache::data('FarFarAway', 'doesComplexWork'); | |
} | |
function actionTwo() { | |
// We don't even know we're being cached, we don't care | |
// We don't even know if we're going to instanciate the model, we don't care | |
$data = MiCache::data('FarFarAway', 'doesComplexWork'); | |
} | |
function actionThree() { | |
// We don't even know we're being cached, we don't care | |
// We don't even know if we're going to instanciate the model, we don't care | |
$data = MiCache::data('FarFarAway', 'doesComplexWork'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment