<?php

namespace App\Classes\Modules\Companies\Services;

use App\Classes\Modules\Companies\DataTransferObjects\ConnectionObject;
use App\Classes\ValueObjects\Constants\ConnectionStatus;

class CreatesCompanyConnection
{

    public function execute(ConnectionObject $connection){
        $connection->getInviter()->connections()->attach($connection->getInvitee(),
            [
                'status' => ConnectionStatus::APPROVED,
                'instigator' => $connection->getInvitee()->id
            ]
        );
    }

}