Drupal 8  8.0.2
ImageToolkitBase Class Reference
Inheritance diagram for ImageToolkitBase:

Public Member Functions

 __construct (array $configuration, $plugin_id, array $plugin_definition, ImageToolkitOperationManagerInterface $operation_manager, LoggerInterface $logger, ConfigFactoryInterface $config_factory)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 setSource ($source)
 
 getSource ()
 
 getRequirements ()
 
 apply ($operation, array $arguments=array())
 
- Public Member Functions inherited from ImageToolkitInterface
 isValid ()
 
 save ($destination)
 
 parseFile ()
 
 getHeight ()
 
 getWidth ()
 
 getMimeType ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 
- Public Member Functions inherited from PluginFormInterface
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 

Protected Member Functions

 getToolkitOperation ($operation)
 

Protected Attributes

 $configFactory
 
 $source = ''
 
 $operationManager
 
 $logger
 

Additional Inherited Members

- Static Public Member Functions inherited from ImageToolkitInterface
static isAvailable ()
 
static getSupportedExtensions ()
 
- Static Public Member Functions inherited from ContainerFactoryPluginInterface
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Detailed Description

Provides a base class for image toolkit plugins.

See Also
Plugin API

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
array  $plugin_definition,
ImageToolkitOperationManagerInterface  $operation_manager,
LoggerInterface  $logger,
ConfigFactoryInterface  $config_factory 
)

Constructs an ImageToolkitBase object.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
array$plugin_definitionThe plugin implementation definition.
\Drupal\Core\ImageToolkit\ImageToolkitOperationManagerInterface$operation_managerThe toolkit operation manager.
\Psr\Log\LoggerInterface$loggerA logger instance.
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe config factory.

References Drupal\configFactory(), and Drupal\logger().

Here is the call graph for this function:

Member Function Documentation

apply (   $operation,
array  $arguments = array() 
)

{Applies a toolkit operation to an image.

Parameters
string$operationThe toolkit operation to be processed.
array$argumentsAn associative array of arguments to be passed to the toolkit operation, e.g. array('width' => 50, 'height' => 100, 'upscale' => TRUE).
Returns
bool TRUE if the operation was performed successfully, FALSE otherwise.
}

Implements ImageToolkitInterface.

References PluginInspectionInterface\getPluginId(), ImageToolkitBase\getToolkitOperation(), and Drupal\logger().

Referenced by GDToolkit\load().

Here is the call graph for this function:

Here is the caller graph for this function:

getRequirements ( )

{Gets toolkit requirements in a format suitable for hook_requirements().

Returns
array An associative requirements array as is returned by hook_requirements(). If the toolkit claims no requirements to the system, returns an empty array. The array can have arbitrary keys and they do not have to be prefixed by e.g. the module name or toolkit ID, as the system will make the keys globally unique.
See Also
hook_requirements()
}

Implements ImageToolkitInterface.

getSource ( )

{Gets the source path of the image file.

Returns
string The source path of the image file, or an empty string if the source is not set.
}

Implements ImageToolkitInterface.

Referenced by GDToolkit\load(), TestToolkit\parseFile(), and GDToolkit\parseFile().

Here is the caller graph for this function:

getToolkitOperation (   $operation)
protected

Gets a toolkit operation plugin instance.

Parameters
string$operationThe toolkit operation requested.
Returns
An instance of the requested toolkit operation plugin.

Referenced by ImageToolkitBase\apply().

Here is the caller graph for this function:

setSource (   $source)

{Sets the source path of the image file.

Parameters
string$sourceThe source path of the image file.
Returns
An instance of the current toolkit object.
Exceptions
\BadMethodCallExceptionAfter being set initially, the source image cannot be changed.
}

Implements ImageToolkitInterface.

validateConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form validation handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
}

Implements PluginFormInterface.


The documentation for this class was generated from the following file: