Skip to content

Instantly share code, notes, and snippets.

@no13bus
Created March 6, 2014 13:34
Show Gist options
  • Select an option

  • Save no13bus/9389800 to your computer and use it in GitHub Desktop.

Select an option

Save no13bus/9389800 to your computer and use it in GitHub Desktop.
<?php
/**
*
*/
class TopicViewModel extends ViewModel
{
public $viewFields = array(
'topic' => array('id','title','content','last_replied_by','last_touched','created'),
'user' => array('username','nickname','avatar','uid','reputation', '_on' => 'topic.author_id=user.uid'),
'node' => array('name'=>'nodename','slug'=>'nodeslug','_on' => 'topic.node_id=node.id'),
'user' => array('username'=>'last_replied_username','_as' => 'last_replied_user','_on' => 'topic.last_replied_by=last_replied_user.uid')
);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment