Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZMediaCategory Class Reference

## Public Member Functions
| __construct ( $id=-1)
| store ()
| delete ( $catID=-1)
| get ( $id=-1)
| getAll ()
& | getMedia (&$user, $category=false)
| countByParent (&$parent)
& | getByParent (&$parent, $offset=0, $max=-1)
| path ( $categoryID=0)
& | getTree ( $parentID=0, $level=0)
| id ()
& | name ( $html=true)
& | description ( $html=true)
& | parent ()
& | user ()
| isOwner (&$user, &$mediacategory)
| setName (&$value)
| setDescription (&$value)
| setParent (&$value)
| setUser (&$user)
| mediaCount ()
& | media ( $sortMode="time", $offset=0, $limit=-1)

## Static Public Member Functions
& | getByName (&$name)
| addMedia (&$value, $categoryid=false)
| removeMedia (&$value, $categoryid=false)

## Public Attributes
| $ID
| $Name
| $ParentID
| $Description
| $UserID
| $ExcludeFromSearch

## Detailed Description

! eZMediaCatalogue eZMediaCategory manages virtual folders.

Example code:

// create a new country type and set some variables.
$category = new eZMediaAttribute();
$category->setName( "My media files" );
$category->setDescription( "Just some media files" );
$category->setParent( $parentCategory );
$category->setUser( $user );
$category->store();
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
eZMediaAttribute
Definition: ezmediaattribute.php:49
$user
$user
Definition: user/adlist.php:39

See also
  eZMedia eZMediaType eZMediaAttribute

TODO

Definition at line 54 of file ezmediacategory.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZMediaCategory::__construct | ( |  | $id = `-1` | ) |

Constructs a new eZMediaCategory object.

If $id is set the object's values are fetched from the database.

Definition at line 62 of file ezmediacategory.php.

References $id, and $ID.

## Member Function Documentation

## ◆ addMedia()

eZMediaCategory::addMedia | ( | & | $value,
|  |  | $categoryid = `false`
| ) |  |
| static

Adds a file to the category. Can be used as a static function if $categoryid is supplied

Definition at line 504 of file ezmediacategory.php.

References $db, $ID, $query, $res, and eZDB\globalDatabase().

Referenced by syncDir().

## ◆ countByParent()

eZMediaCategory::countByParent | ( | & | $parent | ) |

Returns the number of categories in the the category given as parameter as parent.

Definition at line 230 of file ezmediacategory.php.

References $count, $db, and eZDB\globalDatabase().

## ◆ delete()

eZMediaCategory::delete | ( |  | $catID = `-1` | ) |

Deletes a eZMediaCategory object from the database.

Definition at line 117 of file ezmediacategory.php.

References $category, $categoryID, $categoryList, $db, $ID, $media, eZDB\globalDatabase(), and media().

## ◆ description()

& eZMediaCategory::description | ( |  | $html = `true` | ) |

Returns the group description.

Definition at line 399 of file ezmediacategory.php.

References $Description.

## ◆ get()

eZMediaCategory::get | ( |  | $id = `-1` | ) |

Fetches the object information from the database.

Definition at line 156 of file ezmediacategory.php.

References $category_array, $db, $id, eZDB\globalDatabase(), and Name.

## ◆ getAll()

eZMediaCategory::getAll | ( |  | ) |

Returns all the categories found in the database.

The categories are returned as an array of eZMediaCategory objects.

Definition at line 183 of file ezmediacategory.php.

References $category_array, $db, $i, and eZDB\globalDatabase().

## ◆ getByName()

& eZMediaCategory::getByName | ( | & | $name | ) |
| static

Returns the one, and only if one exists, category with the name

Returns an object of eZMediaCategory.

Definition at line 292 of file ezmediacategory.php.

References $db, $name, $topic, and eZDB\globalDatabase().

## ◆ getByParent()

& eZMediaCategory::getByParent | ( | & | $parent,
|  |  | $offset = `0`,
|  |  | $max = `-1`
| ) |  |

Returns the categories with the category given as parameter as parent.

If $showAll is set to true every category is shown. By default the categories set as exclude from search is excluded from this query.

The categories are returned as an array of eZMediaCategory objects.

Definition at line 257 of file ezmediacategory.php.

References $category_array, $db, $i, $offset, and eZDB\globalDatabase().

## ◆ getMedia()

& eZMediaCategory::getMedia | ( | & | $user,
|  |  | $category = `false`
| ) |  |

\Static Returns all media in a category

Definition at line 204 of file ezmediacategory.php.

References $category, $db, $i, $ID, $media, $user, and eZDB\globalDatabase().

