mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Added message when no result set is found
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5187 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
aef4b1b21b
commit
06e728eebb
1 changed files with 24 additions and 20 deletions
|
@ -100,15 +100,31 @@ class ConsoleShell extends Shell {
|
|||
if (strpos($command, "->find") > 0) {
|
||||
$consoleCommand = '$data = $this->' . $command . ";";
|
||||
eval($consoleCommand);
|
||||
|
||||
if (is_array($data)) {
|
||||
foreach ($data as $idx => $results) {
|
||||
if (is_numeric($idx)) { // findAll() output
|
||||
foreach ($results as $modelName => $result) {
|
||||
$this->out("$modelName");
|
||||
|
||||
foreach ($data as $idx => $results) {
|
||||
if (is_numeric($idx)) { // findAll() output
|
||||
foreach ($results as $modelName => $result) {
|
||||
$this->out("$modelName");
|
||||
foreach ($result as $field => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach($value as $field2 => $value2) {
|
||||
$this->out("\t$field2: $value2");
|
||||
}
|
||||
|
||||
foreach ($result as $field => $value) {
|
||||
$this->out("");
|
||||
} else {
|
||||
$this->out("\t$field: $value");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else { // find() output
|
||||
$this->out($idx);
|
||||
|
||||
foreach($results as $field => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach($value as $field2 => $value2) {
|
||||
foreach ($value as $field2 => $value2) {
|
||||
$this->out("\t$field2: $value2");
|
||||
}
|
||||
|
||||
|
@ -118,21 +134,9 @@ class ConsoleShell extends Shell {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else { // find() output
|
||||
$this->out($idx);
|
||||
|
||||
foreach($results as $field => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $field2 => $value2) {
|
||||
$this->out("\t$field2: $value2");
|
||||
}
|
||||
|
||||
$this->out("");
|
||||
} else {
|
||||
$this->out("\t$field: $value");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->out("\nNo result set found");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue