RedUNIT\Base\Finding::map PHP Method

map() private method

A custom record-to-bean mapping function for findMulti test.
private map ( string $parentName, string $childName ) : array
$parentName string name of the parent bean
$childName string name of the child bean
return array
    private function map($parentName, $childName)
    {
        return array('a' => $parentName, 'b' => $childName, 'matcher' => function ($parent, $child) use($parentName) {
            $property = "{$parentName}ID";
            return $child->{$property} == $parent->id;
        }, 'do' => function ($parent, $child) use($childName) {
            $list = 'own' . ucfirst($childName) . 'List';
            $parent->noLoad()->{$list}[] = $child;
        });
    }