1
0
mirror of synced 2025-01-31 04:21:44 +03:00

Fixing issue with EntityGenerator spaces

This commit is contained in:
Jonathan H. Wage 2010-04-14 14:17:55 -04:00
parent 3afc8f794a
commit ac4e33d056

View File

@ -192,8 +192,7 @@ public function <methodName>()
'<use>', '<use>',
'<entityAnnotation>', '<entityAnnotation>',
'<entityClassName>', '<entityClassName>',
'<entityBody>', '<entityBody>'
'<spaces>'
); );
$replacements = array( $replacements = array(
@ -201,11 +200,11 @@ public function <methodName>()
$this->_generateEntityUse($metadata), $this->_generateEntityUse($metadata),
$this->_generateEntityDocBlock($metadata), $this->_generateEntityDocBlock($metadata),
$this->_generateEntityClassName($metadata), $this->_generateEntityClassName($metadata),
$this->_generateEntityBody($metadata), $this->_generateEntityBody($metadata)
$this->_spaces
); );
return str_replace($placeHolders, $replacements, self::$_classTemplate); $code = str_replace($placeHolders, $replacements, self::$_classTemplate);
return str_replace('<spaces>', $this->_spaces, $code);
} }
/** /**
@ -220,9 +219,10 @@ public function <methodName>()
$currentCode = file_get_contents($path); $currentCode = file_get_contents($path);
$body = $this->_generateEntityBody($metadata); $body = $this->_generateEntityBody($metadata);
$body = str_replace('<spaces>', $this->_spaces, $body);
$last = strrpos($currentCode, '}'); $last = strrpos($currentCode, '}');
return substr($currentCode, 0, $last) . $body . '}'; return substr($currentCode, 0, $last) . $body . "\n}";
} }
/** /**