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

Class: GALJobs

Source Location: /libgallue/job.inc.php

Class Overview

GALTable
   |
   --GALGallueTable
      |
      --GALJobs

Manage jobs and handle database communication.


Methods


Inherited Variables

Inherited Methods

Class: GALGallueTable

GALGallueTable::__construct()
Initializes $glb object variable.
GALGallueTable::search()
SQL expression that searches for items containing $term.
GALGallueTable::visible()
SQL expression that is TRUE only for items visible to the user currently logged in.
GALGallueTable::writeable()
SQL expression that is TRUE only for items writeable by the user currently logged in.

Class: GALTable

GALTable::__construct()
Initializes this table.
GALTable::buildResult()
Implements the GALResultFactory interface.
GALTable::compareExpression()
Factory for GALExpressionCompare objects.
GALTable::containsKeyFields()
Checks if the specified fields contains a field that belongs to the primary key.
GALTable::count()
Count rows that match the given GALExpression.
GALTable::countFields()
Returns the number of fields contained in a result.
GALTable::delete()
Deletes the row identified by $key from the database.
GALTable::extendedCount()
Template for complex count queries.
GALTable::extendedLoad()
Template for complex queries.
GALTable::fullKey()
Checks if the specified fields in $keys are the full primary key.
GALTable::getFields()
Returns all fields contained in this result.
GALTable::getFlags()
Gets the flags of the given field.
GALTable::getIfRegistered()
Return the row with the submitted primary key values, if it has been registered before.
GALTable::getLength()
Gets the length of the given field.
GALTable::getName()
Returns this table's name.
GALTable::getParent()
Returns a reference to this table.
GALTable::getPrimaryKey()
Returns the primary key of this table.
GALTable::getResultFactory()
Returns the factory to construct results.
GALTable::getRowFactory()
Returns the factory to construct rows.
GALTable::getTable()
Gets the name of the table the given field is contained in.
GALTable::getType()
Gets the type of the given field.
GALTable::insert()
Inserts a row into this table.
GALTable::insertMultiple()
Inserts multiple rows into the database.
GALTable::isField()
Checks if the given field is contained in a result.
GALTable::load()
Load rows that match the given GALExpression.
GALTable::rawCount()
Counts rows from this table.
GALTable::rawLoad()
Loads rows from this table.
GALTable::register()
Registers the specified row or returns an already registered row.
GALTable::registered()
Checks if the specified row is already registered.
GALTable::row()
Fetches a row matching the given key from the database.
GALTable::setRegistered()
Set the entry in $rows specified by &$keys to the specified value.
GALTable::stripKeys()
Removes all fields from the submitted data which belong to the primary key.
GALTable::unregister()
Removes a registered row.
GALTable::updateRow()
Sets the fields of the specified row to the specified values.
GALTable::validFields()
Checks if all the field names submitted in $fields are valid.
GALTable::__destruct()
Destructs all rows stored in $rows.

Class Details

[line 39]
Manage jobs and handle database communication.

Only one instance of this class should exist for one database connection, i.e. one instance of GALGallery. This is assured inside __construct(). Most work is done by inherited methods from GALTable.




[ Top ]


Class Methods


constructor __construct [line 53]

GALJobs __construct( GALGallery $glb)

Initialize using GALGallery object.

This constructor shouldn't be called by a library user, the representations for the used tables are automatically created by the GALGallery object.

Check if an instance of Jobs already exists in the specified GALGallery. If this is the case, throw an GAL_EJob. If not, read necessary information for further initialization from $glb.




Tags:

see:  GALTable::_construct()


Overrides GALGallueTable::__construct() (Initializes $glb object variable.)

Parameters:

GALGallery   $glb   Necessary information for initialization.

[ Top ]

method add [line 100]

GALJob add( array $values, [bool $super = false])

Create a new GALJob.

When processing a job, an instance is created, so many properties of a job correspond to an instance's properties. $values['x'] and $values['y] are used as size parameters for convert, so the resulting image's dimension is equal or lower than the specified values! After converting the image, the real values are determined using the identify utility from ImageMagick. The parameter $values is an associative array with the following fields:

  • $values['image'] GALImage required The image the new job is associated with.
  • $values['instanceID'] int required The new instance's instanceID, for example GAL_IMG_RAW, GAL_IMG_THUMB, GAL_IMG_GALLERY, GAL_IMG_MEDIUM, GAL_IMG_BIG or GAL_IMG_USER.
  • $values['permission'] int optional The new instances permission, values GAL_PERMISSION_PRIVATE, GAL_PERMISSION_PROTECTED or GAL_PERMISSION_PUBLIC. Default: The permission of $values['image'].
  • $values['blob'] GALBlob required The source image data. It is important that you do not delete this GALBlob until the job has finished.
  • $values['mimeType'] string optional The new instance's mimeType property, default: Type is guessed using the file program.
  • $values['x'] int required The new instance's maximum width.
  • $values['y'] int required The new instance's maximum height.
  • $values['extension'] string required The new instance's file extension (without dot, like 'jpeg').
  • $values['annotation'] string optional A text that is inserted into the image (for example copyright information).
  • $values['options'] string optional Options passed to the conversion process. Not implemented yet.




Tags:

return:  The newly created job.


Parameters:

array   $values   Array with data for creating the new instance.
bool   $super   If true, override permission checks.

[ Top ]

method buildResult [line 74]

GALJobIterator buildResult( resource $result)

Creates iterator on mysql result resource.



Overrides GALTable::buildResult() (Implements the GALResultFactory interface.)

Parameters:

resource   $result  

[ Top ]

method search [line 66]

GALExpressionFALSE search( string $term)

Searching jobs is nor supported.



Overrides GALGallueTable::search() (SQL expression that searches for items containing $term.)

Parameters:

string   $term  

[ Top ]


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