Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

Commit

Permalink
Add missing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Apr 8, 2013
1 parent 266af93 commit 4ea14ae
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions show_product.php
@@ -0,0 +1,13 @@
<?php
// show_product.php <id>
require_once "bootstrap.php";

$id = $argv[1];
$product = $entityManager->find('Product', $id);

if ($product === null) {
echo "No product found.\n";
exit(1);
}

echo sprintf("-%s\n", $product->getName());
17 changes: 17 additions & 0 deletions update_product.php
@@ -0,0 +1,17 @@
<?php
// update_product.php <id> <new-name>
require_once "bootstrap.php";

$id = $argv[1];
$newName = $argv[2];

$product = $entityManager->find('Product', $id);

if ($product === null) {
echo "Product $id does not exist.\n";
exit(1);
}

$product->setName($newName);

$entityManager->flush();

1 comment on commit 4ea14ae

@amegha2805
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @beberlei ,

In a project's source code, there are some classes having some methods and variables that are auto-generated by Doctrine ORM Framework, whose body definitions are difficult to find.
Are you having any idea of where are the body definitions of the methods provided by ORM Doctrine Framework and how to edit them ?

Regards,
Megha

Please sign in to comment.