Guest User

Untitled

a guest
Jan 14th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2. class Model_User extends Model_Auth_User {
  3.     protected $_has_many = array(
  4.         'user_tokens' => array('model' => 'user_token'),
  5.         'roles'       => array('model' => 'role', 'through' => 'roles_users'),
  6.         'pictures'    => array('model' => 'picture'),
  7.     );
  8.  
  9. class Model_Picture extends ORM
  10. {
  11.     protected $_belongs_to = array(
  12.         'user' => array(
  13.             'foreign_key' => 'id',
  14.         ),
  15.     );
  16.  
  17.     protected $_has_many = array(
  18.         'comments' => array('model' => 'comment')
  19.     );
  20.  
  21. class Model_Comment extends ORM
  22. {
  23.     protected $_belongs_to = array(
  24.         'picture' => array(
  25.             'foreign_key' => 'id',
  26.         ),
  27.     );
Add Comment
Please, Sign In to add comment