/** * @param string $format * * @return string */ public function getResourceLocation($format = 'bundle') { $reflection = new \ReflectionClass(get_class($this)); $namespace = $reflection->getNamespaceName(); switch ($format) { case 'bundle': return Parser::getBundleClass($namespace); break; case 'namespace': return $namespace; break; } }
/** * @param string $bundle * @param string $filepath * * @return string */ public static function getFilePath($bundle, $filepath) { $bundleclass = Parser::getBundleClass($bundle); $reflection = new \ReflectionClass($bundleclass); return dirname($reflection->getFileName()) . '/' . $filepath; }