webCOMAND

META()

Return an object metadata property value.

Prototype

mixed META(cpath $property, mixed $option = NULL)

Parameters

  • property - One of the following property names, which may appear at the end of a series of cPath-style dot-notation fields, relative to the queried object.  For example, META(Contents.LastModified).  The following property names are like a cPath field name, so they should not be in a quoted string.
    • LastModified - Return the object's Last Modified Timestamp.
    • Unsaved - Returns 1 if the object is in an unsaved state for the specified User (option can be a username or User OID), otherwise 0.
    • Unapproved - Returns 1 if the object is in an unapproved state for the specified User (option can be a username or User OID), otherwise 0.
  • user - Certain properties (Unsaved and Unapproved) take an optional user as the second parameter.  The user can be identified by their username or a cPath, such as their OID.  If not specified, the current user will be used.  See examples below.
  • field - Certain properties (Unsaved and Unapproved) take an optional field as the third parameter.  The field is identified by the Content Type Field Identifier.  See examples below.

Return

The return value depends on the specified property.  See property parameter above.

Last Modified Example

SELECT META(LastModified) AS LastModified FROM Contact LIMIT 1

Unsaved Example

SELECT META(Unsaved,'john@example.com') AS IsUnsaved FROM Contact LIMIT 1

Unapproved Example

SELECT META(Unapproved,123,'Parent') AS IsUnapproved FROM Contact LIMIT 1