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
eZArticleCategory Class Reference

## Public Member Functions
| __construct ( $id=-1)
| store ()
| delete ( $catID=-1)
| get ( $id=-1)
| fill ( $category_array)
| getAll ()
| getByParent ( $parent, $showAll=false, $sortby='placement', $offset=0, $max=-1, $user=false, $check_write=false)
| countByParent ( $parent, $showAll=false, $user=false, $check_write=false)
| path ( $categoryID=0)
| getTree ( $parentID=0, $level=0)
| copyTree ( $parentID, $parentCategory)
& | image ( $AsObject=true)
| sectionID ()
| id ()
| name ( $asHTML=true)
| description ( $asHTML=true)
| listLimit ()
| placement ()
| parent ( $as_object=true)
| editorGroup ( $as_object=true)
| owner ( $as_object=true)
| isOwner ( $user, $categoryID)
| sortMode ( $return_id=false)
| excludeFromSearch ()
| setName ( $value)
| setListLimit ( $value)
| setPlacement ( $value)
| setSectionID ( $value)
| setImage ( $value)
| setDescription ( $value)
| setParent ( $value)
| setEditorGroup ( $value)
| setOwner ( $value)
| setSortMode ( $value)
| setExcludeFromSearch ( $value)
| userHasPermision ( $categoryID=-1, $read=true, $write=true, $user=false)
& | articles ( $sortMode="time", $fetchAll=true, $fetchPublished=true, $offset=0, $limit=50, $categoryID=0, $check_write=false)
| articleCount ( $fetchAll=true, $fetchPublished=true, $check_write=false)
| moveUp ( $id)
| moveDown ( $id)
| moveCategoryUp ()
| moveCategoryDown ()
| setBulkMailCategory ( $value)
| bulkMailCategory ( $asObject=true)

## Static Public Member Functions
& | getByName ( $name)
& | search ( $name, $showAll=false, $sortby='placement', $user=false)
static | sectionIDStatic ($categoryID)
static | removeArticle ( $value, $categoryid=false)
static | addArticle ( $value, $categoryid=false)

## Public Attributes
| $ID
| $Name
| $ListLimit
| $ParentID
| $Description
| $ExcludeFromSearch
| $SortMode
| $OwnerID
| $Placement
| $SectionID
| $ImageID
| $EditorGroupID

## Detailed Description

! eZArticle eZArticleCategory handles article categories.

TODO Implement activeArticles();

Definition at line 44 of file ezarticlecategory.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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

Constructs a new eZArticleCategory object.

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

Definition at line 52 of file ezarticlecategory.php.

References $ID, $id, and fill().

## Member Function Documentation

## ◆ addArticle()

static eZArticleCategory::addArticle | ( |  | $value,
|  |  | $categoryid = `false`
| ) |  |
| static

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

Definition at line 1079 of file ezarticlecategory.php.

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

## ◆ articleCount()

eZArticleCategory::articleCount | ( |  | $fetchAll = `true`,
|  |  | $fetchPublished = `true`,
|  |  | $check_write = `false`
| ) |  |

Returns the total number of articles in the current category.

If $fetchAll is set to true, both published and unpublished articles will be counted. If it is set to false, then $fetchPublished will determine: If $fetchPublished is set to true then only published articles will be counted. If it is false, then only non-published articles will be counted.

If $check_write is true then the result will only contain articles which has read AND write permissions.

Definition at line 1371 of file ezarticlecategory.php.

References $currentUserID, $db, $group, $groups, $query, $user, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ articles()

& eZArticleCategory::articles | ( |  | $sortMode = `"time"`,
|  |  | $fetchAll = `true`,
|  |  | $fetchPublished = `true`,
|  |  | $offset = `0`,
|  |  | $limit = `50`,
|  |  | $categoryID = `0`,
|  |  | $check_write = `false`
| ) |  |

Returns every article in a category as a array of eZArticle objects.

If $fetchAll is set to true, both published and unpublished articles will be returned. If it is set to false, then $fetchPublished will determine: If $fetchPublished iss set to true then only published articles will be returned. If it is false, then only non-published articles will be returned.

If $check_write is true then the result will only contain articles which has read AND write permissions.

Definition at line 1167 of file ezarticlecategory.php.

