You are here

public function ContentTypeGroup::typeList in Content type groups 7

Same name and namespace in other branches
  1. 7.2 content_type_groups.class.inc \ContentTypeGroup::typeList()

Returns a list of content types belonging to this group in a format made for easy looping.

Parameters

bool $fetch_as_full: If TRUE, returns the data as full type information

Return value

array $machine_name => $name

File

./content_type_groups.module, line 311
Module file for the Content type groups module.

Class

ContentTypeGroup
Utility class to handle content type groups

Code

public function typeList($fetch_as_full = FALSE) {
  if ($fetch_as_full) {
    return $this->content_types;
  }
  else {
    $types = array();
    foreach ($this->content_types as $machine_name => $data) {
      $types[$machine_name] = $data['name'];
    }
    return $types;
  }
}