Homepage of www.easymagazine.net | Wem site map of www.easymagazine.net | Email the author of www.easymagazine.net

 

The Datamodel: Category

This class is an implementation of the active record pattern and has been created in order to simplify the access to the "Category" table.
Each Category can have many Article(s).

Accessible methods:

  • public function getId():
  • return the id of the Category instance.
  • public static function findById($id):
  • return a Category querying the database.
  • public static function findInAllTextFields($string):
  • return an array of Categories containing at least a field matching the string $string.
  • public static function findUpIndexNumber():
  • return an Category that is just the next considering the order gived by the field "indexnumber".
  • public static function findDownIndexNumber():
  • return an Category that is just the previous considering the order gived by the field "indexnumber".
  • public static function findByTitle($title):
  • return an array of Categories containing a Title matching the string $title.
  • public static function findAll():
  • return an array of all Categories contained in the database.
  • public static function findAllOrderedByIndexNumber():
  • return an array of all Categories contained in the database ordered by the field indexnumber in descending order. This order match the order gived by the publisher in the administration panel.
  • public static function findAllPublishedOrderedByIndexNumber():
  • return an array of all Categories contained in the database ordered by the field indexnumber in descending order whit the flag "published" setted to true.
  • public static function findAllNotPublishedOrderedByIndexNumber():
  • return an array of all Categories contained in the database ordered by the field indexnumber in descending order having the flag "published" setted to false.
  • public function artilclesPublished():
  • return a list of Article(s), related the Category instance having the flag published equal to true.
  • public function articles():
  • return a list of Article(s) related the the Category instance.
  • public function save():
  • save the courrent instance.
  • public function delete():
  • delete from the database the courrent instance and reset all the instance fields.
  • protected function insert():
  • insert a new instance in the database.
  • protected function update():
  • update the courrent instance in the corresponding database record
  • public function getMaxIndexNumber():
  • return an Integer value containing the bigger indexnumber field in the table "Category".
  • public function getMaxId():
  • return an Integer value containing the bigger id field in the table "Category".
  • public function getIndexnumber():
  • return the number that defines the order of the Categories for the published website.
  • public function setIndexnumber($indexnumber):
  • set the number that defines the order of the Categories for the published website.
  • public function getName():
  • return the Name of the Category instance.
  • public function setName($name):
  • set the Name of the instance of the Category.
  • public function getDescription():
  • return the Description of the Category instance, filtered by the filters definited in the plugins activated.
  • public function getUnfilteredDescription():
  • return the Description of the Category instance, unfiltered.
  • public function setDescription($body):
  • set the Description of the instance of the Category.
  • public function getPublished():
  • return the content of the flag published in the Category instance.
  • public function setPublished($published):
  • set the flag published.
  • public function getCreated():
  • return the Creation date of the Category instance.
  • public function setCreated($created):
  • set the Creation date of the instance of the Category.
  • public function getUpdated():
  • return the Update date of the Category instance.
  • public function setUpdated($updated):
  • set the Update date of the instance of the Category.

 


Copyright © 2009, 2010, 2011 Fabio Mattei, designed by zuudesign.sk