public static function getClassNameFromFile($file, $classesDir)
    {
        $className = substr($file, strlen($classesDir)); // get path after the model directory
        $className = preg_replace("/^\//", '', $className); // remove any forward slash at the begining
        $className = preg_replace("/\//", '\\', $className); // change forward slash to backslash slash

        $className = preg_replace('/.php$/', '', $className); // remove extension.

        return $className;
    }