Update EntityRepository.php

Add ability to generate classMetadata without push it in constructor
This is a logical flaw, as `$this->_entityName` is undefined if `$class` is `null`.