PHP Classes

File: includes/class.blogtag.php

Recommend this page to a friend!
  Packages of SPAM   pork.dbObject   includes/class.blogtag.php   Download  
File: includes/class.blogtag.php
Role: Class source
Content type: text/plain
Description: Example class: blogtag
Class: pork.dbObject
Map objects into MySQL database table rows
Author: By
Last change:
Date: 19 years ago
Size: 539 bytes
 

Contents

Class file image Download
<?

class BlogTag extends dbObject
{
    function __construct($ID=false)
    {
        $this->__setupDatabase('blogs_x_tags', // database table
        array('ID_BlogTag' => 'ID',    // database field => mapped object property
            'ID_Blog' => 'ID_Blog',
            'ID_Tag' => 'ID_Tag'),
            'ID_BlogTag', // primary table key 
            $ID);    // value of primary key to init with (can be false for new empty object / row)
        $this->addRelation('Blog');// define a 1:1 relation to Blog
        $this->addRelation('Tag'); // define a 1:1 relation to Tags
        
    }
}

?>