PHP Class TippingCanoe\Imager\Service

Mostrar archivo Open project: tippingcanoe/imager

Protected Properties

Property Type Description
$app Illuminate\Foundation\Application
$currentDriver TippingCanoe\Imager\Storage\Driver
$imageRepository TippingCanoe\Imager\Repository\Image
$intervention Intervention\Image\ImageManager
$storageDrivers TippingCanoe\Imager\Storage\Driver[]

Public Methods

Method Description
__construct ( TippingCanoe\Imager\Repository\Image $imageRepository, Intervention\Image\ImageManager $intervention, Illuminate\Foundation\Application $app, array $storageDrivers )
batch ( array $operations, array $files = null, TippingCanoe\Imager\Model\Imageable $imageable = null )
delete ( Image $image, array $filters = [] )
deleteById ( $id, array $filters = [] )
deleteBySlot ( $slot, TippingCanoe\Imager\Model\Imageable $imageable = null )
getById ( integer $id ) : Image Simply retrieves an image by id.
getBySlot ( $slot, TippingCanoe\Imager\Model\Imageable $imageable = null ) : Image
getPublicUri ( Image $image, array $filters = [] ) : string
getPublicUriById ( integer $id, array $filters = [] ) : string Returns an image URI based on the id of the original.
getPublicUriBySlot ( string $slot, TippingCanoe\Imager\Model\Imageable $imageable = null, array $filters = [] ) : string | null Returns an image URI based on the slot and imageable.
moveToSlot ( Image $image, $slot )
saveFromFile ( File $file, TippingCanoe\Imager\Model\Imageable $imageable = null, array $attributes = [] ) : null Saves a new image from a file found on the server's filesystem.
saveFromUri ( string $uri, TippingCanoe\Imager\Model\Imageable $imageable = null, array $attributes = [] ) : null Saves a new image from a file available via any of the standard PHP supported schemes.
useDriver ( $abstract ) Select which driver Imager uses by default.

Protected Methods

Method Description
createImageRecord ( File $image, array $attributes = [] ) : Image Create the database entry for an image.
getDriver ( null $abstract = null ) : TippingCanoe\Imager\Storage\Driver Gets the current or specified driver.
runFilters ( File $file, Image $image, array $filters = [] )
saveFile ( File $file, Image $image, array $filters = [] ) Pass a file save into the current Driver.

Method Details

__construct() public method

public __construct ( TippingCanoe\Imager\Repository\Image $imageRepository, Intervention\Image\ImageManager $intervention, Illuminate\Foundation\Application $app, array $storageDrivers )
$imageRepository TippingCanoe\Imager\Repository\Image
$intervention Intervention\Image\ImageManager
$app Illuminate\Foundation\Application
$storageDrivers array

batch() public method

public batch ( array $operations, array $files = null, TippingCanoe\Imager\Model\Imageable $imageable = null )
$operations array
$files array
$imageable TippingCanoe\Imager\Model\Imageable

createImageRecord() protected method

Create the database entry for an image.
protected createImageRecord ( File $image, array $attributes = [] ) : Image
$image Symfony\Component\HttpFoundation\File\File
$attributes array
return TippingCanoe\Imager\Model\Image

delete() public method

public delete ( Image $image, array $filters = [] )
$image TippingCanoe\Imager\Model\Image
$filters array

deleteById() public method

public deleteById ( $id, array $filters = [] )
$id
$filters array

deleteBySlot() public method

public deleteBySlot ( $slot, TippingCanoe\Imager\Model\Imageable $imageable = null )
$imageable TippingCanoe\Imager\Model\Imageable

getById() public method

Simply retrieves an image by id.
public getById ( integer $id ) : Image
$id integer
return TippingCanoe\Imager\Model\Image

getBySlot() public method

public getBySlot ( $slot, TippingCanoe\Imager\Model\Imageable $imageable = null ) : Image
$slot
$imageable TippingCanoe\Imager\Model\Imageable
return TippingCanoe\Imager\Model\Image

getDriver() protected method

Gets the current or specified driver.
protected getDriver ( null $abstract = null ) : TippingCanoe\Imager\Storage\Driver
$abstract null
return TippingCanoe\Imager\Storage\Driver

getPublicUri() public method

public getPublicUri ( Image $image, array $filters = [] ) : string
$image TippingCanoe\Imager\Model\Image
$filters array
return string

getPublicUriById() public method

Returns an image URI based on the id of the original.
public getPublicUriById ( integer $id, array $filters = [] ) : string
$id integer
$filters array
return string

getPublicUriBySlot() public method

Returns an image URI based on the slot and imageable.
public getPublicUriBySlot ( string $slot, TippingCanoe\Imager\Model\Imageable $imageable = null, array $filters = [] ) : string | null
$slot string
$imageable TippingCanoe\Imager\Model\Imageable
$filters array
return string | null

moveToSlot() public method

public moveToSlot ( Image $image, $slot )
$image TippingCanoe\Imager\Model\Image

runFilters() protected method

protected runFilters ( File $file, Image $image, array $filters = [] )
$file Symfony\Component\HttpFoundation\File\File
$image TippingCanoe\Imager\Model\Image
$filters array

saveFile() protected method

Pass a file save into the current Driver.
protected saveFile ( File $file, Image $image, array $filters = [] )
$file Symfony\Component\HttpFoundation\File\File
$image TippingCanoe\Imager\Model\Image
$filters array

saveFromFile() public method

Saves a new image from a file found on the server's filesystem.
public saveFromFile ( File $file, TippingCanoe\Imager\Model\Imageable $imageable = null, array $attributes = [] ) : null
$file Symfony\Component\HttpFoundation\File\File
$imageable TippingCanoe\Imager\Model\Imageable
$attributes array
return null

saveFromUri() public method

Saves a new image from a file available via any of the standard PHP supported schemes.
public saveFromUri ( string $uri, TippingCanoe\Imager\Model\Imageable $imageable = null, array $attributes = [] ) : null
$uri string
$imageable TippingCanoe\Imager\Model\Imageable
$attributes array
return null

useDriver() public method

Select which driver Imager uses by default.
public useDriver ( $abstract )
$abstract

Property Details

$app protected_oe property

protected Application,Illuminate\Foundation $app
return Illuminate\Foundation\Application

$currentDriver protected_oe property

protected Driver,TippingCanoe\Imager\Storage $currentDriver
return TippingCanoe\Imager\Storage\Driver

$imageRepository protected_oe property

protected Image,TippingCanoe\Imager\Repository $imageRepository
return TippingCanoe\Imager\Repository\Image

$intervention protected_oe property

protected ImageManager,Intervention\Image $intervention
return Intervention\Image\ImageManager

$storageDrivers protected_oe property

protected Driver[],TippingCanoe\Imager\Storage $storageDrivers
return TippingCanoe\Imager\Storage\Driver[]