User Guide & Reference Manual

Content Type Model

Create, update, retrieve, and delete content types in Hero.

There are a few important notes to consider when creating and updating content types:

Initialization


$this->load->model('publish/content_type_model');
// methods now available at $this->content_type_model->x();

Method Reference

int new_content_type (string $name [, boolean $is_standard = FALSE [, boolean $is_privileged = FALSE [, boolean $is_module = FALSE [, string $template = 'content.thtml' [, string $base_url = '']]]]])

Create a new content type.

void update_content_type (int $content_type_id , string $name [, boolean $is_standard = FALSE [, boolean $is_privileged = FALSE [, string $template = 'content.thtml' [, string $base_url = '']]]])

Update an existing content type.

boolean delete_content_type (int $content_type_id)

Delete a content type.

boolean build_search_index (int $content_type_id)

This method rebuilds the database search index for a content type after adding/modifying/delete fields from the content type's custom field group.

array get_content_type (int $content_type_id)

Retrieve an array of a single content type, in the same format as get_content_types().

void get_content_types ( [array $filters = array()])

Retrieve an array of one or more content types based on optional filters.

Possible Filters:

Each returned content type array has the following data: