SourceForge.net LogoPHPGallue
[ class tree: libgallue ] [ index: libgallue ] [ all elements ]

Class: GALNode

Source Location: /libgallue/node.inc.php

Class Overview

GALRow
   |
   --GALTableRow
      |
      --GALNode

Provide information to identify a cluster node.


Variables

Methods


Inherited Variables

Inherited Methods

Class: GALTableRow

GALTableRow::__construct()
Initializes this object.
GALTableRow::delete()
Deletes this row from the database.
GALTableRow::getParent()
Returns the top level parent of this row.
GALTableRow::set()
Sets the specified field of this row to the specified value.
GALTableRow::__set()
Magic method to set a field of this row almost like a native PHP property.

Class: GALRow

GALRow::__construct()
Initializes a row.
GALRow::countFields()
Returns the number of fields contained in a result.
GALRow::get()
Returns the value of a field.
GALRow::getData()
Provides access to the stored data.
GALRow::getFields()
Returns all fields contained in this result.
GALRow::getFlags()
Gets the flags of the given field.
GALRow::getLength()
Gets the length of the given field.
GALRow::getParent()
Returns the top level parent of an entity.
GALRow::getTable()
Gets the name of the table the given field is contained in.
GALRow::getType()
Gets the type of the given field.
GALRow::isField()
Checks if the given field is contained in a result.
GALRow::__destruct()
Deletes the stored data and sets $_dead to TRUE.
GALRow::__get()
Magic method to access this row's fields like native PHP properties.

Class Details

[line 153]
Provide information to identify a cluster node.

This class provides various properties accessed via the magic methods __get() and __set(). Some of these properties correspond to database fields, some do not. The __get() and __set() methods internally use the get() and set() methods which provide access control - in contrast to the parent class's GALRow::get() and GALTableRow::set() methods. After performing the access control, these are used to read and write the properties corresponding to database fields. All properties corresponding to database fields are of type string, but instead database types are given here. (r indicates readable, w writable)

  1. Properties corresponding to database fields:
  • INTEGER UNSIGNED nodeID r The numerical ID of the node.
  • BOOL online rw Set to TRUE if a node can serve requests




[ Top ]


Class Variables

$_config =

[line 162]

The section of the config file that describes this node.



Tags:

access:  protected

Type:   GALSection


[ Top ]

$_glb =

[line 157]



Tags:

access:  protected

Type:   GALGallery


[ Top ]



Class Methods


constructor __construct [line 173]

GALNode __construct( GALGallery $glb, $result, &$data, $table, array $data)

Initialize

This constructor is not intended to be called by library users, it is called inside GALNodeIterator::fetch().




Overrides GALTableRow::__construct() (Initializes this object.)

Parameters:

GALGallery   $glb   Used to initialize the $_glb object variable.
GALResult   $result   Used in parent constructor GALTableRow::__construct().
array   $data   Used in parent constructor GALTableRow::__construct().
GALTable   $table   Used in parent constructor GALTableRow::__construct().
   &$data  

[ Top ]

method canEdit [line 355]

bool canEdit( GALUser $user)

Returns TRUE if the specified user is an ADMIN.



Parameters:

GALUser   $user  

[ Top ]

method canView [line 346]

bool canView( GALUser $user)

Returns TRUE if the specified user is an ADMIN.



Parameters:

GALUser   $user  

[ Top ]

method countJobs [line 268]

GALImageIterator countJobs( $expr, [GALOrder $order = ""], [string $limit = ""], [string $additional = ""], [bool $super = false])

Counts jobs whose source data are in the local disk cache of this node.



Tags:



Parameters:

GALExpression   $expr  
GALOrder   $order   Can also be an empty string or a string containing sth. like "`title` DESC".
string   $limit  
string   $additional  
bool   $super   If set to TRUE, access control is overridden.

[ Top ]

method delete [line 324]

void delete( [bool $super = false])

Unregister this node.

This method deletes the database entry of this node and all information about cached blobs in the NodeHasBlob table.




Overrides GALTableRow::delete() (Deletes this row from the database.)

Parameters:

bool   $super   If set to TRUE, access control is overridden.

[ Top ]

method get [line 209]

void get( string $field, [bool $super = true])

Read a property via method call.

First of all access control is performed. If successful, the call is delegated to the parent GALResult::get() method. It might seem strange that overriding access control is the default. It is like it is because GALRow::__construct() called by GALNode::__construct reads the row's primary key using the get() method. In our case the original get() method is overridden by the current one, so it has to work in this case without second parameter.




Overrides GALRow::get() (Returns the value of a field.)

Parameters:

string   $field   The propertie's name
bool   $super   TRUE indicates privileged access overriding access control.

[ Top ]

method getID [line 225]

int getID( [ $super = false])

Return the node's numerical ID.



Parameters:

   $super  

[ Top ]

method loadJobs [line 239]

GALImageIterator loadJobs( $expr, [GALOrder $order = ""], [string $limit = ""], [string $additional = ""], [bool $super = false])

Loads jobs whose source data are in the local disk cache of this node.



Tags:



Parameters:

GALExpression   $expr  
GALOrder   $order   Can also be an empty string or a string containing sth. like "`title` DESC".
string   $limit  
string   $additional  
bool   $super   If set to TRUE, access control is overridden.

[ Top ]

method set [line 304]

void set( string $field, mixed $value, [bool $super = false])

Set a property via method call.

One can just change the imgScript property.




Overrides GALTableRow::set() (Sets the specified field of this row to the specified value.)

Parameters:

string   $field   The propertie's name.
mixed   $value   The propertie's new value.
bool   $super   If set to TRUE, access control is overridden.

[ Top ]

method __get [line 192]

mixed __get( string $field)

Magic method to read properties.

It internally uses the get() method with enforced access control. Library users should not explicitly call the __get() method - it is good for nothing. If you want to read a property with a method call, use get() instead. This method also provides overriding access control if required.




Tags:

return:  The propertie's value.


Overrides GALRow::__get() (Magic method to access this row's fields like native PHP properties.)

Parameters:

string   $field   The requested propertie's name.

[ Top ]

method __set [line 294]

void __set( string $field, mixed $value)

Magic method to set properties It internally uses GALInstance::set() with enforced access control.



Overrides GALTableRow::__set() (Magic method to set a field of this row almost like a native PHP property.)

Parameters:

string   $field   The name of the property to set.
mixed   $value   The propertie's new value.

[ Top ]


Documentation generated on Wed, 16 Aug 2006 15:36:22 +0200 by phpDocumentor 1.3.0RC6