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

Class: GALTableRow

Source Location: /libbase/table.inc.php

Class Overview

GALRow
   |
   --GALTableRow

Extension of GALRow that implements write access and references a whole row of a table.


Variables

Methods


Child classes:

GALUser
GALNode
Provide information to identify a cluster node.
GALFilm
Provide information about a film's content and association with other objects inside the gallery.
GALHelp
GALComment
Provide information about a comment's content, it's parent and follow-up comments.
GALImage
Provide information about an image's content and association with other objects inside the gallery.
GALSeries
GALGroup
Provide information about a group's content and association with other objects inside the gallery.
GALInstance
Provide information specific to an image's instance.
GALLogin
GALJob
A Job is processed by processJobs to create a new GALInstance.
GALCategory
Provide information about a category's content and association with other objects inside the gallery.
GALToken

Inherited Variables

Inherited Methods

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 360]
Extension of GALRow that implements write access and references a whole row of a table.

This class cannot be used for arbitrary MySQL result resources like GALRow, but only works for results of queries like "SELECT `table`.* FROM `table` ..." that return all fields of a table and no results of SQL function. This restriction is necessary to support write access to fields, because otherwise it would be difficult to identify the source of a field. E.g. it would be nonsense to try changing the result of COUNT() directly... ;).




[ Top ]


Class Variables

$_key = array()

[line 371]

The primary key of this row.



Tags:

var:  Associative array where the field names are the keys and the values of the fields are the values.
access:  protected

Type:   array


[ Top ]

$_table =

[line 366]

The table this row is fetched from.



Tags:

access:  protected

Type:   GALTable


[ Top ]



Class Methods


constructor __construct [line 380]

GALTableRow __construct( GALResult $result, array &$data, GALTable $table)

Initializes this object.

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




Overridden in child classes as:

GALUser::__construct()
GALNode::__construct()
Initialize
GALFilm::__construct()
Initialize This constructor is not intended to be called by library users, it is called inside GALFilmIterator::fetch().
GALHelp::__construct()
GALComment::__construct()
Initialize.
GALImage::__construct()
Initialize This constructor is not intended to be called by library users, it is called inside GALImageIterator::fetch().
GALSeries::__construct()
GALGroup::__construct()
Initialize.
GALInstance::__construct()
Initialize
GALLogin::__construct()
GALJob::__construct()
Initialize
GALCategory::__construct()
Initialize This constructor is not intended to be called by library users, it is called inside GALCategoryIterator::fetch().
GALToken::__construct()

Overrides GALRow::__construct() (Initializes a row.)

Parameters:

GALResult   $result   The result this row is fetched from, passed to the parent constructor.
array   &$data   The data of this row, passed to the parent constructor.
GALTable   $table   The table this row belongs to.

[ Top ]

method delete [line 440]

void delete( )

Deletes this row from the database.

This method deletes this row and invalidates it so it cannot be accessed any more.




Overridden in child classes as:

GALUser::delete()
GALNode::delete()
Unregister this node.
GALFilm::delete()
Deletes this film.
GALHelp::delete()
GALComment::delete()
Delete the comment.
GALImage::delete()
Delete the image.
GALSeries::delete()
GALGroup::delete()
Deletes this group.
GALInstance::delete()
Delete this instance.
GALLogin::delete()
GALJob::delete()
Delete the job.
GALCategory::delete()
Deletes this category.
GALToken::delete()

[ Top ]

method getParent [line 395]

GALDesc getParent( )

Returns the top level parent of this row.

Usually this is the GALTable the row belongs to.




Overridden in child classes as:

GALComment::getParent()
Return the comment's parent.

Overrides GALRow::getParent() (Returns the top level parent of an entity.)

[ Top ]

method set [line 426]

void set( string $field, mixed $value)

Sets the specified field of this row to the specified value.

The data are not read back, therefor concurring write access can lead to unexpected results. To avoid this, {@GALTableIterator} and GALTable make sure that for a certain instance of GALTable only one GALTableRow object per row exists, even if the rows are fetched from different database results. To avoid concurring access through concurring processes, please use transactions and locking. For an example, have a look at the source of GALImage::delete() in image.inc.php. As in most cases read access to the database dominates, automated locking on every access would slow down the system and increase the risk of dead locks. Escaping the value passed to this method is not necessary, this is automatically done inside the methods of GALTable which are used by this function. Changing fields which belong to the primary key is not supported and leads to an exception.




Tags:

throws:  GAL_EDatabase If the field doesn't exist or belongs to the primary key or this row is invalidated.


Overridden in child classes as:

GALUser::set()
GALNode::set()
Set a property via method call.
GALFilm::set()
Set a property via method call.
GALHelp::set()
GALComment::set()
Set a property via method call.
GALImage::set()
Set a property via method call.
GALSeries::set()
GALGroup::set()
Set a property via method call.
GALInstance::set()
Set a property via method call.
GALLogin::set()
GALJob::set()
Set a property via method call.
GALCategory::set()
Set a property via method call.
GALToken::set()

Parameters:

string   $field   The name of a field.
mixed   $value   The new value of the specified field.

[ Top ]

method __set [line 406]

void __set( string $field, mixed $value)

Magic method to set a field of this row almost like a native PHP property.

This method is a wrapper for set().




Tags:

throws:  GAL_EDatabase If the field doesn't exist or this row is invalidated.


Overridden in child classes as:

GALUser::__set()
GALNode::__set()
Magic method to set properties It internally uses GALInstance::set() with enforced access control.
GALFilm::__set()
Magic method to set properties.
GALHelp::__set()
GALComment::__set()
Magic method to set properties It internally uses set() with enforced access control.
GALImage::__set()
Magic method to set properties It internally uses GALImage::set() with enforced access control.
GALSeries::__set()
GALGroup::__set()
Magic method to set properties It internally uses GALGroup::set() with enforced access control.
GALInstance::__set()
Magic method to set properties It internally uses GALInstance::set() with enforced access control.
GALLogin::__set()
GALJob::__set()
Magic method to set properties It internally uses GALJob::set() with enforced access control.
GALCategory::__set()
Magic method to set properties.
GALToken::__set()

Parameters:

string   $field   The name of a field.
mixed   $value   The new value of the specified field.

[ Top ]


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