Skip to content

Commit

Permalink
- Added a php-doc notice that the file is automatically generated and…
Browse files Browse the repository at this point in the history
… may not be modified

- Generated code indentation
  • Loading branch information
rhm-manuel committed Aug 17, 2015
1 parent 1916b9b commit ebf3185
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
2 changes: 2 additions & 0 deletions lib/SAP/Compiler/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ private function generate($moduleName, array $metaData, $className, $methodName)
$construct = '';
$doc = array();
$doc[] = '/**';
$doc[] = ' * DO NOT EDIT THIS FILE - IT WAS CREATED BY SAPRFCDAL\'S GENERATOR';
$doc[] = ' * ';
foreach ($metaData['def'] as $k => $definition) {
$definitionName = $definition['name'];
if (empty($definitionName)) {
Expand Down
9 changes: 4 additions & 5 deletions lib/SAP/Compiler/Templates/Export.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{$properties}

class SAP_Export_{$moduleName}_{$name} extends SAP_Export_Abstract {
public function __construct() {
$this->setName('{$nameRaw}');
$this->setIsOptional({$isOptional});
{$columns}
public function __construct() {
$this->setName('{$nameRaw}');
$this->setIsOptional({$isOptional});
{$columns}
}

}
11 changes: 5 additions & 6 deletions lib/SAP/Compiler/Templates/Import.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{$properties}

class SAP_Import_{$moduleName}_{$name} extends SAP_Import_Abstract {
public function __construct() {
$this->setName('{$nameRaw}');
$this->setIsOptional({$isOptional});
{$columns}
}
public function __construct() {
$this->setName('{$nameRaw}');
$this->setIsOptional({$isOptional});
{$columns}
}

}
22 changes: 13 additions & 9 deletions lib/SAP/Compiler/Templates/Module.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
/**
* DO NOT EDIT THIS FILE - IT WAS CREATED BY SAPRFCDAL\'S GENERATOR
*
*/
class SAP_Module_{$moduleName} extends SAP_Module_Abstract {
public function __construct() {
$import = {$import}
$export = {$export}
$table = {$table}
public function __construct() {
$import = {$import}
$export = {$export}
$table = {$table}

$this->setModuleName('{$nameRaw}');
$this->setImporter($import);
$this->setExporter($export);
$this->setTables($table);
}
$this->setModuleName('{$nameRaw}');
$this->setImporter($import);
$this->setExporter($export);
$this->setTables($table);
}

}
11 changes: 5 additions & 6 deletions lib/SAP/Compiler/Templates/Table.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{$properties}

class SAP_Table_{$moduleName}_{$name} extends SAP_Table_Abstract {
public function __construct() {
$this->setName('{$nameRaw}');
$this->setIsOptional({$isOptional});
{$columns}
}
public function __construct() {
$this->setName('{$nameRaw}');
$this->setIsOptional({$isOptional});
{$columns}
}

}

0 comments on commit ebf3185

Please sign in to comment.