<?php

namespace App\Classes\Modules\Steps;

use App\Classes\Objects\StepObject;
use Carbon\Carbon;

class GenerateSteps
{
    public function execute(array $array) {

        $data = [];

        foreach ($array as $referenceId=>$value){

            $object = new StepObject($referenceId, $value['initial_name'], $value['final_name'], $value['description']);

            $data[] = [
                'reference_id' => $object->getReferenceId(),
                'initial_name' => $object->getInitialName(),
                'final_name' => $object->getFinalName(),
                'description' => $object->getDescription(),
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now()
            ];
        }

        return $data;


    }


}