コード例 #1
0
function drawTable($row)
{
    print "<table>";
    drawRow($row[0]);
    drawRow($row[1]);
    drawRow($row[2]);
    print "</table>";
}
コード例 #2
0
function generateRepository($table, $className, $entity_name)
{
    if ($entity_name === null) {
        return;
    }
    if (!file_exists(REPOSITORY_PATH . $className . '.php')) {
        // Repozitář
        $properties = " * @table {$table}\n * @entity \\" . NS . 'Model\\Entity\\' . $entity_name;
        $buffer = "namespace " . NS . "Model\\Repository;\n\n/**\n{$properties}\n */\nfinal class {$className} extends Base\n{\n\n}";
        file_put_contents(REPOSITORY_PATH . $className . '.php', "<?php\n\n{$buffer}\n");
        drawRow("Repository '{$className}' generated");
    } else {
        drawRow("Repository '{$className}' exist");
    }
    return;
}