References $categoryID, $currentUserID, $db, $group, $groups, $i, $ID, $limit, $offset, $OrderBy, $query, $user, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ bulkMailCategory()

eZArticleCategory::bulkMailCategory | ( |  | $asObject = `true` | ) |

Returns the bulkMailCategory this category is connected to.

Definition at line 1646 of file ezarticlecategory.php.

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

## ◆ copyTree()

eZArticleCategory::copyTree | ( |  | $parentID,
|  |  | $parentCategory
| ) |  |

Copies the categories recursively

Definition at line 622 of file ezarticlecategory.php.

References $category, $categoryList, $level, $tree, eZUser\currentUser(), and eZObjectPermission\setPermission().

## ◆ countByParent()

eZArticleCategory::countByParent | ( |  | $parent,
|  |  | $showAll = `false`,
|  |  | $user = `false`,
|  |  | $check_write = `false`
| ) |  |

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 eZArticleCategory objects. If $user is not a eZUser object the current user is used.

If $check_write is true then the result will only count categories which has read AND write permissions.

Definition at line 476 of file ezarticlecategory.php.

References $category_array, $currentUserID, $db, $group, $groups, $i, $query, $user, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ delete()

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

Deletes a eZArticleGroup object from the database.

Definition at line 138 of file ezarticlecategory.php.

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

## ◆ description()

eZArticleCategory::description | ( |  | $asHTML = `true` | ) |

Returns the group description.

Definition at line 728 of file ezarticlecategory.php.

References $Description, and eZTextTool\fixhtmlentities().

## ◆ editorGroup()

eZArticleCategory::editorGroup | ( |  | $as_object = `true` | ) |

Returns the editor group if one exist. If not 0 is returned.

Definition at line 787 of file ezarticlecategory.php.

References $EditorGroupID.

## ◆ excludeFromSearch()

eZArticleCategory::excludeFromSearch | ( |  | ) |

Returns true if the category is to be excluded from search, false if not.

Definition at line 904 of file ezarticlecategory.php.

References $ret.

## ◆ fill()

eZArticleCategory::fill | ( |  | $category_array | ) |

Definition at line 211 of file ezarticlecategory.php.

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

Referenced by __construct(), and get().

## ◆ get()

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

Fetches the object information from the database.

Definition at line 176 of file ezarticlecategory.php.

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

## ◆ getAll()

eZArticleCategory::getAll | ( |  | ) |

Returns all the categories found in the database.

The categories are returned as an array of eZArticleCategory objects.

Definition at line 233 of file ezarticlecategory.php.

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

## ◆ getByName()

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

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

Returns an object of eZArticleCategory.

Definition at line 255 of file ezarticlecategory.php.

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

## ◆ getByParent()

eZArticleCategory::getByParent | ( |  | $parent,
|  |  | $showAll = `false`,
|  |  | $sortby = `'placement'`,
|  |  | $offset = `0`,
|  |  | $max = `-1`,
|  |  | $user = `false`,
|  |  | $check_write = `false`
| ) |  |

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 eZArticleCategory objects. If $check_write is true then the result will only contain categories which has read AND write permissions.

Definition at line 373 of file ezarticlecategory.php.

References $category_array, $currentUserID, $db, $group, $groups, $i, $offset, $query, $user, eZUser\currentUser(), and eZDB\globalDatabase().

Referenced by categoryTree().

## ◆ getTree()

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

FIXME: Look at the tree function in (productcategory??!??) Recursive function that returns an array containing an int (tree position) and an array ( all items on that level )

Definition at line 596 of file ezarticlecategory.php.

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

## ◆ id()

eZArticleCategory::id | ( |  | ) |

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

Definition at line 704 of file ezarticlecategory.php.

References $ID.

Referenced by userHasPermision().

## ◆ image()

& eZArticleCategory::image | ( |  | $AsObject = `true` | ) |

Returns the Image ID.

Definition at line 683 of file ezarticlecategory.php.

References $image, and $ImageID.

## ◆ isOwner()

eZArticleCategory::isOwner | ( |  | $user,
|  |  | $categoryID
| ) |  |

\Static Returns true if the given user is the author of the given object. $user is of type eZUser. $categoryID is the categoryID.

