public function toArray($nesting = false)
    {
        $output = [];
        foreach ($this::getReflection()->getProperties() as $propertyName => $property) {

            $value = $this->{$propertyName};
            if (($value instanceof Entity\Collection || $value instanceof Entity)
                && $nesting
            ) {
                $output[$propertyName] = $value->toArray($nesting);
            } else {
                $output[$propertyName] = $value;
            }
        }

        return $output;
    }