protected static $_has_many = array( 'tokens' => array( 'model_to' => 'Model_User_Token', 'cascade_delete' => true ) );
protected static $_primary_key = array( 'user_id', 'token_id'); protected static $_belongs_to = array( 'user', 'token' );
protected static $_has_many = array( 'users' => array( 'model_to' => 'Model_User_Token' ) );
$tokens = $user->tokens; foreach( $tokens as $t ) $t->delete();
It looks like you're new here. If you want to get involved, click one of these buttons!