Classification Class Reference

Metadata type representing hierarchical ("Tree") controlled vocabulary values. More...

Public Member Functions

 Classification ($ClassId, $Name=NULL, $FieldId=NULL, $ParentId=NULL)
 Class constructor.
 Status ()
 Returns success/failure code for last call (where applicable).
 Id ()
 Get Classification ID.
 FullName ()
 Get full classification name (all segments).
 Name ()
 Get name of classification segment.
 VariantName ()
 Get variant name of classification, if any.
 Depth ()
 Get depth of classification in hierarchy.
 ResourceCount ()
 Get number of Resources having this Classification assigned to them.
 SegmentsCreated ()
 Get number of new segments (Classifications) generated when creating a new Classification with a full name.
 ParentId ()
 Get ID of parent Classification.
 SegmentName ($NewValue=DB_NOVALUE)
 Get or set the segment name.
 LinkString ($NewValue=DB_NOVALUE)
 Get or set the stored link string for the Classification.
 QualifierId ($NewValue=DB_NOVALUE)
 Get or set the Qualifier associated with the Classification by ID.
 FieldId ($NewValue=DB_NOVALUE)
 Get or set the ID of the MetadataField for the Classification.
 Qualifier ($NewValue=DB_NOVALUE)
 Get or set the Qualifier associated with the Classification.
 RecalcDepthAndFullName ()
 Rebuild classification full name and recalculate depth in hierarchy.
 RecalcResourceCount ($IdsToSkip=NULL)
 Recalculate number of resources assigned to class and any parent classes.
 ChildCount ()
 Get number of classifications that have this Classification as their direct parent.
 ChildList ()
 Get list of IDs of Classifications that have this class as an "ancestor" (parent, grandparent, great-grandparent, etc).
 Delete ($DeleteParents=FALSE, $DeleteIfHasResources=FALSE, $DeleteIfHasChildren=FALSE)
 Remove Classification (and accompanying associations) from database.

Public Attributes

const CLASSSTAT_OK = 0
const CLASSSTAT_INVALIDID = 1
const CLASSSTAT_INVALIDPARENTID = 2
const CLASSSTAT_DUPLICATENAME = 3

List of all members.


Detailed Description

Metadata type representing hierarchical ("Tree") controlled vocabulary values.

Definition at line 15 of file Classification.php.


Member Function Documentation

Classification::ChildCount (  )

Get number of classifications that have this Classification as their direct parent.

Returns:
Count of child Classifications.

Definition at line 468 of file Classification.php.

References Id().

Referenced by Delete().

Here is the caller graph for this function:

Classification::ChildList (  )

Get list of IDs of Classifications that have this class as an "ancestor" (parent, grandparent, great-grandparent, etc).

Returns:
Array of child/grandchild/etc Classification IDs.

Definition at line 483 of file Classification.php.

References Classification(), and Id().

Classification::Classification ( ClassId,
Name = NULL,
FieldId = NULL,
ParentId = NULL 
)

Class constructor.

This can be used both to access an existing classification or to add a new classification to a hierarchy. For existing classifications specify just the Classification ID. For new classifications, pass in NULL for the Classification ID, and specify all of the other parameters.

Parameters:
ClassIdID of Classification. Use NULL to create a new Classification.
NameFull name or segment name for new Classification. Segment name can be used if a parent ID is also supplied, otherwise full name is assumed. (OPTIONAL)
FieldIdMetadataField ID for new Classification. (OPTIONAL)
ParentIdID of parent in hierachy of for new Classification. Use -1 for new Classification with no parent (i.e. at top level of hierarchy). (OPTIONAL)

Definition at line 36 of file Classification.php.

References CLASSSTAT_DUPLICATENAME, CLASSSTAT_INVALIDID, CLASSSTAT_INVALIDPARENTID, CLASSSTAT_OK, Id(), and SegmentsCreated().

Referenced by ChildList(), Delete(), RecalcDepthAndFullName(), and RecalcResourceCount().

Here is the caller graph for this function:

Classification::Delete ( DeleteParents = FALSE,
DeleteIfHasResources = FALSE,
DeleteIfHasChildren = FALSE 
)

Remove Classification (and accompanying associations) from database.

Parameters:
DeleteParentsFlag indicating whether to also delete Classification entries above this one in the hierarchy. (OPTIONAL - defaults to FALSE)
DeleteIfHasResourcesFlag indicating whether to delete the Classification if it still has Resources associated with it. (OPTIONAL - defaults to FALSE)
DeleteIfHasChildrenFlag indicating whether to delete the Classification if others have it as a parent. (OPTIONAL - defaults to FALSE)

