webCOMAND

repo::get_content_type()

Get a content type based on it's identifierQuery a repository and return a collection of matching objects.

Prototype

collection get(mixed $identifier, array $options = [])

Parameters

  • identifier - Numeric OID or string Identifier of the Content Type to get.
  • options
    • force_load - Set to TRUE to force a content type to be (re)loaded from the repository, even if it was already loaded.

Return

If a matching content type is found, the content type is returned.  Otherwise, NULL is returned.

Example

Identifier Example

$ct = $repo->get_content_type('Contact');
if($ct) {
    echo($ct->Title . " - OID " . $ct->OID . "\n");
} else {
    echo("Could not find Content Type with Identifier 'Contact'.\n");
}

OID Example

$ct = $repo->get_content_type(123);
if($ct) {
    echo($ct->Title . " - Identifier " . $ct->Identifier . "\n");
} else {
    echo("Could not find Content Type with OID 123.\n");
}