Skip to content

Commit

Permalink
simplify sample code
Browse files Browse the repository at this point in the history
the getSubject() method does pretty much what is shown in the example.
  • Loading branch information
Grégoire Paris authored and rande committed Mar 16, 2015
1 parent b085e91 commit 923b13c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Resources/doc/cookbook/recipe_custom_action.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ to implement a ``clone`` action.
{
public function cloneAction()
{
$id = $this->get('request')->get($this->admin->getIdParameter());
$object = $this->admin->getObject($id);
$object = $this->admin->getSubject();
if (!$object) {
throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
Expand Down

0 comments on commit 923b13c

Please sign in to comment.