webCOMAND

io_comand_io\importer

Import content from cJSON and CSV files into a COMAND repository.

Example

// import objects from a CSV or JSON file
$repo = comand::repo();
$url = 'http://www.comandmarket.com/packages/com_presidentsdemo_www/install/presidents.js';
$num = \io_comand_io\importer::import_from_file($url);
echo("Imported $num objects.\n");

Properties

The following properties can be set to influence how the import is performed.

  • action - How to write the imported objects to the repository: approve (default), save or store.
  • action_options - Options to pass to the action when writing imported objects.  For more information, see options for object::approve(), object::save() and object::store().
  • container - The Folder or other object where imported objects should be linked when the container is not specified in the import.  If not specified, imported objects will not be linked to a folder or object unless specified in the import.
  • force_container - If set to TRUE, imported objects will always be linked to the container, even if a container is specified in the import.
  • field - The field within the container object where imported objects should be linked.
  • SkipContentLog - If set to TRUE, the Content Log will not be updated with changes made from the import.
  • options
  • log
  • url
  • last_error
  • validation_data
  • imported_data