@@ 150-155 (lines=6) @@ | ||
147 | } |
|
148 | $object = new Model(array('name' => $className, 'table' => $table, 'ds' => $this->connection)); |
|
149 | $fields = $object->schema(true); |
|
150 | foreach ($fields as $name => $field) { |
|
151 | if (isset($field['key']) && $field['key'] === 'primary') { |
|
152 | $object->primaryKey = $name; |
|
153 | break; |
|
154 | } |
|
155 | } |
|
156 | return $object; |
|
157 | } |
|
158 | ||
@@ 315-319 (lines=5) @@ | ||
312 | */ |
|
313 | public function findPrimaryKey($fields) { |
|
314 | $name = 'id'; |
|
315 | foreach ($fields as $name => $field) { |
|
316 | if (isset($field['key']) && $field['key'] === 'primary') { |
|
317 | break; |
|
318 | } |
|
319 | } |
|
320 | return $this->in(__d('cake_console', 'What is the primaryKey?'), null, $name); |
|
321 | } |
|
322 |