# quadmenu/3.3.7/vendor/franmastromarino/wp-orm/src/Mapper/SingleMapper.php

QuadMenu – Mega Menu, version 3.3.7. 30 lines.

- Page: https://pluginprobe.com/plugins/quadmenu/3.3.7/code/vendor/franmastromarino/wp-orm/src/Mapper/SingleMapper.php
- Raw: https://pluginprobe.com/plugins/quadmenu/3.3.7/raw/vendor/franmastromarino/wp-orm/src/Mapper/SingleMapper.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.7/code/vendor/franmastromarino/wp-orm/src/Mapper/SingleMapper.php#L10-L20`.

```php
<?php

namespace QuadLayers\WP_Orm\Mapper;

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

class SingleMapper implements SingleMapperInterface
{
    /**
     * @var SingleFactory
     */
    private $factory;

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

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

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

```
