protected function mapEntityToObject(array $mapping, $entity, \stdClass $data)
    {
        foreach ($mapping as $dataProperty => $map) {
            $value = null;
            if (is_string($map)) {
                // Retrieve the entity getter
                $getter = $this->getEntityGetter($entity, $map);

                // Inject data into object
                $value = call_user_func([$entity, $getter]);
            } elseif (is_callable($map)) {
                // Call the defined function
                $value = call_user_func($map, $entity);
            }

            $data->{$dataProperty} = $value;
        }

        return $data;
    }