src/Controller.php
private function models($controller)
    {
        $properties = $controller::$properties;
        $module = $this->name($controller);

        $models = [];

        foreach ((array) U::array_value($properties, 'models') as $model) {
            $modelClassName = '\\app\\'.$module.'\\models\\'.$model;

            $info = $modelClassName::metadata();

            $models[ $model ] = array_replace($info, [
                'route_base' => '/'.$module.'/'.$info[ 'plural_key' ], ]);
        }

        return $models;
    }
private function models($controller)
    {
        $properties = $controller::$properties;
        $module = $this->name($controller);

        $models = [];

        foreach ((array) U::array_value($properties, 'models') as $model) {
            $modelClassName = '\\app\\'.$module.'\\models\\'.$model;

            $info = $modelClassName::metadata();

            $models[ $model ] = array_replace($info, [
                'route_base' => '/'.$module.'/'.$info[ 'plural_key' ], ]);
        }

        return $models;
    }
private function models ( $ controller ) { $ properties = $ controller :: $ properties ; $ module = $ this -> name ( $ controller ) ; $ models = [ ] ; foreach ( ( array ) U :: array_value ( $ properties , 'models' ) as $ model ) { $ modelClassName = '\\app\\' . $ module . '\\models\\' . $ model ; $ info = $ modelClassName :: metadata ( ) ; $ models [ $ model ] = array_replace ( $ info , [ 'route_base' => '/' . $ module . '/' . $ info [ 'plural_key' ] , ] ) ; } return $ models ; }
Fetches the models for a given controller.

@param object $controller

@return array
Fetches the models for a given controller .