PaulSchulz\SilverStripe\Gallery\Views\ImageLine
This class represents an image line in an image collection.
It contains a list of images which are rendered to one line in the template.
Synopsis
class ImageLine
extends ViewableData
{
- // members
- private $desiredHeight;
- private $optimizedWidth;
- private ArrayList $images;
- private bool $firstLine;
- // methods
- public void __construct()
- public void addImage()
- public bool hasEnoughSpace()
- public bool isEmpty()
- public int getDesiredHeight()
- public int getOptimizedWidth()
- public float getWidthWithoutMargin()
- public float getWidth()
- public float getHeightWithoutMargin()
- public float getHeight()
- public int getAllImagesRightMargin()
- public void match()
- public float getBiasFromDesiredHeight()
- public ArrayList getImages()
- public void __clone()
- public DBHTMLText forTemplate()
Hierarchy
Extends
- SilverStripe\View\ViewableData
Members
private
- $desiredHeight
—
int
The desired height for this image line. The actually height can be slightly different through the calculation process. - $firstLine
—
PaulSchulz\SilverStripe\Gallery\Views\bool
This is set to true, if this line is the first line in an image line collection. - $images
—
SilverStripe\ORM\ArrayList
All images of this line. - $optimizedWidth
—
int
The width this image line is optimized for.
Methods
public
- __construct() — ImageLine constructor.
- __clone() — This magic function is called when this object is cloned.
- addImage() — Adds an image to this line.
- forTemplate() — This function is called when this object should be rendered to a template.
- getAllImagesRightMargin() — Returns the sum of the margins of all images of this line.
- getBiasFromDesiredHeight() — Returns the deviation to the desired height specified by $this->getDesiredHeight().
- getDesiredHeight() — Returns the desired height for this image line. The actually height can be slightly different through the calculation process.
- getHeight() — Returns the height of this line, calculated by searching for the highest image.
- getHeightWithoutMargin() — Returns the height of this line, calculated by searching for the highest image.
- getImages() — Returns all images of this image line.
- getOptimizedWidth() — Returns the optimized width for this image line.
- getWidth() — Returns the current width of this line, calculated by add up the width and the margin of all images of this line.
- getWidthWithoutMargin() — Returns the current width of this line without margin, calculated by add up the width and the margin of all images of this line.
- hasEnoughSpace() — Test if there is enough space for $image left in this image line.
- isEmpty() — Returns true if the line is empty.
- match() — Match the images to the line, so that the complete space of the line is used and the height of all images is equal afterwards.