Skip to content

Instantly share code, notes, and snippets.

@tomkrush
Created December 4, 2011 03:31
Show Gist options
  • Save tomkrush/1429057 to your computer and use it in GitHub Desktop.
Save tomkrush/1429057 to your computer and use it in GitHub Desktop.
Example of class_name
class Post_Model extends My_Model
{
public function init()
{
$this->belongs_to('contributor', array(
'class_name' => 'User_Model',
'foreign_key' => 'contributor_id'
));
$this->belongs_to('editor', array(
'class_name' => 'User_Model',
'foreign_key' => 'editor_id'
));
}
}
@tomkrush
Copy link
Author

tomkrush commented Dec 4, 2011

$post->create_editor(...); // now works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment