SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Category

Functions

NameVisibilityDescription
categoryListpublic (static)Return an array of IDs of categories a record is in.
columnMain2joinerpublic (static)Converts a main table name into a joiner column name.
containspublic (static)Does a given category contatin a given record?
createpublic (static)Creates a category.
insertIntopublic (static)Inserts a record into a category.
lookuppublic (static)Looks up a category.
lookupOrCreatepublic (static)Looks up a category. If not found, creates the category.
namepublic (static)Get the name of a category based on the category id
recordListpublic (static)Return an array of IDs of records in a given category.
removefrompublic (static)Removes a record from a category.
tableCat2mainpublic (static)Converts a category table (e.g. 'articles_cat_list') into a main table (e.g. 'articles')
tableMain2catpublic (static)Converts a main table name into a category table name.
tableMain2joinerpublic (static)Converts a main table name into a joiner table name.

public categoryList

unknown Category::categoryList ( string $table , int $record_id );

Return an array of IDs of categories a record is in.
If there are no categories, returns an empty array.

public columnMain2joiner

string Category::columnMain2joiner ( string $table );

Converts a main table name into a joiner column name.
Assumes standard naming conventions.

public contains

unknown Category::contains ( string $table , int $record_id , int $category_id );

Does a given category contatin a given record?
Returns true if found, false otherwise

public create

unknown Category::create ( string $table , string $name );

Creates a category.
Returns the id or NULL on failure.

public insertInto

bool Category::insertInto ( string $table , int $record_id , int $category_id );

Inserts a record into a category.

public lookup

unknown Category::lookup ( string $table , string $name [, bool $case_sensitive ] );

Looks up a category.
Returns the id, or NULL if not found.

public lookupOrCreate

unknown Category::lookupOrCreate ( string $table , string $name [, bool $case_sensitive ] );

Looks up a category. If not found, creates the category.
Returns the id or NULL on failure.

public name

unknown Category::name ( string $table , string $id );

Get the name of a category based on the category id
Returns the name, or NULL if not found.

public recordList

unknown Category::recordList ( string $table , int $category_id );

Return an array of IDs of records in a given category.
If there are no records, returns an empty array.

public removefrom

unknown Category::removefrom ( string $table , int $record_id , int $category_id );

Removes a record from a category.
Returns true on success and false on failure

public tableCat2main

string Category::tableCat2main ( string $table );

Converts a category table (e.g. 'articles_cat_list') into a main table (e.g. 'articles')
Assumes standard naming conventions.

public tableMain2cat

string Category::tableMain2cat ( string $table );

Converts a main table name into a category table name.
Assumes standard naming conventions.

public tableMain2joiner

string Category::tableMain2joiner ( string $table );

Converts a main table name into a joiner table name.
Assumes standard naming conventions.