public function autoProcessImageVersions(EntityInterface $entity, $action) {
		if (!in_array($action, ['create', 'remove'])) {
			throw new InvalidArgumentException(sprintf('Action was `%s` but must be `create` or `remove`', $action));
		}
		$this->loadImageProcessingFromConfig();
		if (!isset($this->_imageVersions[$entity->model])) {
			return false;
		}
		$method = $action . 'AllImageVersions';

		return $this->{$method}($entity);
	}
public function autoProcessImageVersions(EntityInterface $entity, $action) {
		if (!in_array($action, ['create', 'remove'])) {
			throw new InvalidArgumentException(sprintf('Action was `%s` but must be `create` or `remove`', $action));
		}
		$this->loadImageProcessingFromConfig();
		if (!isset($this->_imageVersions[$entity->model])) {
			return false;
		}
		$method = $action . 'AllImageVersions';

		return $this->{$method}($entity);
	}
public function autoProcessImageVersions ( EntityInterface $ entity , $ action ) { if ( ! in_array ( $ action , [ 'create' , 'remove' ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Action was `%s` but must be `create` or `remove`' , $ action ) ) ; } $ this -> loadImageProcessingFromConfig ( ) ; if ( ! isset ( $ this -> _imageVersions [ $ entity -> model ] ) ) { return false ; } $ method = $ action . 'AllImageVersions' ; return $ this -> { $ method } ( $ entity ) ; }
Convenience method to auto create ALL and auto remove ALL image versions for
an entity.

Call this in your listener after you stored or removed a file that has image
versions. If you need more details in your logic around creating or removing
image versions use the other methods from this trait to implement the checks
and behavior you need.

@param \Cake\Datasource\EntityInterface $entity Entity
@param string $action `create` or `remove` $action Action
@return array
Convenience method to auto create ALL and auto remove ALL image versions for an entity .