Skip to content

Commit

Permalink
Some more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Apr 10, 2012
1 parent 351ede6 commit 6f47f10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/CarDealer/Basic/UpdateScenario.php
Expand Up @@ -15,12 +15,15 @@ public function play(EntityManager $entityManager, InputInterface $input)
throw new \InvalidArgumentException("Ein Parameter ID, 'feldName' und 'value' wird erwartet.");
}
echo "Update Entitaet mit ID $id#$name auf wert $value\n";
$method = "set" . $args[0];
$value = $args[1];
$id = $args[0];
$method = "set" . $args[1];
$value = $args[2];

// 1. entity aus datenbank holen

$object->$method($value);

$entityManager->flush();
}
}

3 changes: 3 additions & 0 deletions lib/CarDealer/Basic/ViewScenario.php
Expand Up @@ -17,6 +17,9 @@ public function play(EntityManager $entityManager, InputInterface $input)

// 1. entity aus datenbank holen
// 2. entity anzeigen
$vehicle = $entityManager->find('CarDealer\Basic\Vehicle', $id);

echo "The price is: " . $vehicle->getPrice() . "\n";
}
}

0 comments on commit 6f47f10

Please sign in to comment.