# quadmenu/3.3.6/vendor/franmastromarino/wp-orm/src/Mapper/CollectionMapper.php

QuadMenu – Mega Menu, version 3.3.6. 30 lines.

- Page: https://pluginprobe.com/plugins/quadmenu/3.3.6/code/vendor/franmastromarino/wp-orm/src/Mapper/CollectionMapper.php
- Raw: https://pluginprobe.com/plugins/quadmenu/3.3.6/raw/vendor/franmastromarino/wp-orm/src/Mapper/CollectionMapper.php
- Modified: 2025-11-15T21:00:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/quadmenu/3.3.6/code/vendor/franmastromarino/wp-orm/src/Mapper/CollectionMapper.php#L10-L20`.

```php
<?php

namespace QuadLayers\WP_Orm\Mapper;

use QuadLayers\WP_Orm\Entity\EntityInterface;
use QuadLayers\WP_Orm\Factory\CollectionFactory;

class CollectionMapper implements CollectionMapperInterface
{
     /**
     * @var CollectionFactory
     */
    private $factory;

    public function __construct(CollectionFactory $factory)
    {
        $this->factory = $factory;
    }

    public function toEntity(array $data): EntityInterface
    {
        return $this->factory->create($data);
    }

    public function toArray(EntityInterface $single): array
    {
        return $single->getModifiedProperties();
    }
}

```
