khalid_hussain

Model_Books_Users

Oct 26th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. class Model_Books_User extends \Orm\Model {
  2.  
  3.     protected static $_properties = array(
  4.         'user_id',
  5.         'book_id',
  6.     );
  7.     protected static $_table_name = 'books_users';
  8.    
  9.     protected static $_many_many = array(
  10.         'users' => array(
  11.             'key_from' => 'id',
  12.             'key_through_from' => 'book_id',
  13.             'table_through' => 'books_users',
  14.             'key_through_to' => 'user_id',
  15.             'model_to' => 'Model_User',
  16.             'key_to' => 'id',
  17.             'cascade_save' => true,
  18.             'cascade_delete' => false,
  19.         )
  20.     );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment