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

Class: GALJob

Source Location: /libgallue/job.inc.php

Class Overview

GALRow
   |
   --GALTableRow
      |
      --GALJob

A Job is processed by processJobs to create a new GALInstance.


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 246]
A Job is processed by processJobs to create a new GALInstance.

The core of the converting process is running convert from the ImageMagick project. The necessary information are the source file name, the desired resolution, the desired file extension (which determines which image type is created by convert) and the imageID and the instanceID of the new GALInstance. Normally you should not add a GALJob by hand. To create new instances of an image please use GALImage::addInstance().

This class provides various properties accessed via the magic methods GALJob::__get() and GALJob::__set(). Some of these properties correspond to database fields, some do not. The __get() and __set() methods internally use the GALJob::get() and GALJob::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 jobID r The job's numerical ID, the primary key of the Jobs table.
  • INTEGER UNSIGNED imageID rw The numerical ID of the image the new instance will belong to.
  • INTEGER UNSIGNED instanceID rw The ID of the new instance, typical one of GAL_IMG_RAW, GAL_IMG_THUMB, GAL_IMG_GALLERY, GAL_IMG_MEDIUM, GAL_IMG_BIG
  • TINYINT permission rw The instance's access permission, one of GAL_PERMISSION_LOCKED, GAL_PERMISSION_PRIVATE, GAL_PERMISSION_PROTECTED, GAL_PERMISSION_PUBLIC.
  • INTEGER x rw The new instance's maximal width.
  • INTEGER y rw The new instance's maximal height.
  • INTEGER mimeType rw The new instance's MIME type (might be empty).
  • INTEGER extension rw The new image's file extension whic determines which type convert creates.
  • VARCHAR(255) annotation rw A watersign to be included in the new instance.
  • TEXT options rw Pass parameters to the converting process (at the moment rotate90, rotate180, rotate270 are understood)
  • INTEGER UNSIGNED sourceBlob rw Blob containing the source data, i.e. the picture that is to be converted.
  • TINYINT processed rw A value > 0 indicates that the job is currently processed. Used internally by the converting process, don't touch it!
2. Properties generated using database fields
  • GALImage image (from imageID) r The image the new instance will belong to.
3. Properties not corresponding to database fields.
  • GALUser owner (from ownerID) r The owner of the image the new instance will belong to, i.e. "this->image->owner".




[ Top ]


Class Variables

$_glb =

[line 250]

Link to GALGallery object



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 261]

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

Initialize

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




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

Parameters:

GALGallery   $glb   Used to initialize the GALJob::$_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 396]

bool canEdit( GALUser $user)

Check if the specified user has got the privilege to change the job's properties.



Tags:

return:  True if the user can change the job, false otherwise.


Parameters:

User   $user   The user whose privileges are checked.

[ Top ]

method canView [line 384]

bool canView( GALUser $user)

Check if the specified user has got the privilege to read the job's properties.



Tags:

return:  True if the user can see the job, false otherwise.


Parameters:

User   $user   The user whose privileges are checked.

[ Top ]

method delete [line 361]

void delete( [bool $super = false])

Delete the job.

This method deletes the job and forces refreshing the cached information of the image the job belongs to.




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

Parameters:

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

[ Top ]

method get [line 297]

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

Read a property via method call.

First of all access control is performed. If successful, properties not corresponding to database fields are handled by this method itself. Properties corresponding to database fields are delegated to the inherited GALRow::get() method. It might seem strange that overriding access control is the default. It is like it is because GALRow::__construct() called by GALJob::__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 320]

int getID( [ $super = false])

The value of the primary key field.

This method provides access to the primary key without knowing the name of the primary key field. This method is implemented by all classes whose tables have a single numerical primary key. At the moment it is only used in GALComments::add(). (Better: It was introduced for GALComments::add() ;-) )




Tags:

return:  The value of the primary key field.


Parameters:

   $super  

[ Top ]

method set [line 346]

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

Set a property via method call.

First of all access control is performed. If successful, properties not corresponding to database fields are handled by this method itself. Properties corresponding to database fields are delegated to the inherited GALTableRow::set() method. It also updates the changeDate property on every call.




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 278]

mixed __get( string $field)

Magic method to read properties.

It internally uses the GALJob::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 331]

void __set( string $field, mixed $value)

Magic method to set properties It internally uses GALJob::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:15 +0200 by phpDocumentor 1.3.0RC6