PHP Класс Articles_model, 68kb

Наследование: extends Base_module_model
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( ) : void Constructor
add_article ( array $data ) : mixed Add Article
add_fields ( $data ) : mixed Add Listing Fields
add_hit ( $id ) : boolean Add Hit
check_uri ( string $article_uri, $article_id = FALSE ) : boolean Check URI
delete_article ( $article_id ) : TRUE Delete Article
delete_article_attachments ( $id ) Delete all Uploaded files.
delete_article_tags ( $id ) Delete all article tags.
edit_article ( $article_id, array $data ) : boolean Edit Category
get_article ( $query ) Get Article
get_article_by_uri ( $uri ) : array Get Article By URI.
get_articles ( ) : mixed Get Article
get_articles_by_catid ( $id, $limit, $current_row, $show_count = TRUE ) : mixed Get Article By Cat ID.
get_attachments ( $id ) : array Get Attachments
get_category_relationship ( $article_id = '' ) : boolean Get Product to Categories
get_cats_by_article ( $id ) : array Get Category By Article.
get_highest_rated ( $number = 25 ) : array Get Highest Rated.
get_latest ( $number = 25 ) : array Get Latest Articles.
get_most_popular ( $number = 25 ) : array Get Most Popular.
get_related ( $id, $number = 5 ) : array Get Related Articles.
glossary ( $content ) : string Glossary
insert_cats ( $cats, $id ) : boolean Insert Article2Cats

Приватные методы

Метод Описание
_dot ( $str, $len, $dots = "..." ) : string dot
_get_article_by_id ( $id ) : array Get Article By ID.

Описание методов

__construct() публичный Метод

Constructor
public __construct ( ) : void
Результат void

add_article() публичный Метод

Add an article to the db.
public add_article ( array $data ) : mixed
$data array An array of data.
Результат mixed Id on success.

add_fields() публичный Метод

Add Listing Fields
public add_fields ( $data ) : mixed
Результат mixed

add_hit() публичный Метод

Increase the article hit count.
public add_hit ( $id ) : boolean
Результат boolean

check_uri() публичный Метод

Checks other articles for the same uri.
public check_uri ( string $article_uri, $article_id = FALSE ) : boolean
$article_uri string The uri name
Результат boolean True if checks out ok, FALSE otherwise

delete_article() публичный Метод

Responsible for deleting an article.
public delete_article ( $article_id ) : TRUE
Результат TRUE on success.

delete_article_attachments() публичный Метод

Delete all Uploaded files.

delete_article_tags() публичный Метод

Delete all article tags.
public delete_article_tags ( $id )

edit_article() публичный Метод

Handles editing an article.
public edit_article ( $article_id, array $data ) : boolean
$data array An array of data.
Результат boolean TRUE on success.

get_article() публичный Метод

Get Article
public get_article ( $query )

get_article_by_uri() публичный Метод

Get a single article from its a_uri
public get_article_by_uri ( $uri ) : array
Результат array

get_articles() публичный Метод

Gets a list of all articles
public get_articles ( ) : mixed
Результат mixed Either int or array.

get_articles_by_catid() публичный Метод

Get a list of articles from the same category.
public get_articles_by_catid ( $id, $limit, $current_row, $show_count = TRUE ) : mixed
Результат mixed

get_attachments() публичный Метод

Get all attachments by article ID
public get_attachments ( $id ) : array
Результат array

get_category_relationship() публичный Метод

Get Product to Categories
public get_category_relationship ( $article_id = '' ) : boolean
Результат boolean

get_cats_by_article() публичный Метод

Get a list of categories an article is associated with.
public get_cats_by_article ( $id ) : array
Результат array

get_highest_rated() публичный Метод

Get a list of the articles and order by rating. Usuage: $this->article_model->get_highest_rated(10);
public get_highest_rated ( $number = 25 ) : array
Результат array

get_latest() публичный Метод

Get a list of the latest articles
public get_latest ( $number = 25 ) : array
Результат array

glossary() публичный Метод

Checks for terms in the glossary and links the text to the term. Also can be used in conjunction with jQuery tooltip.
public glossary ( $content ) : string
Результат string the content with the link

insert_cats() публичный Метод

Insert the selected categories into the article2cat table.
public insert_cats ( $cats, $id ) : boolean
Результат boolean