PHP Класс ArticleType

The followings are the available columns in table '{{article_type}}':
Наследование: extends CActiveRecord
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
ArticleType ( string $p_articleType ) An article type is a dynamic table that is created for an article to allow different publications to display their content in different ways.
GetArticleTypes ( boolean $p_includeHidden = false ) : array Get all article types that currently exist.
IsValidFieldName ( string $p_name ) : boolean Static function. Returns TRUE if the given name is valid as an article type name.
SetTypeFilter ( $p_article_type, $p_filter_value ) : boolean Action for setting article type filtering.
__getPreviewTableName ( $p_table ) : string Creates a preview table of PreviewNTablename, where N is a unique integer.
commentsEnabled ( ) : boolean Return TRUE if comments are enabled for this article type.
create ( ) : boolean Create a new Article Type. Creates a new table in the database.
delete ( ) Delete the article type. This will delete the entire table in the database. Not recommended unless there is no article data in the table.
exists ( ) : boolean Return TRUE if the Article Type exists.
getArticlesArray ( ) : array For the preview of merge; this grabs an array of the article numbers for calculating next, previous and current.
getDisplayName ( $p_lang ) : string Gets the translation for a given language; default language is the session language. If no translation is set for that language, we return the dbTableName.
getDisplayNameLanguageCode ( $p_lang ) : string Gets the language code of the current translation language; or none if there is no translation.
getFilterStatus ( ) : boolean Returns whether articles of this type should be filtered out by default at listings.
getMaxSize ( ) : integer Gets the maximum size of a article type
getMetadata ( ) : array Return an associative array of the metadata in ArticleFieldMetadata.
getNumArticles ( ) : integer Returns the number of articles associated with this type.
getPhraseId ( ) : -1 Returns the phrase id of the AT.
getPreviewArticleData ( ) : object Returns an ArticleData object of the first found article of this type.
getStatus ( ) : string Returns 'hidden' if the article type should not be visible, and 'shown' if it should be.
getTableName ( ) : string
getTranslations ( ) : array Parses m_metadata for phrase_ids and returns an array of language_id => translation_text
getTypeName ( ) : string
getUserDefinedColumns ( $p_fieldName = null, $p_selectHidden = true, $p_skipCache = false ) : array Return an array of ArticleTypeField objects.
merge ( $p_src, $p_dest, $p_rules ) : boolean Does the merge or a preview of the merge.
rename ( $p_newName ) Rename the article type. This will move the entire table in the database and update ArticleTypeMetadata. Usually, one wants to just rename the Display Name, which is done via SetDisplayName
setCommentsEnabled ( boolean $p_value ) Return TRUE if comments are enabled for this article type.
setName ( integer $p_languageId, string $p_value ) : boolean Set the type name for the given language. A new entry in the database will be created if the language does not exist.
setStatus ( $p_status ) Sets whether the article type should be visible or hidden.
translationExists ( $p_languageId ) A quick lookup to see if the current language was already translated for this article type: used by delete and update in setName.

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

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

An article type is a dynamic table that is created for an article to allow different publications to display their content in different ways.
public ArticleType ( string $p_articleType )
$p_articleType string

GetArticleTypes() публичный статический Метод

Returns an array of strings.
public static GetArticleTypes ( boolean $p_includeHidden = false ) : array
$p_includeHidden boolean
Результат array

IsValidFieldName() публичный статический Метод

Static function. Returns TRUE if the given name is valid as an article type name.
public static IsValidFieldName ( string $p_name ) : boolean
$p_name string
Результат boolean

SetTypeFilter() публичный статический Метод

Action for setting article type filtering.
public static SetTypeFilter ( $p_article_type, $p_filter_value ) : boolean
Результат boolean

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

Creates a preview table of PreviewNTablename, where N is a unique integer.
public __getPreviewTableName ( $p_table ) : string
Результат string a tablename

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

Return TRUE if comments are enabled for this article type.
public commentsEnabled ( ) : boolean
Результат boolean

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

Create a new Article Type. Creates a new table in the database.
public create ( ) : boolean
Результат boolean

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

Delete the article type. This will delete the entire table in the database. Not recommended unless there is no article data in the table.
public delete ( )

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

Return TRUE if the Article Type exists.
public exists ( ) : boolean
Результат boolean

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

For the preview of merge; this grabs an array of the article numbers for calculating next, previous and current.
public getArticlesArray ( ) : array
Результат array

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

Gets the translation for a given language; default language is the session language. If no translation is set for that language, we return the dbTableName.
public getDisplayName ( $p_lang ) : string
Результат string

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

Gets the language code of the current translation language; or none if there is no translation.
public getDisplayNameLanguageCode ( $p_lang ) : string
Результат string

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

Returns whether articles of this type should be filtered out by default at listings.
public getFilterStatus ( ) : boolean
Результат boolean

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

Gets the maximum size of a article type
public getMaxSize ( ) : integer
Результат integer

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

Return an associative array of the metadata in ArticleFieldMetadata.
public getMetadata ( ) : array
Результат array

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

Returns the number of articles associated with this type.
public getNumArticles ( ) : integer
Результат integer

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

Returns the phrase id of the AT.
public getPhraseId ( ) : -1
Результат -1

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

If no article was found create an empty one.
public getPreviewArticleData ( ) : object
Результат object

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

Returns 'hidden' if the article type should not be visible, and 'shown' if it should be.
public getStatus ( ) : string
Результат string (shown|hidden)

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

public getTableName ( ) : string
Результат string

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

Parses m_metadata for phrase_ids and returns an array of language_id => translation_text
public getTranslations ( ) : array
Результат array

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

public getTypeName ( ) : string
Результат string

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

Return an array of ArticleTypeField objects.
public getUserDefinedColumns ( $p_fieldName = null, $p_selectHidden = true, $p_skipCache = false ) : array
Результат array

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

The p_rules array is an associative array with the key being the DESTINATION fieldname and the values being the SOURCE fieldname (without Fs). E.g. $p_rules = array('a' => 'a', 'b' => 'title', 'd' => 'body'); p_rules is verified elsewhere (see article_types/merge3.php). If we are doing an actual merge, all that happens is that we rename the Type in Articles from SrcType to DestType and run the merge (p_rules) on the XSrcTable entries and move them over to XDestType. Merged articles have the same ArticleNumber as their originals.
public merge ( $p_src, $p_dest, $p_rules ) : boolean
Результат boolean

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

Rename the article type. This will move the entire table in the database and update ArticleTypeMetadata. Usually, one wants to just rename the Display Name, which is done via SetDisplayName
public rename ( $p_newName )
$p_newName

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

Return TRUE if comments are enabled for this article type.
public setCommentsEnabled ( boolean $p_value )
$p_value boolean

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

Set the type name for the given language. A new entry in the database will be created if the language does not exist.
public setName ( integer $p_languageId, string $p_value ) : boolean
$p_languageId integer
$p_value string
Результат boolean

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

Sets whether the article type should be visible or hidden.
public setStatus ( $p_status )

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

Returns 0 if no translation or the phrase_id if there is one.
public translationExists ( $p_languageId )