This class is an interface to the metadata of MidCOM objects. It is not to be instantiated directly, as a cache is in place to avoid duplicate metadata objects for the same Midgard Object. So, basically, each of these objects is a singleton.
It will use an internal mechanism to cache repeated accesses to the same metadata key during its lifetime. (Invalidating this cache will be possible though.)
All metadata is identified by their string-based keys, the original MIDCOM_META_* constants are mapped to these new keys. This has been done to allow for easier extension.
Metadata Key Reference
See also the schema in /midcom/config/metadata_default.inc
Example Usage, Approval
Located in /midcom.core/midcom/helper/metadata.php (line 72)
Check if the requested object is locked
Approves the object.
This sets the approved timestamp to the current time and the approver person GUID to the GUID of the person currently authenticated.
Check whether current user can unlock the object
This function will return a single metadata key from the object. Its return type depends on the metadata key that is requested (see the class introduction).
You will not get the data from the datamanager using this calls, but the only slightly post-processed metadata values. See _retrieve_value for post processing.
Return a Datamanager instance for the current object.
This is returned by reference, which must be honored, as usual.
Also, whenever the containing datamanager stores its data, you must call the on_update() method of this class. This is very important or backwards compatibility will be broken.
Checks whether the article has been approved since its last editing.
This is a helper function which indicates whether a given object may be shown onsite taking approval, scheduling and visibility settings into account. The important point here is that it also checks the global configuration defaults, so that this is basically the same base on which NAP decides whether to show an item or not.
Checks the object's visibility regarding scheduling and the hide flag.
This does not check approval, use is_approved for that.
Loads the datamanager for this instance. This will patch the schema in case we are dealing with an article.
Set the object lock
This is the update event handler for the Metadata system. It must be called whenever metadata changes to synchronize the various backwards-compatibility values in place throughout the system.
Returns a metadata object for a given content object.
You may bass any one of the following arguments to the function:
Frontend for setting a single metadata option
Frontend for setting multiple metadata options
Unapproves the object.
This resets the approved timestamp and sets the approver person GUID to the GUID of the person currently authenticated.
Unlock the object
Directly set a metadata option.
The passed value will be stored using the follow transformations:
Documentation generated on Fri, 10 Oct 2008 22:04:41 +0300 by phpDocumentor 1.4.2