Jinya CMS

GalleryFilePosition
in package
implements Creatable, Updatable, Deletable Uses EntityTrait, UpdatableEntityTrait, CreatableEntityTrait, DeletableEntityTrait

This class is a mapper class to combine galleries and files, while maintaining a position the file is placed at in the gallery

Tags

Interfaces, Classes, Traits and Enums

Creatable
Updatable
Deletable

Table of Contents

$fileId  : int
$galleryId  : int
$id  : int
$position  : int
create()  : void
Creates the current gallery file position, also moves the position of the other gallery file positions according to the new position
delete()  : void
Deletes the current gallery file position, also resets the position of the other gallery file positions according to the new position
findByPosition()  : GalleryFilePosition|null
Gets the gallery file position at the given position in the given gallery
format()  : array<string, array<string, int|string|null>|int>
Formats the gallery file position into an array
getFile()  : File|null
Gets the associated file
getGallery()  : Gallery|null
Gets the associated gallery
move()  : void
Moves the current gallery file position to the new position. All other gallery file positions are rearranged accordingly
internalRearrange()  : void
Rearranges the items in the same parent
resetOrder()  : void
Resets the order of all entities in the given parent. Reset means, in this context, that it starts the position from 0 and counts up

Properties

Methods

create()

Creates the current gallery file position, also moves the position of the other gallery file positions according to the new position

public create() : void
Tags
throws
NotNullViolationException
Return values
void

delete()

Deletes the current gallery file position, also resets the position of the other gallery file positions according to the new position

public delete() : void
Tags
Return values
void

findByPosition()

Gets the gallery file position at the given position in the given gallery

public static findByPosition(int $id, int $position) : GalleryFilePosition|null
Parameters
$id : int

The gallery ID

$position : int

The files' position

Tags
Return values
GalleryFilePosition|null

format()

Formats the gallery file position into an array

public format() : array<string, array<string, int|string|null>|int>
Tags
Return values
array<string, array<string, int|string|null>|int>

move()

Moves the current gallery file position to the new position. All other gallery file positions are rearranged accordingly

public move(int $newPosition) : void
Parameters
$newPosition : int
Tags
throws
NotNullViolationException
Return values
void

internalRearrange()

Rearranges the items in the same parent

protected internalRearrange(int $parentId, int $newPosition) : void
Parameters
$parentId : int
$newPosition : int
Tags
Return values
void

resetOrder()

Resets the order of all entities in the given parent. Reset means, in this context, that it starts the position from 0 and counts up

protected resetOrder(int $parentId) : void
Parameters
$parentId : int

The parent id

Tags
Return values
void

Search results