/** * Get FQCN of specified entity * * @param object $object * @param bool $escape Set TRUE to escape the class name for insertion into a route, * replacing \ with _ characters * * @return string */ public function getClassName($object, $escape = false) { if (!is_object($object)) { return null; } $className = ClassUtils::getRealClass($object); return $escape ? $this->entityRoutingHelper->encodeClassName($className) : $className; }
/** * @dataProvider encodeClassNameProvider */ public function testEncodeClassName($src, $expected) { $this->assertEquals($expected, $this->entityRoutingHelper->encodeClassName($src)); }