Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include( 'extension/sqliimport/stubs/scriptinit.php' );
- eZINI::instance()->setVariable( 'ContentSettings', 'ViewCaching', 'disabled' );
- $cli->notice( 'Creating parent folder' );
- $options = new SQLIContentOptions( array(
- 'class_identifier' => 'folder',
- 'remote_id' => 'folder_remote_id',
- 'language' => 'eng-GB' // Different language than default one (fre-FR)
- ) );
- $folder = SQLIContent::create( $options );
- $folder->fields->name = 'English subject';
- $folder->addLocation( SQLILocation::fromNodeID( 43 ) );
- $publisher = SQLIContentPublisher::getInstance();
- $publisher->publish( $folder );
- $cli->notice( 'Creating children' );
- $commentOptions = new SQLIContentOptions( array(
- 'class_identifier' => 'comment',
- 'language' => 'eng-GB'
- ) );
- $folderLocation = $folder->defaultLocation;
- $comment1 = SQLIContent::create( $commentOptions );
- $comment1->fields->subject = 'Test 1';
- $comment1->fields->author = 'Author 1';
- $comment1->fields->message = 'Test message 1';
- $comment1->addLocation( $folderLocation );
- $publisher->publish( $comment1 );
- $comment2 = SQLIContent::create( $commentOptions );
- $comment2->fields->subject = 'Test 2';
- $comment2->fields->author = 'Author 2';
- $comment2->fields->message = 'Test message 2';
- $comment2->addLocation( $folderLocation );
- $publisher->publish( $comment2 );
- $script->shutdown();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement