Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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

## Public Member Functions
| __construct ( $id="")
| store ()
| get ( $id="")
| delete ()
| id ()
& | name ()
& | intro ()
& | url ()
& | publishingDate ()
& | originalPublishingDate ()
| origin ()
| keywords ()
| isPublished ()
| setName ( $value)
| setIntro ( $value)
| setURL ( $value)
| setOrigin ( $value)
| setKeyWords ( $value)
| setOriginalPublishingDate ( $time)
| setIsPublished ( $value)
| categories ()
| removeFromCategories ()
| existsInCategory ( $category)
& | search ( $queryText, $fetchNonPublished=false, $offset=0, $limit=20)
& | searchCount ( $queryText, $fetchNonPublished=false)
| newsList ( $sortMode=time, $fetchNonPublished=false, $offset=0, $limit=25)

## Public Attributes
| $ID
| $Name
| $Intro
| $PublishingDate
| $OriginalPublishingDate
| $IsPublished
| $KeyWords
| $Origin
| $URL

## Detailed Description

! eZNewsFeed eZNews handles news items in the database.

Example code:

$news = new eZNews( );
$news->setName( "Exponential Basic released" );
$news->setIntro( "Is publish is a ....." );
$news->setIsPublished( true );
$news->setKeywords( "PHP GPL Object Oriented" );
$news->setOrigin( "ez.no" );
$news->setURL( "http://ez.no" );
$dateTime = new eZDateTime( 2000, 11, 13, 14, 0, 15 );
print( $dateTime->timeStamp() );
$news->setOriginalPublishingDate( $dateTime );
$news->store();
$dateTime
$dateTime
Definition: authorview.php:77
eZDateTime
Definition: ezdatetime.php:55
eZNews
Definition: eznews.php:63
$news
if( $Action=="Insert") if( $Action=="Update") if( $Action=="Delete") $news
Definition: eznewsfeed/admin/categoryedit.php:69

See also
  eZNewsCategory

TODO

Definition at line 62 of file eznews.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZNews::__construct | ( |  | $id = `""` | ) |

Constructs a new eZNews object.

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

Definition at line 70 of file eznews.php.

References $id, and $ID.

## Member Function Documentation

## ◆ categories()

eZNews::categories | ( |  | ) |

Returns the categrories an news is assigned to.

The categories are returned as an array of eZNewsCategory objects.

Definition at line 404 of file eznews.php.

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

## ◆ delete()

eZNews::delete | ( |  | ) |

Deletes a eZNews object from the database.

Definition at line 219 of file eznews.php.

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

## ◆ existsInCategory()

eZNews::existsInCategory | ( |  | $category | ) |

Returns true if the product is assigned to the category given as argument. False if not.

Definition at line 437 of file eznews.php.

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

## ◆ get()

eZNews::get | ( |  | $id = `""` | ) |

Fetches the object information from the database.

Definition at line 186 of file eznews.php.

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

## ◆ id()

eZNews::id | ( |  | ) |

Returns the object ID.

Definition at line 243 of file eznews.php.

References $ID.

## ◆ intro()

& eZNews::intro | ( |  | ) |

Returns the news contents.

Definition at line 259 of file eznews.php.

References $Intro.

## ◆ isPublished()

eZNews::isPublished | ( |  | ) |

Returns true if the news is published false if not.

Definition at line 317 of file eznews.php.

References $ret.

## ◆ keywords()

eZNews::keywords | ( |  | ) |

Returns the keywords of an news.

Definition at line 309 of file eznews.php.

References $KeyWords.

## ◆ name()

& eZNews::name | ( |  | ) |

Returns the news name / title.

Definition at line 251 of file eznews.php.

References Name.

## ◆ newsList()

eZNews::newsList | ( |  | $sortMode = `time`,
|  |  | $fetchNonPublished = `false`,
|  |  | $offset = `0`,
|  |  | $limit = `25`
| ) |  |

Returns every news in every category sorted by time.

Definition at line 530 of file eznews.php.

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

