Advertisement
Guest User

Untitled

a guest
Sep 5th, 2010
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2. include( 'extension/sqliimport/stubs/scriptinit.php' );
  3. eZINI::instance()->setVariable( 'ContentSettings', 'ViewCaching', 'disabled' );
  4.  
  5. $cli->notice( 'Creating parent folder' );
  6. $options = new SQLIContentOptions( array(
  7.     'class_identifier'      => 'folder',
  8.     'remote_id'             => 'folder_remote_id',
  9.     'language'              => 'eng-GB' // Different language than default one (fre-FR)
  10. ) );
  11. $folder = SQLIContent::create( $options );
  12. $folder->fields->name = 'English subject';
  13.  
  14. $folder->addLocation( SQLILocation::fromNodeID( 43 ) );
  15.  
  16. $publisher = SQLIContentPublisher::getInstance();
  17. $publisher->publish( $folder );
  18.  
  19. $cli->notice( 'Creating children' );
  20. $commentOptions = new SQLIContentOptions( array(
  21.     'class_identifier'      => 'comment',
  22.     'language'              => 'eng-GB'
  23. ) );
  24. $folderLocation = $folder->defaultLocation;
  25. $comment1 = SQLIContent::create( $commentOptions );
  26. $comment1->fields->subject = 'Test 1';
  27. $comment1->fields->author = 'Author 1';
  28. $comment1->fields->message = 'Test message 1';
  29. $comment1->addLocation( $folderLocation );
  30. $publisher->publish( $comment1 );
  31.  
  32. $comment2 = SQLIContent::create( $commentOptions );
  33. $comment2->fields->subject = 'Test 2';
  34. $comment2->fields->author = 'Author 2';
  35. $comment2->fields->message = 'Test message 2';
  36. $comment2->addLocation( $folderLocation );
  37. $publisher->publish( $comment2 );
  38.  
  39. $script->shutdown();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement