Drupal Object Reference

Here is a list of the objects and properties that Drupal offers to functions.

$node - Node object

$node->name Username of node creator
$node->date Date the node was created
$node->status unpublished/published (0|1)
$node->moderate Moderation enabled (0|1)
$node->promote Promoted to front page (0|1)
$node->sticky Sticky (0|1)
$node->revision TRUE/FALSE this is a new revision (if TRUE, will be saved as a separate entry in the database)
$node->comment whether comments can be added, read, or accessed, for this node
$node->title Page title
$node->body Body content of node
$node->format which filter applies to this content.
$node->uid User ID of node creator
$node->created UNIX timestamp of node creation date.
$node->type Type of node (e.g. book, page, forum)
$node->teaser Teaser (the initial part of the body)
$node->validated has the node passed validation? (0|1) (is it ready to be saved).
$node->changed UNIX timestamp of last time node was changed.
$node->nid Node ID

$user Drupal 5.1

emackn - February 21, 2007 - 17:52

<?php
stdClass Object
(
    [
uid] =>
    [
name] =>
    [
pass] =>
    [
mail] =>
    [
mode] =>
    [
sort] =>
    [
threshold] =>
    [
theme] =>
    [
signature] =>
    [
created] =>
    [
access] =>
    [
login] =>
    [
status] =>
    [
timezone] =>
    [
language] =>
    [
picture] =>
    [
init] =>
    [
data] =>
    [
sid] =>
    [
hostname] =>
    [
timestamp] =>
    [
cache] =>
    [
session] =>
    [
roles] => Array
        (
            [
2] => authenticated user
           
[3] => administrator
       
)
?>

term item in Drupal 5

emackn - September 20, 2007 - 17:15

an item from taxonomy_get_tree() :

<?php
stdClass Object
(
    [
tid] => 41
   
[vid] => 2
   
[name] => Blogs
   
[description] =>
    [
weight] => -5
   
[depth] => 0
   
[parents] => Array
        (
            [
0] => 0
       
)

)
?>

$file object

eMPee584 - November 5, 2007 - 23:56

Edit: thought getting this info would be simple, but as PHP is very dynamic with objects.. well anyways.
$file objects generated by file_scan_directory() look like this:

$file->filename
full path from drupal root
$file->basename
filename
$file->name
filename excluding extension

file_check_upload() also creates these fields:

$file->filepath
full path from drupal root?
$file->filemime
mimetype
$file->source
where did the file come from

do does even reach anywhere outside the function? Is there a better way to dump this information?

 
 

Drupal is a registered trademark of Dries Buytaert.