RT 5.0.4 Documentation

RT::Article

Go to latest version →

Create PARAMHASH

Create takes a hash of values and creates a row in the database:

  varchar(200) 'Name'.
  varchar(200) 'Summary'.
  int(11) 'Content'.
  Class ID  'Class'

  A paramhash called  'CustomFields', which contains 
  arrays of values for each custom field you want to fill in.
  Arrays aRe ordered. 

ValidateName NAME

Takes a name (string, required) and an optional class id. Returns true if that name is not in use by another article of that class.

If no class is supplied and the class can't be derived from the article object, returns true if that name isn't used by any other article at all.

Delete

This does not remove from the database; it merely sets the Disabled bit.

Children

Returns an RT::Articles object which contains all articles which have this article as their parent. This routine will not recurse and will not find grandchildren, great-grandchildren, uncles, aunts, nephews or any other such thing.

Takes a paramhash of Type and one of Base or Target. Adds that link to this article.

Prevents the use of plain numbers to avoid confusing behaviour.

URIObj

Returns this article's URI

CurrentUserCanSee

Returns true if the current user can see the article, using ShowArticle

_Set { Field => undef, Value => undef

Internal helper method to record a transaction as we update some core field of the article

SetClass CLASS

Set the class for this article.

SetName NAME

Set Name for this article.

_Value PARAM

Return "PARAM" for this object. if the current user doesn't have rights, returns undef

LoadByInclude Field Value

Takes the name of a form field from "Include Article" and the value submitted by the browser and attempts to load an Article.

This handles Articles included by searching, by the Name and via the hotlist.

If you optionaly pass an id as the Queue argument, this will check that the Article's Class is applied to that Queue.

LoadByNameAndClass

Loads the requested article from the provided class. If found, it is loaded into the current object.

Article names must be unique within a class, but can be duplicated across different classes. This method is helpful for loading the correct article by name if a name might be duplicated in different classes.

Takes a hash with the keys:

Name

An RT::Article ID or Name.

Class

An RT::Class ID or Name.

id

Returns the current value of id. (In the database, id is stored as int(11).)

Name

Returns the current value of Name. (In the database, Name is stored as varchar(255).)

SetName VALUE

Set Name to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Name will be stored as a varchar(255).)

Summary

Returns the current value of Summary. (In the database, Summary is stored as varchar(255).)

SetSummary VALUE

Set Summary to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Summary will be stored as a varchar(255).)

SortOrder

Returns the current value of SortOrder. (In the database, SortOrder is stored as int(11).)

SetSortOrder VALUE

Set SortOrder to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, SortOrder will be stored as a int(11).)

Class

Returns the current value of Class. (In the database, Class is stored as int(11).)

SetClass VALUE

Set Class to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Class will be stored as a int(11).)

ClassObj

Returns the Class Object which has the id returned by Class

Parent

Returns the current value of Parent. (In the database, Parent is stored as int(11).)

SetParent VALUE

Set Parent to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Parent will be stored as a int(11).)

URI

Returns the current value of URI. (In the database, URI is stored as varchar(255).)

SetURI VALUE

Set URI to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, URI will be stored as a varchar(255).)

Disabled

Returns the current value of Disabled. (In the database, Disabled is stored as int(2).)

SetDisabled VALUE

Set Disabled to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Disabled will be stored as a int(2).)

Creator

Returns the current value of Creator. (In the database, Creator is stored as int(11).)

Created

Returns the current value of Created. (In the database, Created is stored as datetime.)

LastUpdatedBy

Returns the current value of LastUpdatedBy. (In the database, LastUpdatedBy is stored as int(11).)

LastUpdated

Returns the current value of LastUpdated. (In the database, LastUpdated is stored as datetime.)

← Back to index