Skip to content

Commit

Permalink
Now the tableParameters array gets escaped through values(), too
Browse files Browse the repository at this point in the history
  • Loading branch information
ravage84 committed Oct 16, 2014
1 parent b377097 commit 2ad181b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/Cake/Model/CakeSchema.php
Expand Up @@ -397,8 +397,10 @@ public function write($object, $options = array()) {
}

/**
* Generate the code for a table. Takes a table name and $fields array
* Returns a completed variable declaration to be used in schema classes.
* Generate the schema code for a table.
*
* Takes a table name and $fields array and returns a completed,
* escaped variable declaration to be used in schema classes.
*
* @param string $table Table name you want returned.
* @param array $fields Array of field information to generate the table with.
Expand Down Expand Up @@ -426,10 +428,7 @@ public function generateTable($table, $fields) {
$col .= implode(",\n\t\t\t", $props) . "\n\t\t";
} elseif ($field === 'tableParameters') {
$col = "\t\t'tableParameters' => array(";
$props = array();
foreach ((array)$value as $key => $param) {
$props[] = "'{$key}' => '$param'";
}
$props = $this->_values($value);
$col .= implode(', ', $props);
}
$col .= ")";
Expand Down

0 comments on commit 2ad181b

Please sign in to comment.