Skip to content

Instantly share code, notes, and snippets.

@adatta02
Last active December 11, 2015 01:58
Show Gist options
  • Save adatta02/4526962 to your computer and use it in GitHub Desktop.
Save adatta02/4526962 to your computer and use it in GitHub Desktop.
<?php
class <className> extends EntityRepository
{
}';
public function generateEntityRepositoryClass($fullClassName)
{
$namespace = substr($fullClassName, 0, strrpos($fullClassName, '\\'));
$className = substr($fullClassName, strrpos($fullClassName, '\\') + 1, strlen($fullClassName));
$variables = array(
'<namespace>' => $namespace,
'<className>' => $className
);
return str_replace(array_keys($variables), array_values($variables), self::$_template);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment