PHP Class ArticleTypeField

Inheritance: extends DatabaseObject
Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Méthodes publiques

Свойство Type Description
$m_columnNames
$m_dbTableName
$m_keyColumnNames

Méthodes publiques

Méthode Description
DatabaseTypes ( $p_numericDigits = null, $p_numericPrecision = null ) : array Returns an array of valid field data types.
FetchFields ( $p_name = null, $p_articleType = null, $p_dataType = null, $p_negateName = false, $p_negateArticleType = false, $p_negateDataType = false, $p_selectHidden = true, $p_skipCache = false ) : array Returns an array of fields from all article types that match the given conditions.
SetFieldColor ( $p_article_type, $p_field_name, $p_color_value )
TypesConvertibleFrom ( $p_type )
TypesConvertibleTo ( $p_type ) : array Returns an array of types compatible with the given field type.
VerboseTypeName ( $p_typeName, $p_languageId = 1, $p_rootTopicId = null ) : string Get a human-readable representation of the column type.
__construct ( $p_articleTypeName = null, $p_fieldName = null )
create ( string $p_type = null, array $p_params = [] ) Create a column in the table.
delete ( ) Deletes the current article type field.
fetch ( array $p_recordSet = null, $p_forceExists = false ) : boolean Fetch a single record from the database for the given key.
getArticleType ( ) : string Returns the article type name.
getColor ( )
getConvertibleFromTypes ( )
getConvertibleToTypes ( )
getDefaultColor ( )
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.
getFilter ( ) : boolean Returns whether articles of this type should be filtered out by default at listings.
getGenericType ( ) fn getType
getMaxSize ( ) : integer Gets the maximum size of a article type
getMetadata ( ) : array Return an associative array of the metadata in ArticleFieldMetadata.
getName ( ) : string
getNextOrder ( ) : integer Returns the highest weight + 1 or 0 for the starter
getOrders ( ) : array Get the ordering of all fields; initially, a field has a field_weight of NULL when it is created. if we discover that a field has a field weight of NULL, we give it the MAX+1 field_weight. Returns a NUMERIC array of ORDER => FIELDNAME.
getPhraseId ( ) : -1
getPrintName ( ) : string
getStatus ( ) : string Returns the is_hidden status of a field. Returns 'hidden' or 'shown'.
getTopicTypeRootElement ( ) : string
getTranslations ( ) : array Returns an array of translation strings for the field name.
getType ( ) : string
getVerboseTypeName ( $p_languageId = 1 ) fn VerboseTypeName
isContent ( ) : boolean Returns true if the current field is a content field.
isConvertibleFrom ( $p_type ) : boolean Returns true if the given type can be converted to the current field type.
isConvertibleTo ( $p_type )
isHidden ( ) : boolean Returns true if the current field is hidden.
rename ( $p_newName ) Rename the article type field.
reorder ( $move ) Reorders the current field; accepts either "up" or "down"
setColor ( $p_color )
setFilter ( $p_filter ) : boolean Sets whether articles of this type should be filtered out by default at listings.
setIsContent ( $p_isContent ) : boolean Sets the content flag. Returns true on success, false otherwise.
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 did not exist.
setOrders ( $orderArray ) Saves the ordering of all the fields. Accepts an NUMERIC array of ORDERRANK => FIELDNAME. (see getOrders)
setShowInEditor ( $p_showInEditor ) : integer Sets the int for where to show the field
setStatus ( $p_status )
setType ( $p_type ) Changes the type of the field
showInEditor ( ) : integer Returns int for where to show the field
translationExists ( $p_languageId ) Quick lookup to see if the current language is already translated for this article type: used by delete and update in setName returns 0 if no translation or the phrase_id if there is one.

Method Details

DatabaseTypes() public static méthode

Returns an array of valid field data types.
public static DatabaseTypes ( $p_numericDigits = null, $p_numericPrecision = null ) : array
Résultat array

FetchFields() public static méthode

Returns an array of fields from all article types that match the given conditions.
public static FetchFields ( $p_name = null, $p_articleType = null, $p_dataType = null, $p_negateName = false, $p_negateArticleType = false, $p_negateDataType = false, $p_selectHidden = true, $p_skipCache = false ) : array
$p_name if specified returns fields with the given name
$p_articleType if specified returns fields of the given article type
$p_dataType if specified returns the fields having the given data type
Résultat array

SetFieldColor() public static méthode

public static SetFieldColor ( $p_article_type, $p_field_name, $p_color_value )

TypesConvertibleFrom() public static méthode

public static TypesConvertibleFrom ( $p_type )

TypesConvertibleTo() public static méthode

Returns an array of types compatible with the given field type.
public static TypesConvertibleTo ( $p_type ) : array
Résultat array

VerboseTypeName() public static méthode

Get a human-readable representation of the column type.
public static VerboseTypeName ( $p_typeName, $p_languageId = 1, $p_rootTopicId = null ) : string
Résultat string

__construct() public méthode

public __construct ( $p_articleTypeName = null, $p_fieldName = null )

create() public méthode

Create a column in the table.
public create ( string $p_type = null, array $p_params = [] )
$p_type string Can be one of: 'text', 'date', 'body', 'switch', 'numeric'.
$p_params array

delete() public méthode

Deletes the current article type field.
public delete ( )

fetch() public méthode

Fetch a single record from the database for the given key.
public fetch ( array $p_recordSet = null, $p_forceExists = false ) : boolean
$p_recordSet array If the record has already been fetched and we just need to assign the data to the object's internal member variable.
Résultat boolean TRUE on success, FALSE on failure

getArticleType() public méthode

Returns the article type name.
public getArticleType ( ) : string
Résultat string

getColor() public méthode

public getColor ( )

getConvertibleFromTypes() public méthode

getConvertibleToTypes() public méthode

getDefaultColor() public static méthode

public static getDefaultColor ( )

getDisplayName() public méthode

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
Résultat string

getDisplayNameLanguageCode() public méthode

Gets the language code of the current translation language; or none if there is no translation.
public getDisplayNameLanguageCode ( $p_lang ) : string
Résultat string

getFilter() public méthode

Returns whether articles of this type should be filtered out by default at listings.
public getFilter ( ) : boolean
Résultat boolean

getGenericType() public méthode

fn getType
public getGenericType ( )

getMaxSize() public méthode

Gets the maximum size of a article type
public getMaxSize ( ) : integer
Résultat integer

getMetadata() public méthode

Return an associative array of the metadata in ArticleFieldMetadata.
public getMetadata ( ) : array
Résultat array

getName() public méthode

public getName ( ) : string
Résultat string

getNextOrder() public méthode

Returns the highest weight + 1 or 0 for the starter
public getNextOrder ( ) : integer
Résultat integer

getOrders() public méthode

Get the ordering of all fields; initially, a field has a field_weight of NULL when it is created. if we discover that a field has a field weight of NULL, we give it the MAX+1 field_weight. Returns a NUMERIC array of ORDER => FIELDNAME.
public getOrders ( ) : array
Résultat array

getPhraseId() public méthode

public getPhraseId ( ) : -1
Résultat -1

getPrintName() public méthode

public getPrintName ( ) : string
Résultat string

getStatus() public méthode

Returns the is_hidden status of a field. Returns 'hidden' or 'shown'.
public getStatus ( ) : string
Résultat string (shown|hidden)

getTopicTypeRootElement() public méthode

public getTopicTypeRootElement ( ) : string
Résultat string

getTranslations() public méthode

Returns an array of translation strings for the field name.
public getTranslations ( ) : array
Résultat array

getType() public méthode

public getType ( ) : string
Résultat string

getVerboseTypeName() public méthode

fn VerboseTypeName
public getVerboseTypeName ( $p_languageId = 1 )

isContent() public méthode

Returns true if the current field is a content field.
public isContent ( ) : boolean
Résultat boolean

isConvertibleFrom() public méthode

Returns true if the given type can be converted to the current field type.
public isConvertibleFrom ( $p_type ) : boolean
$p_type
Résultat boolean

isConvertibleTo() public méthode

public isConvertibleTo ( $p_type )

isHidden() public méthode

Returns true if the current field is hidden.
public isHidden ( ) : boolean
Résultat boolean

rename() public méthode

Rename the article type field.
public rename ( $p_newName )

reorder() public méthode

Reorders the current field; accepts either "up" or "down"
public reorder ( $move )

setColor() public méthode

public setColor ( $p_color )

setFilter() public méthode

Sets whether articles of this type should be filtered out by default at listings.
public setFilter ( $p_filter ) : boolean
Résultat boolean

setIsContent() public méthode

Sets the content flag. Returns true on success, false otherwise.
public setIsContent ( $p_isContent ) : boolean
$p_isContent
Résultat boolean

setName() public méthode

Set the type name for the given language. A new entry in the database will be created if the language did not exist.
public setName ( integer $p_languageId, string $p_value ) : boolean
$p_languageId integer
$p_value string
Résultat boolean

setOrders() public méthode

Saves the ordering of all the fields. Accepts an NUMERIC array of ORDERRANK => FIELDNAME. (see getOrders)
public setOrders ( $orderArray )

setShowInEditor() public méthode

Sets the int for where to show the field
public setShowInEditor ( $p_showInEditor ) : integer
$p_showInEditor
Résultat integer

setStatus() public méthode

public setStatus ( $p_status )

setType() public méthode

Changes the type of the field
public setType ( $p_type )

showInEditor() public méthode

Returns int for where to show the field
public showInEditor ( ) : integer
Résultat integer

translationExists() public méthode

Quick lookup to see if the current language is already translated for this article type: used by delete and update in setName returns 0 if no translation or the phrase_id if there is one.
public translationExists ( $p_languageId )

Property Details

$m_columnNames public_oe property

public $m_columnNames

$m_dbTableName public_oe property

public $m_dbTableName

$m_keyColumnNames public_oe property

public $m_keyColumnNames