## ◆ getTree()

& eZMediaCategory::getTree | ( |  | $parentID = `0`,
|  |  | $level = `0`
| ) |  |

Recursive function that returns an array containing an int (tree position) and an array ( all items on that level )

Definition at line 352 of file ezmediacategory.php.

References $category, $categoryList, $level, and $tree.

## ◆ id()

eZMediaCategory::id | ( |  | ) |

Returns the object ID to the category. This is the unique ID stored in the database.

Definition at line 378 of file ezmediacategory.php.

References $ID.

## ◆ isOwner()

eZMediaCategory::isOwner | ( | & | $user,
|  | & | $mediacategory
| ) |  |

\Static Returns true if the given user is the owner of the given object. $user is either a userID or an eZUser. $mediacategory is the ID of the media category.

Definition at line 444 of file ezmediacategory.php.

References $db, $res, $user, $userID, and eZDB\globalDatabase().

## ◆ media()

& eZMediaCategory::media | ( |  | $sortMode = `"time"`,
|  |  | $offset = `0`,
|  |  | $limit = `-1`
| ) |  |

Returns every media in a category as a array of eZMedia objects.

Definition at line 605 of file ezmediacategory.php.

References $db, $i, $limit, $offset, and eZDB\globalDatabase().

Referenced by delete().

## ◆ mediaCount()

eZMediaCategory::mediaCount | ( |  | ) |

Returns every media in a category as a array of eZMedia objects.

Definition at line 579 of file ezmediacategory.php.

References $count, $db, $ini, $limit, and eZDB\globalDatabase().

## ◆ name()

& eZMediaCategory::name | ( |  | $html = `true` | ) |

Returns the name of the category.

Definition at line 387 of file ezmediacategory.php.

References $Name, and Name.

## ◆ parent()

& eZMediaCategory::parent | ( |  | ) |

Returns the parent if one exist. If not 0 is returned.

Definition at line 412 of file ezmediacategory.php.

## ◆ path()

eZMediaCategory::path | ( |  | $categoryID = `0` | ) |

Returns the current path as an array of arrays.

The array is built up like: array( array( id, name ), array( id, name ) );

See detailed description for an example of usage.

Definition at line 321 of file ezmediacategory.php.

References $category, $categoryID, and $ID.

## ◆ removeMedia()

eZMediaCategory::removeMedia | ( | & | $value,
|  |  | $categoryid = `false`
| ) |  |
| static

Removes an media from the category. Can be used as a static function if $categoryid is supplied

Definition at line 548 of file ezmediacategory.php.

References $db, $ID, $query, $res, and eZDB\globalDatabase().

## ◆ setDescription()

eZMediaCategory::setDescription | ( | & | $value | ) |

Sets the description of the category.

Definition at line 470 of file ezmediacategory.php.

## ◆ setName()

eZMediaCategory::setName | ( | & | $value | ) |

Sets the name of the category.

Definition at line 462 of file ezmediacategory.php.

References Name.

## ◆ setParent()

eZMediaCategory::setParent | ( | & | $value | ) |

Sets the parent category.

Definition at line 478 of file ezmediacategory.php.

## ◆ setUser()

eZMediaCategory::setUser | ( | & | $user | ) |

Sets the user of the file.

Definition at line 489 of file ezmediacategory.php.

References $user, and $userID.

## ◆ store()

eZMediaCategory::store | ( |  | ) |

Stores a eZMediaCategory object to the database.

Definition at line 75 of file ezmediacategory.php.

References $db, $name, eZDB\globalDatabase(), and Name.

## ◆ user()

& eZMediaCategory::user | ( |  | ) |

Returns a eZUser object.

Definition at line 428 of file ezmediacategory.php.

References $ret.

## Member Data Documentation

## ◆ $Description

eZMediaCategory::$Description

Definition at line 636 of file ezmediacategory.php.

Referenced by description().

## ◆ $ExcludeFromSearch

eZMediaCategory::$ExcludeFromSearch

Definition at line 638 of file ezmediacategory.php.

## ◆ $ID

eZMediaCategory::$ID

Definition at line 633 of file ezmediacategory.php.

Referenced by __construct(), addMedia(), delete(), getMedia(), id(), path(), and removeMedia().

## ◆ $Name

eZMediaCategory::$Name

Definition at line 634 of file ezmediacategory.php.

Referenced by name().

## ◆ $ParentID

eZMediaCategory::$ParentID

Definition at line 635 of file ezmediacategory.php.

## ◆ $UserID

eZMediaCategory::$UserID

Definition at line 637 of file ezmediacategory.php.

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

- ezmediacategory.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.