[SOLVED] Importing exported classes (json) by php code to deployment

hello all,
i have to create my own classes on plugin initialization.
i export my own classes to json files and i want to import them by php code. is it possible??
any suggestion to create a classes by php code plugin initialization?

function createClass($pClassName,$pFilePath)
$class = \Pimcore\Model\Object\ClassDefinition::getByName($pClassName);
if (!$class) {
$class = new \Pimcore\Model\Object\ClassDefinition();

    $json = file_get_contents($pFilePath);
    $success = \Pimcore\Model\Object\ClassDefinition\Service::importClassDefinitionFromJson($class, $json);
    if (!$success) {
    return false;
    return true;