<?php

namespace App\Providers\ExcelGroupReport;

class NotificationCells {

    public function run ($oGroup) {
        $height = 11;

        $oNotification = $oGroup->Notification;
        $result = [];
        for ($i = 0; $i < $height - 1; $i++) {
            $result[] = [];
        }
        
        $result[] = [
            [[ 'action' => 'print', 'text' => 'NOTIFICACIONES'], [ 'action' => 'merge', 'lines' => 1]],
        ];
        $result[] = [
            [[ 'action' => 'print', 'text' => 'REMITENTE'], [ 'action' => 'merge', 'lines' => 1]],
            [[ 'action' => 'print', 'text' => 'DESCRIPCIÓN'], [ 'action' => 'merge', 'lines' => 4]],
            [[ 'action' => 'print', 'text' => 'FECHA']],
        ];
        $length = count($oNotification);
        foreach ($oNotification as $note) {
            $result[] = [
                [[ 'action' => 'print', 'text' => "$note->Create_Name $note->Create_LastName" ], [ 'action' => 'merge', 'lines' => 1]],
                [[ 'action' => 'print', 'text' => $note->Notification_Description], [ 'action' => 'merge', 'lines' => 4]],
                [[ 'action' => 'print', 'text' => $note->Notification_DateCreate]]
            ];
        }
        return $result;
    }

}