Esempio n. 1
0
 /**
  * Checks to see if a blogpost had out-of-line content, and if it did, 
  * attaches the generated file to it
  *
  * @param SimpleXMLElement $entry    The entry to check
  * @param PluginImportLeap $importer The importer
  */
 private static function setup_outoflinecontent_relationship(SimpleXMLElement $entry, PluginImportLeap $importer)
 {
     $artefactids = $importer->get_artefactids_imported_by_entryid((string) $entry->id);
     if (count($artefactids) == 2) {
         // In this case, a file was created as a result of
         // importing a blog entry with out-of-line content. We
         // attach the file to this post.
         $blogpost = new ArtefactTypeBlogPost($artefactids[0]);
         $blogpost->attach_file($artefactids[1]);
         $blogpost->commit();
     }
 }