Initializes using a
GALGallery object.
This constructor shouldn't be called by a library user, the representations for the used tables are automatically created by the GALGallery object.
Checks if an instance of GALComments already exists in the specified GALGallery. If this is the case, this method throws an GAL_EComment. If not, it reads necessary information for further initialization from $glb.
Tags:
Overrides
GALGallueTable::__construct() (Initializes
$glb object variable.)
Parameters:
GALComment add(
array
$values, [bool
$super = false])
|
|
Create a new
GALComment.
The parameter $values is an associative array with the following fields:
- $values['owner'] GALUser optional The new comment's owner, default: The user currently logged in.
- $values['permission'] int required The new comment's permission, values GAL_PERMISSION_LOCKED GAL_PERMISSION_PRIVATE, GAL_PERMISSION_PROTECTED or GAL_PERMISSION_PUBLIC.
- $values['parent'] object or string recommended The item the commend is made about <strong>OR</strong>
- $values['parentClass'] string, $values['parentID'] int discouraged Set raw database values, e.g. for comments that are NOT about regular items (but e.g. forums or sth.).
- $values['tag'] int optional The new comment's tag.
- $values['title'] string recommended The new comment's title, default '(none)'.
- $values['comment'] string recommended The new comment's text, default ''.
- $values['direction'] string optional The text direction, one of 'ltr' or 'rtl', default 'ltr'.
If $values['parent'] is given and it's an object, the property
parentClass is initialized with the object's class name. If the object's class is one of
GALImage,
GALComment,
GALCategory,
GALGroup,
GALSeries or
GALFilm, the property
parentID is initialized with the object's ID, otherwise with 0. If $values['parent'] isn't an object, it's string value is taken as value for
parentClass, and
parentID is initialized with 0. If $values['parent'] is not given, $values['parentClass'] and $values['parentID'] are required and inserted directly as values for
parentClass and
parentID. This feature was added, because this way a guestbook or discussion forums could be realized by setting parentClass and parentID to user defined values.
Tags:
Parameters: