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

 

The Datamodel: Option

This class is an implementation of the active record pattern and has been created in order to simplify the access to the "Option" table.

Accessible methods:

  • public function getId():
  • return the id of the Option istance.
  • public static function findById($id):
  • return an Option querying the database.
  • public static function findAll():
  • return an array of all Options contained in the database.
  • public static function findByName($name):
  • return an array of Options having the field Name matching the String $name.
  • public static function findByNameAndType($name, $type):
  • return an array of Options having the field Name matching the string $name and the field Type matching the string $type.
  • public static function findFirstByNameAndType($name, $type):
  • return a Option having the field Name matching the string $name and the field Type matching the string $type.
  • public static function findByType($type):
  • return an array of Options having the field type matching the string $type.
  • public function cleanType($type):
  • delete in the table Option all the records having the type field equal to the string $type.
  • public function save():
  • save the courrent istance.
  • public function delete():
  • delete from the database the courrent istance and reset all the istance fields.
  • protected function insert():
  • insert a new istance in the database.
  • protected function update():
  • update the courrent istance in the corresponding database record
  • public function getMaxId():
  • return an Integer value containing the bigger id field in the table "Option".
  • public function getName():
  • return the content of the field name in the istance Option.
  • public function setName($name):
  • set the Name of the istance of the Option.
  • public function getType():
  • return the content of the field type in the istance Option.
  • public function setType($type):
  • set the Type filed of the istance of the Option.
  • public function getValue():
  • return the content of the field value in the istance Option.
  • public function setValue($value):
  • set the field value.

 


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