Metadata array format

From KnowledgeTree Document Management Made Simple

Jump to: navigation, search

Correct as of version 3.2 (SVN). Note that the Metadata Layer Rewrite will obselete this.

When adding metadata to a document, you need to describe that metadata somehow. Within KT this is done with an list of (Field, Value) tuples. Note that in the absence of the Metadata Layer Rewrite all metadata is stored as freeform strings - this includes tree fields, lookup fields, and any other kind of field that gets added.

  array(
     array(DocumentField::get(2), "Bob"),
     array(DocumentField::get(8), "This is a value"),
  );

For a good idea of how to use this, see plugins/ktcore/folder/addDocument.php method do_finalise

Personal tools