Definition at line 825 of file ezarticlecategory.php.

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

## ◆ listLimit()

eZArticleCategory::listLimit | ( |  | ) |

Returns the limit of article in list in this category

Definition at line 744 of file ezarticlecategory.php.

References $ListLimit.

## ◆ moveCategoryDown()

eZArticleCategory::moveCategoryDown | ( |  | ) |

Moves the article category with the given ID down.

Definition at line 1590 of file ezarticlecategory.php.

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

## ◆ moveCategoryUp()

eZArticleCategory::moveCategoryUp | ( |  | ) |

Moves the article category with the given ID down.

Definition at line 1548 of file ezarticlecategory.php.

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

## ◆ moveDown()

eZArticleCategory::moveDown | ( |  | $id | ) |

Moves the article placement with the given ID down.

Definition at line 1514 of file ezarticlecategory.php.

References $db, and eZDB\globalDatabase().

## ◆ moveUp()

eZArticleCategory::moveUp | ( |  | $id | ) |

Moves the article placement with the given ID up.

Definition at line 1479 of file ezarticlecategory.php.

References $db, and eZDB\globalDatabase().

## ◆ name()

eZArticleCategory::name | ( |  | $asHTML = `true` | ) |

Returns the name of the category.

Definition at line 712 of file ezarticlecategory.php.

References $Name, eZTextTool\fixhtmlentities(), and Name.

## ◆ owner()

eZArticleCategory::owner | ( |  | $as_object = `true` | ) |

Returns the creator of this category. Returns only the ID if given parameter is false.

Definition at line 804 of file ezarticlecategory.php.

References $OwnerID.

## ◆ parent()

eZArticleCategory::parent | ( |  | $as_object = `true` | ) |

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

Definition at line 770 of file ezarticlecategory.php.

References $ParentID.

## ◆ path()

eZArticleCategory::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 564 of file ezarticlecategory.php.

References $category, $categoryID, and $ID.

## ◆ placement()

eZArticleCategory::placement | ( |  | ) |

Returns the placement.

Definition at line 757 of file ezarticlecategory.php.

## ◆ removeArticle()

static eZArticleCategory::removeArticle | ( |  | $value,
|  |  | $categoryid = `false`
| ) |  |
| static

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

Definition at line 1052 of file ezarticlecategory.php.

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

## ◆ search()

& eZArticleCategory::search | ( |  | $name,
|  |  | $showAll = `false`,
|  |  | $sortby = `'placement'`,
|  |  | $user = `false`
| ) |  |
| static

Searches for a category called $name, if $name is empty all categories are returned, if $name is an array it will search for categories matching any of the names in the array.

Returns an array of eZArticleCategory.

Definition at line 282 of file ezarticlecategory.php.

References $author, $currentUserID, $db, $group, $groups, $i, $name, $search, $topic, $user, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ sectionID()

eZArticleCategory::sectionID | ( |  | ) |

Returns the Section ID. Returns false if the Category was not found.

Definition at line 696 of file ezarticlecategory.php.

References $SectionID.

## ◆ sectionIDStatic()

static eZArticleCategory::sectionIDStatic | ( |  | $categoryID | ) |
| static

Returns the Section ID. Returns false if the Category was not found.

Definition at line 662 of file ezarticlecategory.php.

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

Referenced by categoryTree().

## ◆ setBulkMailCategory()

eZArticleCategory::setBulkMailCategory | ( |  | $value | ) |

Connects this category to the bulkmail category specified.

Definition at line 1631 of file ezarticlecategory.php.

References $db, and eZDB\globalDatabase().

## ◆ setDescription()

eZArticleCategory::setDescription | ( |  | $value | ) |

Sets the description of the category.

Definition at line 963 of file ezarticlecategory.php.

## ◆ setEditorGroup()

eZArticleCategory::setEditorGroup | ( |  | $value | ) |

Sets the editor group.

Definition at line 988 of file ezarticlecategory.php.

## ◆ setExcludeFromSearch()

eZArticleCategory::setExcludeFromSearch | ( |  | $value | ) |

Sets the exclude from search bit. The argumen can be true or false.

Definition at line 1035 of file ezarticlecategory.php.

## ◆ setImage()

eZArticleCategory::setImage | ( |  | $value | ) |

