Class: GALImage
Source Location: /libgallue/image.inc.php
GALRow
|
--GALTableRow
|
--GALImage
Provide information about an image's content and association with other objects inside the gallery.
Author(s):
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Class Methods
constructor __construct [line 531]
GALImage __construct(
GALGallery
$glb,
$result,
&$data,
$table, array
$data)
|
|
Initialize This constructor is not intended to be called by library users, it is called inside GALImageIterator::fetch().
Overrides GALTableRow::__construct() (Initializes this object.)
Parameters:
method addInstance [line 1275]
void addInstance(
array
$values, [bool
$super = false])
|
|
Add a new Instance to this image. This method creates a new job (see GALJob) and then starts processJobs that processes the job in the background. Therefor the new instance doesn't exist at the moment this method has finished, but when the background process has finished. When creating an image, by default an Instance with instanceID=IMG_RAW is added which contains the image's raw data. If you want to use these raw data as source file, just omit $values['path'] (recommended). This will save you a lot of hassle with files hanging around belonging to no one. The parameter $values is an associative array with the following fields: - $values['x'] int optional The new instance's maximum width, default: read config data.
- $values['y'] int optional The new instance's maximum height, default: read config data.
- $values['permission'] int optional The new instance's permission, values GAL_PERMISSION_PRIVATE, GAL_PERMISSION_PROTECTED or GAL_PERMISSION_PUBLIC. Default: The image's permission.
- $values['mimeType'] string optional The new instance's mimeType property, default: Type is guessed using the file program after converting.
- $values['extension'] string optional The new instance's file extension (without dot, like 'jpeg'; default: info read from config).
- $values['annotation'] string optional A text that is inserted into the image (for example copyright information).
- $values['rotate'] int optional Rotate the instance (possible values are 0, 90, 180, 270, direction ccw)
- $values['options'] string optional Options passed to the conversion process. Not implemented yet.
- $values['instanceID'] int optional The new instance's instanceID. If an instance with the specified instanceID already exists, it is overwritten. If not specified, a free instanceID bigger than IMG_USER is chosen.
- $values['blob'] GALBlob optional Source data for creating the new instance. By default the blob of this image's raw instance is chosen.
You can only obmit the 'x' and 'y' values, if the requested instance is notified in the configuration. The handling of config data is still "ugly", I guess I will change sth here later.
Parameters:
method addToCategory [line 1147]
void addToCategory(
GALCategory
$category, [bool
$super = false])
|
|
Add this image to the specified category.
Parameters:
method addToGroup [line 1065]
void addToGroup(
GALGroup
$group, [int
$position = 0], [bool
$super = false])
|
|
Adds this image to the specified group. Note that the $position parameter is just a raw value and not the real position inside the group.
Parameters:
method canEdit [line 1236]
Check if the specified user has got the privilege to change the image's properties.
Tags:
Parameters:
method canView [line 1221]
Check if the specified user has got the privilege to read the image's properties.
Tags:
Parameters:
method countCategories [line 772]
GALCategoryIterator countCategories(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Counts categories of which this image is member of. It adds a specially crafted join, a comparison expression and ordering by categoryID to the arguments and passes them to GALTable::extendedCount().
Tags:
Parameters:
method countComments [line 882]
GALCommentIterator countComments(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Counts user comments about this image. It adds a comparison expression and ordering by commentID to the arguments and passes them to GALTable::extendedCount().
Tags:
Parameters:
method countGroups [line 802]
GALGroupIterator countGroups(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Counts groups of which this image is member of. It adds a specially crafted join, a comparison expression and ordering by categoryID to the arguments and passes them to GALTable::extendedCount().
Tags:
Parameters:
method countInstances [line 832]
GALInstanceIterator countInstances(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Counts instances of this image. It adds a comparison expression and ordering by instanceID to the arguments and passes them to GALTable::extendedCount().
Tags:
Parameters:
method countJobs [line 857]
GALJobIterator countJobs(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Counts jobs belonging to this image. It adds a comparison expression and ordering by jobID to the arguments and passes them to GALTable::extendedCount().
Tags:
Parameters:
method delete [line 1008]
void delete(
[bool
$super = false])
|
|
Delete the image. This method deletes the image and all depending objects like user comments, instances and jobs. It removes the image from all groups and categories it belonged to and forces refreshing the cached information of the image's film, series, owner, groups and categories.
Overrides GALTableRow::delete() (Deletes this row from the database.)
Parameters:
method get [line 568]
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 GALImage::__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:
method getGroupPosition [line 1110]
int getGroupPosition(
GALGroup
$group, [bool
$super = false])
|
|
Returns the position inside the given GALGroup. Note that the returned position is just the raw value read from ImageInGroup.imagePosition. If this image isn't member of the given group, this method returns FALSE.
Tags:
Parameters:
method getID [line 618]
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:
Parameters:
method instance [line 990]
GALInstance instance(
int
$type, [bool
$super = false])
|
|
Get a particular instance.
Tags:
Parameters:
method loadCategories [line 634]
GALCategoryIterator loadCategories(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Loads categories of which this image is member of. It adds a specially crafted join, a comparison expression and ordering by categoryID to the arguments and passes them to GALTable::extendedLoad().
Tags:
Parameters:
method loadComments [line 744]
GALCommentIterator loadComments(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Loads user comments about this image. It adds a comparison expression and ordering by commentID to the arguments and passes them to GALTable::extendedLoad().
Tags:
Parameters:
method loadGroups [line 664]
GALGroupIterator loadGroups(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Loads groups of which this image is member of. It adds a specially crafted join, a comparison expression and ordering by categoryID to the arguments and passes them to GALTable::extendedLoad().
Tags:
Parameters:
method loadInstances [line 694]
GALInstanceIterator loadInstances(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Loads instances of this image. It adds a comparison expression and ordering by instanceID to the arguments and passes them to GALTable::extendedLoad().
Tags:
Parameters:
method loadJobs [line 719]
GALJobIterator loadJobs(
$expr, [GALOrder
$order = ""], [string
$limit = ""], [string
$additional = ""], [bool
$super = false])
|
|
Loads jobs belonging to this image. It adds a comparison expression and ordering by jobID to the arguments and passes them to GALTable::extendedLoad().
Tags:
Parameters:
method refresh [line 976]
Reload cached information. Force reloading information about membership in categories and groups, about the image's instances and jobs and about user comments. The next time the corresponding properties are read, the information is loaded again.
method removeFromCategory [line 1174]
void removeFromCategory(
GALCategory
$category, [bool
$super = false])
|
|
Remove this image from the specified category.
Parameters:
method removeFromGroup [line 1130]
void removeFromGroup(
GALGroup
$group, [bool
$super = false])
|
|
Remove this image from the specified group.
Parameters:
method rotate [line 1377]
void rotate(
int
$angle, [boolean
$super = false])
|
|
Rotates all instances and updates the 'orientation' property.
Parameters:
method set [line 921]
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:
method setGroupPosition [line 1088]
void setGroupPosition(
GALGroup
$group, int
$position, [bool
$super = false])
|
|
Sets the position inside the given GALGroup. Note that the $position parameter is just a raw value and not the real position inside the group. If this image isn't inside the given group, nothing happens, not even an error message.
Parameters:
method vote [line 1201]
Update the image's score and voteCount properties. Users with rank >= GAL_RANK_USER can vote for images with permission >= GAL_PERMISSION_PROTECTED. The voteCount property is increased by one.
Parameters:
method __get [line 549]
mixed __get(
string
$field)
|
|
Magic method to read properties. It internally uses the GALImage::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. That method also provides overriding access control if required.
Tags:
Overrides GALRow::__get() (Magic method to access this row's fields like native PHP properties.)
Parameters:
method __set [line 905]
void __set(
string
$field, mixed
$value)
|
|
Magic method to set properties It internally uses GALImage::set() with enforced access control.
Overrides GALTableRow::__set() (Magic method to set a field of this row almost like a native PHP property.)
Parameters:
|
|