<?php
$maxInsertRowsCount = 0;
if ($leftItem) {
    if ($isLR) {
        $style = [
            'image' => [
                'col' => 3,
                'top' => true,
                'offsetX' => 32,
                'height' => 80,
            ],
        ];
        $back = $this->insertAny($sheet, $this->rowNum, $leftItem, $style);
        if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
        $style = [
            'image' => [
                'col' => false,
                'top' => true,
                'offsetX' => 32,
                'height' => 80,

                'flip' => true,
                'flipCol' => 7,
                'flipOffsetX' => 32,
            ],
        ];
        $back = $this->insertAny($sheet, $this->rowNum, $leftItem, $style);
        if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
    } else {
        $style = [
            'image' => [
                'col' => 3,
                'top' => true,
                'offsetX' => 32,
                'height' => 80,
            ],
        ];
        $back = $this->insertAny($sheet, $this->rowNum, $leftItem, $style);
        if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
        if ($rightItem) {
            $style = [
                'image' => [
                    'col' => 7,
                    'top' => true,
                    'offsetX' => 0,
                    'height' => 80,
                ],
            ];
            $back = $this->insertAny($sheet, $this->rowNum, $rightItem, $style);
            if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
        }
    }
}