id = $id; } /** loads the building block from the database */ //------------------------------------------------- function load(){} //------------------------------------------------- /** saves the building block to the database */ //------------------------------------------------- function save(){ //------------------------------------------------- if($this->id){ $this->doSave(); } else{ $this->id = $this->doCreate(); } } /** saves an exitsing building block */ //------------------------------------------------- function doSave(){} //------------------------------------------------- /** creates a new entry in the database * @return id */ //------------------------------------------------- function doCreate(){} //------------------------------------------------- /** delete the building block from the database */ //------------------------------------------------- function delete(){} //------------------------------------------------- /** updates the building block */ //------------------------------------------------- function update(){} //------------------------------------------------- /** installs the table */ //------------------------------------------------- function install(){} //------------------------------------------------- /** prints the content for editing * @param position position */ //------------------------------------------------- function printContent($position){} //------------------------------------------------- /** publishes the content * @return string */ //------------------------------------------------- function publish(){} //------------------------------------------------- /** publishes the content as plain text (if possible) * @return string */ //------------------------------------------------- function publishAsPlainText(){ //------------------------------------------------- return ""; } /** publishes the content for the newsletter (table layout) * @return string */ //------------------------------------------------- function publishForNewsletter(){ //------------------------------------------------- return ""; } /** publishes the content for pdf output (using FPDF library) */ //------------------------------------------------- function publishForPdf($pdf) {} //------------------------------------------------- /** returns class name and id of the building block * @return unique reference */ //------------------------------------------------- function getReference(){ //------------------------------------------------- return strtolower(get_class($this)).",".$this->id; } }; ?>