## ◆ origin()

eZNews::origin | ( |  | ) |

Returns the origin of the news.

Definition at line 301 of file eznews.php.

References $Origin.

## ◆ originalPublishingDate()

& eZNews::originalPublishingDate | ( |  | ) |

Returns the original publishing time of the news.

The time is returned as a eZDateTime object.

Definition at line 290 of file eznews.php.

References $dateTime.

## ◆ publishingDate()

& eZNews::publishingDate | ( |  | ) |

Returns the publishing time of the news.

The time is returned as a eZDateTime object.

Definition at line 277 of file eznews.php.

References $dateTime.

## ◆ removeFromCategories()

eZNews::removeFromCategories | ( |  | ) |

Removes every category assignments from the current news.

Definition at line 422 of file eznews.php.

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

## ◆ search()

& eZNews::search | ( |  | $queryText,
|  |  | $fetchNonPublished = `false`,
|  |  | $offset = `0`,
|  |  | $limit = `20`
| ) |  |

Does a search in the news archive and returns the result as an array of eZNews objects.

Definition at line 460 of file eznews.php.

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

## ◆ searchCount()

& eZNews::searchCount | ( |  | $queryText,
|  |  | $fetchNonPublished = `false`
| ) |  |

Does a search in the news archive and returns the number of hits.

Definition at line 497 of file eznews.php.

References $db, and eZDB\globalDatabase().

## ◆ setIntro()

eZNews::setIntro | ( |  | $value | ) |

Sets the intro of the news.

Definition at line 339 of file eznews.php.

## ◆ setIsPublished()

eZNews::setIsPublished | ( |  | $value | ) |

Sets the news to published or not.

Definition at line 386 of file eznews.php.

## ◆ setKeyWords()

eZNews::setKeyWords | ( |  | $value | ) |

Sets the keywords of the article.

Definition at line 364 of file eznews.php.

## ◆ setName()

eZNews::setName | ( |  | $value | ) |

Sets the news name.

Definition at line 331 of file eznews.php.

References Name.

## ◆ setOrigin()

eZNews::setOrigin | ( |  | $value | ) |

Sets the origin of the news.

Definition at line 355 of file eznews.php.

## ◆ setOriginalPublishingDate()

eZNews::setOriginalPublishingDate | ( |  | $time | ) |

Sets the original publishing date.

It takes an eZDateTime object as argument.

Definition at line 374 of file eznews.php.

References $time.

## ◆ setURL()

eZNews::setURL | ( |  | $value | ) |

Sets the url to the news.

Definition at line 347 of file eznews.php.

## ◆ store()

eZNews::store | ( |  | ) |

Stores a news to the database. This function will not store two similar news items to the database. If a news with the same title, description and url are already stored the news is skipped.

Definition at line 86 of file eznews.php.

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

## ◆ url()

& eZNews::url | ( |  | ) |

Returns the url to the news.

Definition at line 267 of file eznews.php.

References $URL.

## Member Data Documentation

## ◆ $ID

eZNews::$ID

Definition at line 582 of file eznews.php.

Referenced by __construct(), and id().

## ◆ $Intro

eZNews::$Intro

Definition at line 584 of file eznews.php.

Referenced by intro().

## ◆ $IsPublished

eZNews::$IsPublished

Definition at line 587 of file eznews.php.

## ◆ $KeyWords

eZNews::$KeyWords

Definition at line 588 of file eznews.php.

Referenced by keywords().

## ◆ $Name

eZNews::$Name

Definition at line 583 of file eznews.php.

## ◆ $Origin

eZNews::$Origin

Definition at line 589 of file eznews.php.

Referenced by origin().

## ◆ $OriginalPublishingDate

eZNews::$OriginalPublishingDate

Definition at line 586 of file eznews.php.

## ◆ $PublishingDate

eZNews::$PublishingDate

Definition at line 585 of file eznews.php.

## ◆ $URL

eZNews::$URL

Definition at line 590 of file eznews.php.

Referenced by url().

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

- eznews.php

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