Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('SYSPATH') or die('No direct script access.');
- class Model_User extends Model_Auth_User {
- protected $_has_many = array(
- 'user_tokens' => array('model' => 'user_token'),
- 'roles' => array('model' => 'role', 'through' => 'roles_users'),
- 'pictures' => array('model' => 'picture'),
- );
- class Model_Picture extends ORM
- {
- protected $_belongs_to = array(
- 'user' => array(
- 'foreign_key' => 'id',
- ),
- );
- protected $_has_many = array(
- 'comments' => array('model' => 'comment')
- );
- class Model_Comment extends ORM
- {
- protected $_belongs_to = array(
- 'picture' => array(
- 'foreign_key' => 'id',
- ),
- );
Add Comment
Please, Sign In to add comment