Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CakeSchema updated for 2.0

Converting var to public.
Fixes #2276

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information...
commit 58a2ee064cad12b4725b813852668172f5c0560a 1 parent 02efc24
@dereuromark dereuromark authored markstory committed
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/Cake/Model/CakeSchema.php
View
14 lib/Cake/Model/CakeSchema.php
@@ -351,21 +351,21 @@ public function write($object, $options = array()) {
get_object_vars($this), $options
));
- $out = "class {$name}Schema extends CakeSchema {\n";
+ $out = "class {$name}Schema extends CakeSchema {\n\n";
if ($path !== $this->path) {
- $out .= "\tvar \$path = '{$path}';\n\n";
+ $out .= "\tpublic \$path = '{$path}';\n\n";
}
if ($file !== $this->file) {
- $out .= "\tvar \$file = '{$file}';\n\n";
+ $out .= "\tpublic \$file = '{$file}';\n\n";
}
if ($connection !== 'default') {
- $out .= "\tvar \$connection = '{$connection}';\n\n";
+ $out .= "\tpublic \$connection = '{$connection}';\n\n";
}
- $out .= "\tfunction before(\$event = array()) {\n\t\treturn true;\n\t}\n\n\tfunction after(\$event = array()) {\n\t}\n\n";
+ $out .= "\tpublic function before(\$event = array()) {\n\t\treturn true;\n\t}\n\n\tpublic function after(\$event = array()) {\n\t}\n\n";
if (empty($tables)) {
$this->read();
@@ -379,7 +379,7 @@ public function write($object, $options = array()) {
$out .= "}\n";
$file = new SplFileObject($path . DS . $file, 'w+');
- $content = "<?php \n/* {$name} schema generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n{$out}?>";
+ $content = "<?php \n/* generated on: " . date('Y-m-d H:i:s') . " : ". time() . " */\n{$out}";
if ($file->fwrite($content)) {
return $content;
}
@@ -395,7 +395,7 @@ public function write($object, $options = array()) {
* @return string Variable declaration for a schema class
*/
public function generateTable($table, $fields) {
- $out = "\tvar \${$table} = array(\n";
+ $out = "\tpublic \${$table} = array(\n";
if (is_array($fields)) {
$cols = array();
foreach ($fields as $field => $value) {
Please sign in to comment.
Something went wrong with that request. Please try again.