Class catalogitem

Description

A class which encpasulates an item which can be in the catalog.

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

RenderableObject
   |
   --catalogitem
Variable Summary
 mixed $category
 mixed $cat_desc
 mixed $cat_id
 mixed $cat_name
 mixed $errmsg
 mixed $fileexists
 mixed $filepath
 mixed $filesize
 mixed $height
 mixed $keywords
 mixed $mime_type
 mixed $newcat
 mixed $uploaded
 mixed $uploaded_ts
 mixed $valid
 mixed $width
Method Summary
 catalogitem catalogitem ([integer $id = false])
 void AsIcon ([mixed $showcontrols = false], [boolean $autostart = false], [mixed $loop = false])
 void AsLink ()
 boolean create (string $srcpath, string $destpath, string $filepath, [string $mimetype = ""], mixed $width, mixed $height, [string $name = ""], [string $category = ""], [string $desc = ""], [string $keywords = ""])
 boolean delete ([boolean $deletefile = true])
 void get ([integer $id = false])
 string html ([string $mode = "link"])
 void index ()
 void Insitu ([mixed $showcontrols = false], [boolean $autostart = false], [mixed $loop = false])
 void save ()
 void unindex ()
 array upload ([string $name = ""], [string $category = ""], [string $desc = ""], [string $keywords = ""])
Variables
mixed $category = "" (line 45)
mixed $cat_desc = "" (line 41)
mixed $cat_id (line 39)
mixed $cat_name = "" (line 40)
mixed $errmsg = "" (line 54)
mixed $fileexists = false (line 49)
mixed $filepath = "" (line 47)
mixed $filesize = "" (line 46)
mixed $height = 0 (line 51)
mixed $keywords = "" (line 44)
mixed $mime_category = "" (line 43)
mixed $mime_type = "" (line 42)
mixed $newcat = false (line 56)
mixed $physicalpath = "" (line 48)
mixed $uploaded = "" (line 53)
mixed $uploaded_ts = 0 (line 52)
mixed $valid = false (line 55)
mixed $width = 0 (line 50)
Methods
Constructor catalogitem (line 62)

Constructor

catalogitem catalogitem ([integer $id = false])
  • integer $id: Optional unique catalog item ID
AsIcon (line 239)

Return the catalog item as a clickable icon.

void AsIcon ([mixed $showcontrols = false], [boolean $autostart = false], [mixed $loop = false])
  • boolean $autostart: Movies etc. if true start automatically
AsLink (line 314)

Return the catalog item as a clickable hyperlink.

void AsLink ()
create (line 337)

Create this catalog item from a media file on disk. The media item should be located at a physical path on disk somewhere. It will be grabbed, moved to a new location, and the item record saved to the DB.

NOTE: this may be an existing catalogitem, OR a newly created one. This is not determined by this routine, but must be set up before calling this method. The save() method then does whatever is necessary.

  • return: True if all ok, else false
boolean create (string $srcpath, string $destpath, string $filepath, [string $mimetype = ""], mixed $width, mixed $height, [string $name = ""], [string $category = ""], [string $desc = ""], [string $keywords = ""])
  • string $srcpath: The full physical filesystem path to the source media
  • string $destpath: The full physical path of where to move the media
  • string $filepath: The relative path of the media, to save on DB record
  • string $mimetype: The mime type of the file, eg: "image/jpeg"
  • string $name: Media file associated name
  • string $category: Media file associated category
  • string $desc: Media file full description
  • string $keywords: Media file associated keywords
delete (line 163)

Remove the catalog item from the database and disk. This method normally tries to remove the physical file first, and if that succeeds it removes the database record. If $deletefile is false then the file will be left and only the DB record deleted.

  • return: True if the operation succeeded, else false.
boolean delete ([boolean $deletefile = true])
  • boolean $deletefile: If true the physical file will be deleted
get (line 80)

Get current or nominated catalog item definition from the database.

void get ([integer $id = false])
  • integer $id: Optional unique catalog item ID to get
html (line 496)

Render the catalog item. We render it as either and icon or a link, both being clickable to view the content.

  • return: HTML rendering of this catalog item in given mode
string html ([string $mode = "link"])
  • string $mode: Mode of rendering: 'icon' or 'link'.

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.
index (line 199)

Index this catalog item to Lucene.

If it exists already, index entry for this item is replaced.

void index ()
Insitu (line 282)

Return the catalog item as image, a clickable icon, or otherwise a link.

void Insitu ([mixed $showcontrols = false], [boolean $autostart = false], [mixed $loop = false])
  • boolean $autostart: Movies etc. if true start automatically
save (line 116)

Save current catalog item definition to the database. Inserts if brand new, else performs an update.

void save ()
unindex (line 227)

Remove this catalog item from the Lucene index.

void unindex ()
upload (line 415)

Process an uploaded media file, and define this catalog item to be

the newly uploaded file. Assuming a valid upload is performed, this catalog item will be added to the database, and the file stahsed in the media directory. This method is provided to allow for easy handling of upload form submission particularly for the Axyl media catalog. Ie. use this if you have a form which is just for uploading new images, movies etc. to the Axyl catalog.

  • return: Error messages, if any occurred
array upload ([string $name = ""], [string $category = ""], [string $desc = ""], [string $keywords = ""])
  • string $name: Media file associated name
  • string $category: Media file associated category
  • string $desc: Media file full description
  • string $keywords: Media file associated keywords

Inherited Methods

Inherited From RenderableObject

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

Documentation generated by phpDocumentor 1.3.0RC3