RefreshCrops
class RefreshCrops extends Command (View source)
Properties
protected | $exitCode | from Command | |
protected string | $signature | The name and signature of the console command. |
|
protected string | $description | The console command description. |
|
protected DatabaseManager | $db | ||
protected string | $modelName | The model FQCN for this operation. |
|
protected string | $roleName | The role name for this operation. |
|
protected Collection | $crops | Available crops for the given model and role name. |
|
protected bool | $isDryRun | Print the operations that would be performed without modifying the database. |
|
protected int | $cropsCreated | Total number of crops created. |
|
protected int | $cropsDeleted | Total number of crops deleted. |
|
protected array | $mediaCache | Cache for Media models queried during this operation. |
Methods
Executes the console command.
No description
Print a summary of all crops created and deleted at the end of the command.
Process a set of mediable items.
Create missing crops for a given mediable item, preserving existing metadata.
Delete unused crops for a given mediable item.
Attempt to locate the model from the given command argument.
Calculate crop params for a media from a given ratio.
Details
__call($method, $parameters)
No description
handle()
Executes the console command.
__construct(DatabaseManager $db)
No description
protected void
printSummary()
Print a summary of all crops created and deleted at the end of the command.
protected void
processMediables(Builder $mediables)
Process a set of mediable items.
protected void
createCrops(string[] $crops, object $baseItem)
Create missing crops for a given mediable item, preserving existing metadata.
protected void
deleteCrops(string[] $crops, object $baseItem)
Delete unused crops for a given mediable item.
protected string|null
locateModel(string $modelName)
Attempt to locate the model from the given command argument.
protected array
getCropParams(int $mediaId, float $ratio)
Calculate crop params for a media from a given ratio.