Sets the image of the category.

Definition at line 952 of file ezarticlecategory.php.

## ◆ setListLimit()

eZArticleCategory::setListLimit | ( |  | $value | ) |

Sets the limit of article per page in this category

Definition at line 928 of file ezarticlecategory.php.

## ◆ setName()

eZArticleCategory::setName | ( |  | $value | ) |

Sets the name of the category.

Definition at line 920 of file ezarticlecategory.php.

References Name.

## ◆ setOwner()

eZArticleCategory::setOwner | ( |  | $value | ) |

Sets the owner of this category.

Definition at line 1005 of file ezarticlecategory.php.

## ◆ setParent()

eZArticleCategory::setParent | ( |  | $value | ) |

Sets the parent category.

Definition at line 971 of file ezarticlecategory.php.

## ◆ setPlacement()

eZArticleCategory::setPlacement | ( |  | $value | ) |

Sets the placement of the category.

Definition at line 936 of file ezarticlecategory.php.

## ◆ setSectionID()

eZArticleCategory::setSectionID | ( |  | $value | ) |

Sets the section of the category.

Definition at line 944 of file ezarticlecategory.php.

## ◆ setSortMode()

eZArticleCategory::setSortMode | ( |  | $value | ) |

Sets the sort mode.

1 - publishing date 2 - alphabetic 3 - alphabetic desc 3 - absolute placement

Definition at line 1026 of file ezarticlecategory.php.

## ◆ sortMode()

eZArticleCategory::sortMode | ( |  | $return_id = `false` | ) |

Returns the sort mode.

1 - publishing date 2 - alphabetic 3 - alphabetic desc 4 - absolute placement 5 - modification date

Definition at line 853 of file ezarticlecategory.php.

References $SortMode.

## ◆ store()

eZArticleCategory::store | ( |  | ) |

Stores a eZArticleCategory object to the database.

Definition at line 74 of file ezarticlecategory.php.

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

## ◆ userHasPermision()

eZArticleCategory::userHasPermision | ( |  | $categoryID = `-1`,
|  |  | $read = `true`,
|  |  | $write = `true`,
|  |  | $user = `false`
| ) |  |

Checks whether user has permission to this category

Definition at line 1130 of file ezarticlecategory.php.

References $categoryID, $user, eZObjectPermission\hasPermission(), and id().

## Member Data Documentation

## ◆ $Description

eZArticleCategory::$Description

Definition at line 1663 of file ezarticlecategory.php.

Referenced by description().

## ◆ $EditorGroupID

eZArticleCategory::$EditorGroupID

Definition at line 1670 of file ezarticlecategory.php.

Referenced by editorGroup().

## ◆ $ExcludeFromSearch

eZArticleCategory::$ExcludeFromSearch

Definition at line 1664 of file ezarticlecategory.php.

## ◆ $ID

eZArticleCategory::$ID

Definition at line 1659 of file ezarticlecategory.php.

Referenced by __construct(), addArticle(), articles(), delete(), id(), path(), and removeArticle().

## ◆ $ImageID

eZArticleCategory::$ImageID

Definition at line 1669 of file ezarticlecategory.php.

Referenced by image().

## ◆ $ListLimit

eZArticleCategory::$ListLimit

Definition at line 1661 of file ezarticlecategory.php.

Referenced by listLimit().

## ◆ $Name

eZArticleCategory::$Name

Definition at line 1660 of file ezarticlecategory.php.

Referenced by name().

## ◆ $OwnerID

eZArticleCategory::$OwnerID

Definition at line 1666 of file ezarticlecategory.php.

Referenced by owner().

## ◆ $ParentID

eZArticleCategory::$ParentID

Definition at line 1662 of file ezarticlecategory.php.

Referenced by parent().

## ◆ $Placement

eZArticleCategory::$Placement

Definition at line 1667 of file ezarticlecategory.php.

## ◆ $SectionID

eZArticleCategory::$SectionID

Definition at line 1668 of file ezarticlecategory.php.

Referenced by sectionID().

## ◆ $SortMode

eZArticleCategory::$SortMode

Definition at line 1665 of file ezarticlecategory.php.

Referenced by sortMode().

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

- ezarticlecategory.php

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