com.lokorin.lokorin.lib
[ class tree: com.lokorin.lokorin.lib ] [ index: com.lokorin.lokorin.lib ] [ all elements ]

Class: FilterArchive

Source Location: /_includes/lib_mplf_archive.php

Class Overview


Describes a filter archive. It contains categories structured into a navigatable tree. Each category can then contain filters.


Author(s):

  • Andreas Launila

Variables

Methods



Class Details

[line 30]
Describes a filter archive. It contains categories structured into a navigatable tree. Each category can then contain filters.



Tags:

author:  Andreas Launila


[ Top ]


Class Variables

$categories =

[line 36]

Stores categories that have been loaded. Key is the id, value is the Category instance.



Tags:

access:  private

Type:   array


[ Top ]

$edits =

[line 54]

Stores edits that have been loaded. Key is the id, value is the Edit instance.



Tags:

access:  private

Type:   array


[ Top ]

$filters =

[line 48]

Stores filters that have been loaded. Key is the id, value is the Filter instance.



Tags:

access:  private

Type:   array


[ Top ]

$moderators =

[line 60]

Stores moderators that have been loaded. Key is the id, value is the Moderator instance.



Tags:

access:  private

Type:   array


[ Top ]

$topCategories =

[line 42]

Stores the top level categories in the category tree, key is irrelevant, vaue is a Category instance.



Tags:

access:  private

Type:   array


[ Top ]



Class Methods


constructor __construct [line 65]

FilterArchive __construct( )

Constructor for FilterArchive.



Tags:

access:  public


[ Top ]

method addFilter [line 204]

boolean addFilter( string $contents, string $description, integer $categoryId, string $author)

Adds a filter to the archive.



Tags:

return:  True on success, false otherwise.
access:  public


Parameters:

string   $contents   The XML contents of the filter file.
string   $description   A short description of the filter.
integer   $categoryId   The unique identifier of the category that the filter should be placed in.
string   $author   The name of the author of the filter.

[ Top ]

method getAllCategoryNames [line 118]

array getAllCategoryNames( )

Gets a list of all category names.



Tags:

return:  Key is the id, value is the corresponding category name.
access:  public


[ Top ]

method getCategory [line 277]

Category getCategory( integer $id)

Get the category with the specified id.



Tags:

return:  The requested Category instance, null if none could be loaded.
access:  public


Parameters:

integer   $id   The unique identifier for the category.

[ Top ]

method getCategoryNames [line 137]

array getCategoryNames( Category $category, [string $base = ''])

Gets the category names for the specified category and all sub categories.



Tags:

return:  An array of string where each value represent a category name.
access:  private


Parameters:

Category   $category   The category that should be traversed.
string   $base   The prefix that should be used for all category names.

[ Top ]

method getCategoryTree [line 110]

array getCategoryTree( )

Constructs the Category tree and returns the top level categories.



Tags:

return:  All top level categories.
access:  public


[ Top ]

method getEdit [line 297]

Edit getEdit( integer $id)

Get the edit with the specified id.



Tags:

return:  The requested Edit instance, null if none could be loaded.
access:  public


Parameters:

integer   $id   The unique identifier for the edit.

[ Top ]

method getFilter [line 317]

Filter getFilter( integer $id)

Get the filter with the specified id.



Tags:

return:  The requested Filter instance, null if none could be loaded.
access:  public


Parameters:

integer   $id   The unique identifier for the filter.

[ Top ]

method getModerator [line 337]

Moderator getModerator( integer $id)

Get the moderator with the specified id.



Tags:

return:  The requested Moderator instance, null if none could be loaded.
access:  public


Parameters:

integer   $id   The unique identifier for the moderator.

[ Top ]

method getPathTo [line 159]

array getPathTo( integer $categoryId)

Gets the path to that a specified category through the tree.



Tags:

return:  The category ids sorted so that the id with key 0 is the top level, 1 the next step, 2 the step after that etc. An empty array means that the category could not be found.
access:  public


Parameters:

integer   $categoryId   The id of the category for which the path should be found.

[ Top ]

method recursiveFind [line 181]

array recursiveFind( Category $startCategory, integer $stopId)

A recursive function for finding the correct path via DFS.



Tags:

return:  All steps that were taken to find the stopId, including the stopId itself. An empty array means that the stopId could not be found.
access:  private


Parameters:

Category   $startCategory   The Category instance where the search should start.
integer   $stopId   The id of the category where the search should stop, i.e. the category to find.

[ Top ]

method suggestFilterChange [line 257]

void suggestFilterChange( integer $filterId, string $description, string $contents)

Adds a suggestion of a filter for the moderators to concider.



Tags:

access:  public


Parameters:

integer   $filterId   The unique identifier of the filter that the change should affect.
string   $description   A description of what the change is.
string   $contents   The new suggested contents for the filter file.

[ Top ]


Documentation generated on Sun, 16 Apr 2006 21:03:41 +0200 by phpDocumentor 1.3.0RC4