src/models/StorageFilter.php
public function applyFilterChain($source, $fileSavePath)
    {   
        $loadFrom = $source;
        
        foreach (StorageFilterChain::find()->where(['filter_id' => $this->id])->with(['effect'])->all() as $chain) {
            // apply filter
            $chain->applyFilter($loadFrom, $fileSavePath);
            // override load from path for next iteration (if any).
            $loadFrom = $fileSavePath;
        }
        
        return true;
    }
public function applyFilterChain($source, $fileSavePath)
    {   
        $loadFrom = $source;
        
        foreach (StorageFilterChain::find()->where(['filter_id' => $this->id])->with(['effect'])->all() as $chain) {
            // apply filter
            $chain->applyFilter($loadFrom, $fileSavePath);
            // override load from path for next iteration (if any).
            $loadFrom = $fileSavePath;
        }
        
        return true;
    }
public function applyFilterChain ( $ source , $ fileSavePath ) { $ loadFrom = $ source ; foreach ( StorageFilterChain :: find ( ) -> where ( [ 'filter_id' => $ this -> id ] ) -> with ( [ 'effect' ] ) -> all ( ) as $ chain ) { // apply filter $ chain -> applyFilter ( $ loadFrom , $ fileSavePath ) ; // override load from path for next iteration (if any). $ loadFrom = $ fileSavePath ; } return true ; }
Apply the current filter chain.

Apply all filters from the chain to a given file and stores the new generated file on the $fileSavePath

@param string $source the Source path to the file, which the filter chain should be applied to.
@param string $fileSavePath
@return boolean
Apply the current filter chain .