Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 793 Bytes

array-to-dto.md

File metadata and controls

37 lines (30 loc) · 793 Bytes
<?php

use VKMapperBundle\Annotation\MappingMeta\DestinationClass;
use VKMapperBundle\Annotation\MappingMeta\EmbeddedClass;
use VKMapperBundle\Annotation\MappingMeta\EmbeddedCollection;
use DataMapper\MapperInterface;

/**
 * Class MappedRelationsRootDto
 *
 * @DestinationClass()
 */
class MappedRelationsRootDto
{
    /**
     * @EmbeddedClass(target="Tests\DataFixtures\Dto\MappedRelationsNodeDto")
     */
    public $nodeA;

    /**
     * @EmbeddedClass(target="Tests\DataFixtures\Dto\MappedRelationsNodeDto")
     */
    public $nodeB;

    /**
     * @EmbeddedCollection(target="Tests\DataFixtures\Model\Relations\MappedRelationsNodeInfo")
     */
    public $event = [];
}

/** @var MapperInterface $mapper */
$mapper->convert($array, $mappedRelationsRootDto);

back