Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZNewsCategory Class Reference

## Public Member Functions
| __construct ( $id=-1)
| store ()
| delete ()
| get ( $id=-1)
| getAll ()
| getByParent ( $parent, $showAll=false, $sortby="name")
| path ( $categoryID=0)
| id ()
| name ()
| description ()
| parent ()
| setName ( $value)
| setDescription ( $value)
| setParent ( $value)
| addNews ( $value)
& | newsList ( $sortMode="time", $fetchNonPublished="no", $offset=0, $limit=50)
& | newsListCount ( $sortMode="time", $fetchNonPublished="no")

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

## Detailed Description

! eZNewsFeed eZNewsCategory handles news categories.

TODO

Definition at line 41 of file eznewscategory.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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

Constructs a new eZNewsCategory object.

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

Definition at line 49 of file eznewscategory.php.

References $id, and $ID.

## Member Function Documentation

## ◆ addNews()

eZNewsCategory::addNews | ( |  | $value | ) |

Adds a news to the category.

Definition at line 321 of file eznewscategory.php.

References $db, $ret, eZDB\finish(), and eZDB\globalDatabase().

## ◆ delete()

eZNewsCategory::delete | ( |  | ) |

Deletes a eZNewsCategory object from the database.

Definition at line 104 of file eznewscategory.php.

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

## ◆ description()

eZNewsCategory::description | ( |  | ) |

Returns the group description.

Definition at line 270 of file eznewscategory.php.

References $Description.

## ◆ get()

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

Fetches the object information from the database.

Definition at line 124 of file eznewscategory.php.

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

## ◆ getAll()

eZNewsCategory::getAll | ( |  | ) |

Returns all the categories found in the database.

The categories are returned as an array of eZNewsCategory objects.

Definition at line 150 of file eznewscategory.php.

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

## ◆ getByParent()

eZNewsCategory::getByParent | ( |  | $parent,
|  |  | $showAll = `false`,
|  |  | $sortby = `"name"`
| ) |  |

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

If $showAll is set to true every category is shown.

The categories are returned as an array of eZNewsCategory objects.

Definition at line 174 of file eznewscategory.php.

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

## ◆ id()

eZNewsCategory::id | ( |  | ) |

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

Definition at line 253 of file eznewscategory.php.

References $ID.

## ◆ name()

eZNewsCategory::name | ( |  | ) |

Returns the name of the category.

Definition at line 262 of file eznewscategory.php.

References $Name.

## ◆ newsList()

& eZNewsCategory::newsList | ( |  | $sortMode = `"time"`,
|  |  | $fetchNonPublished = `"no"`,
|  |  | $offset = `0`,
|  |  | $limit = `50`
| ) |  |

Returns every news in a category as a array of eZNews objects.

If $fetchNonPublished is set to "yes" the news which is not published is also returned.

If $fetchNonPublished is set to "no" the news which is not published is not returned.

If $fetchNonPublished is set to "only" only the news which is not published are returned.

Definition at line 354 of file eznewscategory.php.

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

## ◆ newsListCount()

& eZNewsCategory::newsListCount | ( |  | $sortMode = `"time"`,
|  |  | $fetchNonPublished = `"no"`
| ) |  |

Returns the number of news in a category.

If $fetchNonPublished is set to "yes" the news which is not published is also counted.

If $fetchNonPublished is set to "no" the news which is not published is not counted.

If $fetchNonPublished is set to "only" only the news which is not published are are.

Definition at line 442 of file eznewscategory.php.

References $db, and eZDB\globalDatabase().

## ◆ parent()

eZNewsCategory::parent | ( |  | ) |

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

Definition at line 278 of file eznewscategory.php.

## ◆ path()

eZNewsCategory::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 219 of file eznewscategory.php.

References $category, $categoryID, and $ID.

## ◆ setDescription()

eZNewsCategory::setDescription | ( |  | $value | ) |

Sets the description of the category.

Definition at line 302 of file eznewscategory.php.

## ◆ setName()

eZNewsCategory::setName | ( |  | $value | ) |

Sets the name of the category.

Definition at line 294 of file eznewscategory.php.

References Name.

## ◆ setParent()

eZNewsCategory::setParent | ( |  | $value | ) |

Sets the parent category.

Definition at line 310 of file eznewscategory.php.

## ◆ store()

eZNewsCategory::store | ( |  | ) |

Stores a eZNewsCategory object to the database.

Definition at line 63 of file eznewscategory.php.

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

## Member Data Documentation

## ◆ $Description

eZNewsCategory::$Description

Definition at line 504 of file eznewscategory.php.

Referenced by description().

## ◆ $ID

eZNewsCategory::$ID

Definition at line 501 of file eznewscategory.php.

Referenced by __construct(), id(), and path().

## ◆ $Name

eZNewsCategory::$Name

Definition at line 503 of file eznewscategory.php.

Referenced by name().

## ◆ $ParentID

eZNewsCategory::$ParentID

Definition at line 502 of file eznewscategory.php.

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

- eznewscategory.php

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