@@ -140,9 +140,10 @@ is pretty easy. Add the following method to the ``DefaultController`` of the
140
140
bundle::
141
141
142
142
// src/Acme/StoreBundle/Controller/DefaultController.php
143
+
144
+ // ...
143
145
use Acme\StoreBundle\Model\Product;
144
146
use Symfony\Component\HttpFoundation\Response;
145
- // ...
146
147
147
148
public function createAction()
148
149
{
@@ -172,6 +173,7 @@ Fetching an object back from the database is even easier. For example, suppose
172
173
you've configured a route to display a specific ``Product `` based on its ``id ``
173
174
value::
174
175
176
+ // ...
175
177
use Acme\StoreBundle\Model\ProductQuery;
176
178
177
179
public function showAction($id)
@@ -183,7 +185,7 @@ value::
183
185
throw $this->createNotFoundException('No product found for id '.$id);
184
186
}
185
187
186
- // do something, like pass the $product object into a template
188
+ // ... do something, like pass the $product object into a template
187
189
}
188
190
189
191
Updating an Object
@@ -192,6 +194,7 @@ Updating an Object
192
194
Once you've fetched an object from Propel, updating it is easy. Suppose you
193
195
have a route that maps a product id to an update action in a controller::
194
196
197
+ // ...
195
198
use Acme\StoreBundle\Model\ProductQuery;
196
199
197
200
public function updateAction($id)
@@ -252,7 +255,6 @@ If you want to reuse some queries, you can add your own methods to the
252
255
``ProductQuery `` class::
253
256
254
257
// src/Acme/StoreBundle/Model/ProductQuery.php
255
-
256
258
class ProductQuery extends BaseProductQuery
257
259
{
258
260
public function filterByExpensivePrice()
@@ -326,7 +328,6 @@ Now, let's see the code in action. Imagine you're inside a controller::
326
328
use Acme\StoreBundle\Model\Category;
327
329
use Acme\StoreBundle\Model\Product;
328
330
use Symfony\Component\HttpFoundation\Response;
329
- // ...
330
331
331
332
class DefaultController extends Controller
332
333
{
0 commit comments