Class catalog

Description

This class encapsulates a media catalog, which is a collection of catalogitem objects.

Located in /catalog-defs.php (line 519)

RenderableObject
   |
   --catalog
Variable Summary
Method Summary
 catalog catalog ([mixed $catalogitems = false])
 void additem (object $catitem)
 mixed get_catalogitem_by_filepath (string $filepath)
 string html ()
 integer itemcount ()
 void search ([string $keywords = ""], [array $mimecats = ""], [array $categories = ""], [strong $sortby = ""])
 void set_categories (mixed $categories, array $cats)
Variables
mixed $catalogitems = array() (line 521)

The array of catalogitem objects in this catalog

mixed $categories = array() (line 523)

The array of categories (optional)

Methods
Constructor catalog (line 526)

Constructor

catalog catalog ([mixed $catalogitems = false])
additem (line 557)

Add catalog item to the catalog. The catalog will add the new item by cat_id. If that ID already exists it is overwritten.

void additem (object $catitem)
  • object $catitem: The catalog item to add
get_catalogitem_by_filepath (line 570)

Find a catalogitem by filepath. Just trawls the array of catalog items in this catalog comparing filepaths. Returns false if not found else a copy of the catalogitem object.

  • return: False if we didn't match a filepath, else catalog item copy.
mixed get_catalogitem_by_filepath (string $filepath)
  • string $filepath: Website URL that image is located at.
html (line 759)

Return the HTML for this catalog. Returns the list of catalog items as an HTML table.

  • return: HTML table containing the whole catalog
string html ()

Redefinition of:
RenderableObject::html()
Return output suitable for normal HTML-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to web browsers.
itemcount (line 535)

Return the count of items in the catalog currently.

  • return: Count of items in the catalog.
integer itemcount ()
search (line 592)

Perform a search for catalog items. This method will use Lucene

if it is available and keywords are provided, otherwise it will just go to the database. The end result is that this catalog is populated with the results of the search, having been cleared out beforehand.

void search ([string $keywords = ""], [array $mimecats = ""], [array $categories = ""], [strong $sortby = ""])
  • string $keywords: Keywords to search for
  • array $mimecats: Array of content types (mime categories)
  • array $categories: Array of media user-categories
  • strong $sortby: Sort order for results
set_categories (line 546)

Define the list of user categories which is used to categorise the catalog items in this catalog. This is submitted as an associative array with a single word string as key, and a multi-word string as the value (category description).

void set_categories (mixed $categories, array $cats)
  • array $cats: Array of catalog categories: ID => description

Inherited Methods

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3