protected function setSelectionParams($selectionMode, $selectionWidth, $selectionHeight)
    {
        if (!in_array($selectionMode, [
            self::SELECTION_MODE_NORMAL,
            self::SELECTION_MODE_FIXED_RATIO,
            self::SELECTION_MODE_FIXED_SIZE
        ])) {
            throw new ApplicationException('Invalid input data');
        }

        if (strlen($selectionWidth) && !ctype_digit($selectionWidth)) {
            throw new ApplicationException('Invalid input data');
        }

        if (strlen($selectionHeight) && !ctype_digit($selectionHeight)) {
            throw new ApplicationException('Invalid input data');
        }

        $this->putSession('media_crop_selection_params', [
            'mode'   => $selectionMode,
            'width'  => $selectionWidth,
            'height' => $selectionHeight
        ]);
    }
protected function setSelectionParams($selectionMode, $selectionWidth, $selectionHeight)
    {
        if (!in_array($selectionMode, [
            self::SELECTION_MODE_NORMAL,
            self::SELECTION_MODE_FIXED_RATIO,
            self::SELECTION_MODE_FIXED_SIZE
        ])) {
            throw new ApplicationException('Invalid input data');
        }

        if (strlen($selectionWidth) && !ctype_digit($selectionWidth)) {
            throw new ApplicationException('Invalid input data');
        }

        if (strlen($selectionHeight) && !ctype_digit($selectionHeight)) {
            throw new ApplicationException('Invalid input data');
        }

        $this->putSession('media_crop_selection_params', [
            'mode'   => $selectionMode,
            'width'  => $selectionWidth,
            'height' => $selectionHeight
        ]);
    }
protected function setSelectionParams ( $ selectionMode , $ selectionWidth , $ selectionHeight ) { if ( ! in_array ( $ selectionMode , [ self :: SELECTION_MODE_NORMAL , self :: SELECTION_MODE_FIXED_RATIO , self :: SELECTION_MODE_FIXED_SIZE ] ) ) { throw new ApplicationException ( 'Invalid input data' ) ; } if ( strlen ( $ selectionWidth ) && ! ctype_digit ( $ selectionWidth ) ) { throw new ApplicationException ( 'Invalid input data' ) ; } if ( strlen ( $ selectionHeight ) && ! ctype_digit ( $ selectionHeight ) ) { throw new ApplicationException ( 'Invalid input data' ) ; } $ this -> putSession ( 'media_crop_selection_params' , [ 'mode' => $ selectionMode , 'width' => $ selectionWidth , 'height' => $ selectionHeight ] ) ; }
Stores the user selection parameters in the session state
@param string $selectionMode
@param int $selectionWidth
@param int $selectionHeight
@return void
Stores the user selection parameters in the session state