| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id:$
|
| 4 |
|
| 5 |
/**
|
| 6 |
* @file
|
| 7 |
* Defines the node class, used by export and import modules
|
| 8 |
*
|
| 9 |
* Copyright (C) 2006 Djun M. Kim
|
| 10 |
*
|
| 11 |
* This program is free software; you can redistribute it and/or
|
| 12 |
* modify it under the terms of the GNU General Public License as
|
| 13 |
* published by the Free Software Foundation; either version 2 of the
|
| 14 |
* License, or (at your option) any later version.
|
| 15 |
*
|
| 16 |
* See the GNU General Public License version 2 LICENSE file for
|
| 17 |
* full terms and conditions of use.
|
| 18 |
*
|
| 19 |
*/
|
| 20 |
|
| 21 |
|
| 22 |
/**
|
| 23 |
* This class represents a Drupal node.
|
| 24 |
|
| 25 |
% This is the node table:
|
| 26 |
| nid | int(10) unsigned | | PRI | NULL | auto_increment |
|
| 27 |
| type | varchar(32) | | MUL | | |
|
| 28 |
| title | varchar(128) | | MUL | | |
|
| 29 |
| uid | int(10) | | MUL | 0 | |
|
| 30 |
| status | int(4) | | MUL | 1 | |
|
| 31 |
| created | int(11) | | MUL | 0 | |
|
| 32 |
| comment | int(2) | | | 0 | |
|
| 33 |
| promote | int(2) | | MUL | 0 | |
|
| 34 |
| moderate | int(2) | | MUL | 0 | |
|
| 35 |
| changed | int(11) | | MUL | 0 | |
|
| 36 |
| sticky | int(2) | | | 0 | |
|
| 37 |
| vid | int(10) unsigned | | | 0 | |
|
| 38 |
|
| 39 |
% This is the node_revisions table:
|
| 40 |
| nid | int(10) unsigned | | MUL | 0 | |
|
| 41 |
| vid | int(10) unsigned | | PRI | 0 | |
|
| 42 |
| uid | int(10) | | MUL | 0 | |
|
| 43 |
| title | varchar(128) | | | | |
|
| 44 |
| body | longtext | YES | | NULL | |
|
| 45 |
| teaser | longtext | YES | | NULL | |
|
| 46 |
| timestamp | int(11) | | | 0 | |
|
| 47 |
| format | int(4) | | | 0 | |
|
| 48 |
| log | longtext | YES | | NULL | |
|
| 49 |
|
| 50 |
|
| 51 |
*/
|
| 52 |
class node {
|
| 53 |
/* these are fields in the node table */
|
| 54 |
var $id;
|
| 55 |
var $nodetype;
|
| 56 |
var $uid;
|
| 57 |
var $status;
|
| 58 |
var $created;
|
| 59 |
var $comment;
|
| 60 |
var $promote;
|
| 61 |
var $moderate;
|
| 62 |
var $changed;
|
| 63 |
var $sticky;
|
| 64 |
var $vid;
|
| 65 |
|
| 66 |
/* these are fields in the book table */
|
| 67 |
var $parent;
|
| 68 |
var $weight;
|
| 69 |
|
| 70 |
/* these are fields in the revision table */
|
| 71 |
var $title;
|
| 72 |
var $body;
|
| 73 |
var $teaser;
|
| 74 |
var $format;
|
| 75 |
var $log;
|
| 76 |
|
| 77 |
/* these are derived or computed */
|
| 78 |
var $md5_body;
|
| 79 |
var $author;
|
| 80 |
var $depth;
|
| 81 |
|
| 82 |
|
| 83 |
function set_id($id) { $this->id = $id; }
|
| 84 |
function get_id() { return $this->id; }
|
| 85 |
function set_nodetype($nodetype) { $this->nodetype = $nodetype; }
|
| 86 |
function get_nodetype() { return $this->nodetype; }
|
| 87 |
function set_uid($uid) { $this->uid = $uid; }
|
| 88 |
function get_uid() {return $this->uid; }
|
| 89 |
function set_status($status) { $this->status = $status; }
|
| 90 |
function get_status() {return $this->status; }
|
| 91 |
function set_created($created) { $this->created = $created; }
|
| 92 |
function get_created() {return $this->created; }
|
| 93 |
|
| 94 |
function set_promote($promote) { $this->promote = $promote; }
|
| 95 |
function get_promote() {return $this->promote; }
|
| 96 |
function set_moderate($moderate) { $this->moderate = $moderate; }
|
| 97 |
function get_moderate() {return $this->moderate; }
|
| 98 |
function set_changed($changed) { $this->changed = $changed; }
|
| 99 |
function get_changed() {return $this->changed; }
|
| 100 |
function set_sticky($sticky) { $this->sticky = $sticky; }
|
| 101 |
function get_sticky() {return $this->sticky; }
|
| 102 |
function set_vid($vid) { $this->vid = $vid; }
|
| 103 |
function get_vid() { return $this->vid; }
|
| 104 |
|
| 105 |
function set_weight($weight) { $this->weight = $weight; }
|
| 106 |
function get_weight() { return $this->weight; }
|
| 107 |
function set_parent($parent) { $this->parent = $parent; }
|
| 108 |
function get_parent() { return $this->parent; }
|
| 109 |
|
| 110 |
function set_title($title) { $this->title = $title; }
|
| 111 |
function get_title() { return $this->title; }
|
| 112 |
function set_body($body) { $this->body = $body; }
|
| 113 |
function get_body() { return $this->body; }
|
| 114 |
function set_teaser($teaser) { $this->teaser = $teaser; }
|
| 115 |
function get_teaser() { return $this->teaser; }
|
| 116 |
function set_format($format) { $this->format = $format; }
|
| 117 |
function get_format() {return $this->format; }
|
| 118 |
|
| 119 |
function set_md5_body($md5_body) { $this->md5_body = $md5_body; }
|
| 120 |
function get_md5_body() { return $this->md5_body; }
|
| 121 |
function set_author($author) { $this->author = $author; }
|
| 122 |
function get_author() {return $this->author; }
|
| 123 |
function set_depth($depth) { $this->depth = $depth; }
|
| 124 |
function get_depth() { return $this->depth; }
|
| 125 |
|
| 126 |
}
|
| 127 |
?>
|