Definition at line 510 of file Classification.php.

References ChildCount(), Classification(), Id(), RecalcResourceCount(), and ResourceCount().

Classification::Depth (  )

Get depth of classification in hierarchy.

Top level is depth of 0.

Returns:
Depth in hierarchy.

Definition at line 259 of file Classification.php.

Classification::FieldId ( NewValue = DB_NOVALUE )

Get or set the ID of the MetadataField for the Classification.

Parameters:
NewValueID of new MetadataField.
Returns:
ID of currently associated MetadataField.

Definition at line 312 of file Classification.php.

Classification::FullName (  )

Get full classification name (all segments).

Returns:
Classification name.

Definition at line 241 of file Classification.php.

Referenced by Name().

Here is the caller graph for this function:

Classification::Id (  )

Get Classification ID.

Returns:
Numerical Classification ID.

Definition at line 235 of file Classification.php.

References Id().

Referenced by ChildCount(), ChildList(), Classification(), Delete(), Id(), RecalcDepthAndFullName(), and RecalcResourceCount().

Here is the caller graph for this function:

Classification::LinkString ( NewValue = DB_NOVALUE )

Get or set the stored link string for the Classification.

(This value is not used, updated, or manipulated in any way by Classification, and is only being stored as a UI optimization.)

Parameters:
NewValueNew link string.
Returns:
Current link string.

Definition at line 295 of file Classification.php.

Classification::Name (  )

Get name of classification segment.

Returns:
Segment name.

Definition at line 247 of file Classification.php.

References FullName().

Classification::ParentId (  )

Get ID of parent Classification.

Returns -1 if no parent (i.e. Classification is at top level of hierarchy).

Definition at line 278 of file Classification.php.

Classification::Qualifier ( NewValue = DB_NOVALUE )

Get or set the Qualifier associated with the Classification.

Parameters:
NewValueNew Qualifier.
Returns:
Associated Qualifier (object) or NULL if no qualifier.
See also:
QualifierId()

Definition at line 321 of file Classification.php.

References QualifierId().

Classification::QualifierId ( NewValue = DB_NOVALUE )

Get or set the Qualifier associated with the Classification by ID.

Parameters:
NewValueID of new Qualifier.
Returns:
ID of current Qualifier.
See also:
Qualifier()

Definition at line 304 of file Classification.php.

Referenced by Qualifier().

Here is the caller graph for this function:

Classification::RecalcDepthAndFullName (  )

Rebuild classification full name and recalculate depth in hierarchy.

This is a DB-intensive and recursive function, and so should not be called without some forethought.

Definition at line 356 of file Classification.php.

References Classification(), and Id().

Classification::RecalcResourceCount ( IdsToSkip = NULL )

Recalculate number of resources assigned to class and any parent classes.

This is a DB-intensive and recursive function, and so should not be called without some forethought.

Parameters:
IdsToSkipClassification IDs to skip during recalculation. (OPTIONAL)
Returns:
Array of IDs of the Classifications that were updated.

Definition at line 414 of file Classification.php.

References Classification(), CLASSSTAT_OK, and Id().

Referenced by Delete().

Here is the caller graph for this function:

Classification::ResourceCount (  )

Get number of Resources having this Classification assigned to them.

This is only updated by RecalcResourceCount() and Delete().

Returns:
Count of resources having this Classification.

Definition at line 266 of file Classification.php.

Referenced by Delete().

Here is the caller graph for this function:

Classification::SegmentName ( NewValue = DB_NOVALUE )

Get or set the segment name.

Parameters:
NewValueNew segment name. (OPTIONAL)
Returns:
Segment name.

Definition at line 285 of file Classification.php.

Classification::SegmentsCreated (  )

Get number of new segments (Classifications) generated when creating a new Classification with a full name.

Definition at line 272 of file Classification.php.

References SegmentsCreated().

Referenced by Classification(), and SegmentsCreated().

Here is the caller graph for this function:

Classification::Status (  )

Returns success/failure code for last call (where applicable).

Returns:
Status code.

Definition at line 229 of file Classification.php.

Classification::VariantName (  )

Get variant name of classification, if any.

Returns:
Variant name.

Definition at line 253 of file Classification.php.


Member Data Documentation

Definition at line 23 of file Classification.php.

Referenced by Classification().

Definition at line 21 of file Classification.php.

Referenced by Classification().

Definition at line 22 of file Classification.php.

Referenced by Classification().


The documentation for this class was generated from the following file: