<?php require_once('DB/DataObject.php'); require_once('db_dataobject_init.php'); /* * Table Definition for tags */ class DB_DataObject_Node extends DB_DataObject { // you can define these yourself var $__table='node'; // table name var $nid; var $rid; var $title; var $timestamp; var $extension; // these are usefull to be consistant with a autogenerated file. /* Static get */ function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DB_DataObject_Node',$k,$v); } // now define your table structure. // key is column name, value is type function table() { return array( 'nid' => DB_DATAOBJECT_INT, 'rid' => DB_DATAOBJECT_INT, 'title' => DB_DATAOBJECT_STR, 'timestamp' => DB_DATAOBJECT_TIME, 'extension' => DB_DATAOBJECT_STR ); } // now define the keys. function keys() { return array('nid', 'rid'); } function getForeLinks() { $links = new DB_DataObject_Link; $links->whereAdd('from_nid = ' . $this->nid); return $links; } }