Stratadox/TableLoader

View on GitHub
contracts/Loader/MakesObjects.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Stratadox\TableLoader\Loader;

use Stratadox\IdentityMap\MapsObjectsByIdentity as Map;
use Stratadox\TableLoader\Loader\ContainsResultingObjects as Result;

/**
 * Makes partially hydrated objects from an input array.
 *
 * @author Stratadox
 */
interface MakesObjects
{
    /**
     * Makes objects from the input array.
     *
     * @param array[] $input   Table-like data as list of maps.
     * @param Map     $map     The identity map with existing objects.
     * @return Result          The resulting objects.
     * @throws CannotLoadTable When the input could not be mapped.
     */
    public function from(array $input, Map $map): Result;
}