<?php

namespace KupShop\ApiBundle\Api;

use Luracast\Restler\Explorer\v1\Explorer;

class ApiExplorer extends Explorer
{
    protected function nameModel(array $route)
    {
        $path = explode('\\', $route['className']);

        if (!empty($route['metadata']['className'])) {
            return $route['metadata']['className'];
        }

        if (is_array($path)) {
            return end($path);
        }

        return '';
    }
}
