- ⌂ Object Methods
- Methods
.META()
Return an object metadata property value.
Prototype
mixed .META(cpath $property, mixed $option = NULL)
Parameters
- property - One of the following property names. The following property names are keywords, so they should not be a quoted string. For example, META(LastModified).
- LastModified - The greater-object's Last Modified Timestamp, which is the most recent modification of a top-level object and all of it's embedded objects recursively. In other words, a top-level object and all of it's embedded objects recursively share the same Last Modified Timestamp.
- ThisLastModified - The immediate-object's This Last Modified Timestamp, which is the most recent modification to the immediate-object, regardless of whether or not the object is a top-level object or embedded within another object. In other words, a top-level object may have a different This Last Modified Timestamp than it's embedded children, which are modified independently from the top-level object and other embedded objects.
- LastModifiedNote - The version note of the greater-object's last modification.
- ThisLastModifiedNote - The version note of the immediate-object's last modification.
- LastModifiedRevision - The revision of the greater-object's last modification.
- ThisLastModifiedRevision - The revision of the immediate-object's last modification.
- LastCreatedRevision - The revision of the greater-object's creation.
- ThisCreatedRevision - The revision of the immediate-object's creation.
- Unsaved - 1 if the greater-object is in an unsaved state for the specified User (option can be a username or User OID), otherwise 0.
- ThisUnsaved - 1 if the immediate-object is in an unsaved state for the specified User (option can be a username or User OID), otherwise 0.
- Unapproved - 1 if the greater-object is in an unapproved state for the specified User (option can be a username or User OID), otherwise 0.
- ThisUnapproved - 1 if the immediate-object is in an unapproved state for the specified User (option can be a username or User OID), otherwise 0.
- Approved - 1 if the greater-object is in an approved state for the specified User (option can be a username or User OID), otherwise 0.
- ThisApproved - 1 if the immediate-object is in an approved state for the specified User (option can be a username or User OID), otherwise 0.
- HasIcon - 1 if the top-level-object has an icon defined (in all variants), otherwise 0.
- ThisHasIcon - 1 if the immediate-object has an icon defined, otherwise 0.
- Deleted - 1 if the top-level-object is deleted (in all variants), otherwise 0.
- ThisDeleted - 1 if the immediate-object is deleted, otherwise 0.
- ParentOID - OID of the immediate-object's parent OID (an alias for ThisParentOID).
- ThisParentOID - OID of the immediate-object's parent OID.
- TopParentOID - OID of the top-most-object.
- ThisTopParentOID - OID of the top-most-object of the immediate-object, which is always the same as TopParentOID.
- IsEmbedded - 1 if the immediate-object is embedded, otherwise 0.
- ThisIsEmbedded - 1 if the immediate-object is embedded, 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 Friend.META(LastModified) AS LastModified FROM Contact LIMIT 1
Unsaved Example
SELECT Friend.META(Unsaved,'john@example.com') AS IsUnsaved FROM Contact LIMIT 1
Unapproved Example
SELECT Friend.META(Unapproved,123,'Parent') AS IsUnapproved FROM Contact LIMIT 1