Skip to content

Instantly share code, notes, and snippets.

@icambridge
Created January 21, 2012 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icambridge/1652444 to your computer and use it in GitHub Desktop.
Save icambridge/1652444 to your computer and use it in GitHub Desktop.
Mock Model
<?php
protected $_classes = array(
'media' => 'lithium\net\http\Media',
'router' => 'lithium\net\http\Router',
'response' => 'lithium\action\Response',
'articles' => '\app\models\Articles'
);
public function archives() {
$articlesClass = $this->_classes['articles'];
$articles = $articlesClass::find('all');
$this->set(compact('articles'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment