Property | Type | Description | |
---|---|---|---|
$config | Codesleeve\Stapler\AttachmentConfig | An instance of the configuration class. | |
$instance | Codesleeve\Stapler\ORM\StaplerableInterface | The model instance that the attachment belongs to. | |
$interpolator | Codesleeve\Stapler\Interfaces\Interpolator | An instance of the interpolator class for processing interpolations. | |
$queuedForDeletion | array | The uploaded/resized files that have been queued up for deletion. | |
$queuedForWrite | array | The uploaded/resized files that have been queued up to be written to storage. | |
$resizer | Codesleeve\Stapler\File\Image\Resizer | An instance of the resizer library that's being used for image processing. | |
$storageDriver | StorageInterface. | An instance of the underlying storage driver that is being used. | |
$uploadedFile | Codesleeve\Stapler\Interfaces\File | The uploaded file object for the attachment. |
Method | Description | |
---|---|---|
__call ( string $method, array $parameters ) : mixed | Handle dynamic method calls on the attachment. | |
__construct ( Codesleeve\Stapler\AttachmentConfig $config, Codesleeve\Stapler\Interfaces\Interpolator $interpolator, Codesleeve\Stapler\Interfaces\Resizer $resizer ) | Constructor method. | |
__get ( string $optionName ) : mixed | Handle the dynamic retrieval of attachment options. | |
__set ( string $name, mixed $value ) | Handle the dynamic setting of attachment options. | |
afterDelete ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | Process the delete queue. | |
afterSave ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | Process the write queue. | |
beforeDelete ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | Queue up this attachments files for deletion. | |
clear ( array $stylesToClear = [] ) | Queues up all or some of this attachments uploaded files/images for deletion. | |
clearAttributes ( ) | Clear (set to null) all attachment related model attributes. | |
contentType ( ) : string | Returns the content type of the file as originally assigned to this attachment's model. | |
createdAt ( ) : string | Returns the creation time of the file as originally assigned to this attachment's model. | |
destroy ( array $stylesToClear = [] ) | Removes all uploaded files (from storage) for this attachment. | |
getConfig ( ) : array | Accessor method for the Config property. | |
getInstance ( ) : Codesleeve\Stapler\ORM\StaplerableInterface | Accessor method for the underlying instance (model) object this attachment is defined on. | |
getInstanceClass ( ) : string | Returns the class type of the attachment's underlying model instance. | |
getInterpolator ( ) : Codesleeve\Stapler\Interfaces\Interpolator | Accessor method for the interpolator property. | |
getQueuedForDeletion ( ) : array | Accessor method for the QueuedForDeletion property. | |
getResizer ( ) : Resizer | Accessor method for the uploadedFile property. | |
getStorageDriver ( ) : Codesleeve\Stapler\Interfaces\Storage | Accessor method for the storageDriver property. | |
getUploadedFile ( ) : Codesleeve\Stapler\Interfaces\File | Accessor method for the uploadedFile property. | |
instanceWrite ( string $property, mixed $value ) | Set an attachment attribute on the underlying model instance. | |
jsonSerialize ( ) : array | Return a JSON representation of this class. | |
originalFilename ( ) : string | Returns the name of the file as originally assigned to this attachment's model. | |
path ( string $styleName = '' ) : string | Generates the file system path to an uploaded file (or a resized version of it). | |
reprocess ( ) | Rebuilds the images for this attachment. | |
save ( ) | Flushes the queuedForDeletion and queuedForWrite arrays. | |
setConfig ( Codesleeve\Stapler\AttachmentConfig $config ) | Mutator method for the config property. | |
setInstance ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | Mutator method for the instance property. | |
setInterpolator ( Codesleeve\Stapler\Interfaces\Interpolator $interpolator ) | Mutator method for the interpolator property. | |
setQueuedForDeletion ( array $array ) | Mutator method for the QueuedForDeletion property. | |
setResizer ( Codesleeve\Stapler\Interfaces\Resizer $resizer ) | Mutator method for the resizer property. | |
setStorageDriver ( Codesleeve\Stapler\Interfaces\Storage $storageDriver ) | Mutator method for the storageDriver property. | |
setUploadedFile ( mixed $uploadedFile ) | Mutator method for the uploadedFile property. | |
size ( ) : integer | Returns the size of the file as originally assigned to this attachment's model. | |
updatedAt ( ) : string | Returns the last modified time of the file as originally assigned to this attachment's model. | |
url ( string $styleName = '' ) : string | Generates the url to an uploaded file (or a resized version of it). |
Method | Description | |
---|---|---|
defaultPath ( string $styleName = '' ) : string | Generates the default path if no file attachment is present. | |
defaultUrl ( string $styleName = '' ) : string | Generates the default url if no file attachment is present. | |
flushDeletes ( ) | Process the queuedForDeletion que. | |
flushWrites ( ) | Process the queuedForWrite que. | |
queueAllForDeletion ( ) | Add all uploaded files (across all image styles) to the queuedForDeletion queue. | |
queueAllForWrite ( ) | Fill the queuedForWrite que with all of this attachment's styles. | |
queueSomeForDeletion ( array $stylesToClear ) | Add a subset (filtered via style) of the uploaded files for this attachment to the queuedForDeletion queue. |
public __construct ( Codesleeve\Stapler\AttachmentConfig $config, Codesleeve\Stapler\Interfaces\Interpolator $interpolator, Codesleeve\Stapler\Interfaces\Resizer $resizer ) | ||
$config | Codesleeve\Stapler\AttachmentConfig | |
$interpolator | Codesleeve\Stapler\Interfaces\Interpolator | |
$resizer | Codesleeve\Stapler\Interfaces\Resizer |
public afterDelete ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | ||
$instance | Codesleeve\Stapler\ORM\StaplerableInterface |
public afterSave ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | ||
$instance | Codesleeve\Stapler\ORM\StaplerableInterface |
public beforeDelete ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | ||
$instance | Codesleeve\Stapler\ORM\StaplerableInterface |
public clearAttributes ( ) |
public contentType ( ) : string | ||
return | string |
protected defaultPath ( string $styleName = '' ) : string | ||
$styleName | string | |
return | string |
protected defaultUrl ( string $styleName = '' ) : string | ||
$styleName | string | |
return | string |
public getInstance ( ) : Codesleeve\Stapler\ORM\StaplerableInterface | ||
return | Codesleeve\Stapler\ORM\StaplerableInterface |
public getInstanceClass ( ) : string | ||
return | string |
public getInterpolator ( ) : Codesleeve\Stapler\Interfaces\Interpolator | ||
return | Codesleeve\Stapler\Interfaces\Interpolator |
public getQueuedForDeletion ( ) : array | ||
return | array |
public getResizer ( ) : Resizer | ||
return | Resizer |
public getStorageDriver ( ) : Codesleeve\Stapler\Interfaces\Storage | ||
return | Codesleeve\Stapler\Interfaces\Storage |
public getUploadedFile ( ) : Codesleeve\Stapler\Interfaces\File | ||
return | Codesleeve\Stapler\Interfaces\File |
public instanceWrite ( string $property, mixed $value ) | ||
$property | string | |
$value | mixed |
public jsonSerialize ( ) : array | ||
return | array |
public originalFilename ( ) : string | ||
return | string |
protected queueAllForDeletion ( ) |
protected queueAllForWrite ( ) |
protected queueSomeForDeletion ( array $stylesToClear ) | ||
$stylesToClear | array |
public setConfig ( Codesleeve\Stapler\AttachmentConfig $config ) | ||
$config | Codesleeve\Stapler\AttachmentConfig |
public setInstance ( Codesleeve\Stapler\ORM\StaplerableInterface $instance ) | ||
$instance | Codesleeve\Stapler\ORM\StaplerableInterface |
public setInterpolator ( Codesleeve\Stapler\Interfaces\Interpolator $interpolator ) | ||
$interpolator | Codesleeve\Stapler\Interfaces\Interpolator |
public setQueuedForDeletion ( array $array ) | ||
$array | array |
public setResizer ( Codesleeve\Stapler\Interfaces\Resizer $resizer ) | ||
$resizer | Codesleeve\Stapler\Interfaces\Resizer |
public setStorageDriver ( Codesleeve\Stapler\Interfaces\Storage $storageDriver ) | ||
$storageDriver | Codesleeve\Stapler\Interfaces\Storage |
public setUploadedFile ( mixed $uploadedFile ) | ||
$uploadedFile | mixed |
protected AttachmentConfig,Codesleeve\Stapler $config | ||
return | Codesleeve\Stapler\AttachmentConfig |
protected StaplerableInterface,Codesleeve\Stapler\ORM $instance | ||
return | Codesleeve\Stapler\ORM\StaplerableInterface |
protected Interpolator,Codesleeve\Stapler\Interfaces $interpolator | ||
return | Codesleeve\Stapler\Interfaces\Interpolator |
protected array $queuedForDeletion | ||
return | array |
protected array $queuedForWrite | ||
return | array |
protected Resizer,Codesleeve\Stapler\File\Image $resizer | ||
return | Codesleeve\Stapler\File\Image\Resizer |
protected StorageInterface. $storageDriver | ||
return | StorageInterface. |