Skip to content

Instantly share code, notes, and snippets.

@AD7six
Created January 29, 2010 22:17
Show Gist options
  • Save AD7six/290210 to your computer and use it in GitHub Desktop.
Save AD7six/290210 to your computer and use it in GitHub Desktop.
<?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