1: <?php
2: /**
3: * Demo product service.
4: *
5: * Here you can add a short overview or tutorial of how provided methods can be utilized
6: * by the consumer.
7: *
8: *
9: * @package RestApi.Services
10: * @author Konstantinos Filios <konfilios@gmail.com>
11: */
12: class ProductController extends CBJsonController
13: {
14: /**
15: * Find products.
16: *
17: * @param ProductQueryJson $queryJson Query criteria
18: * @return ProductJson[] Matching products
19: */
20: public function actionFindProduct(ProductQueryJson $queryJson)
21: {
22: $foundProducts = Product::model()->scopeApplyQuery($queryJson)->findAll();
23:
24: return ProductJson::createFromMany($foundProducts);
25: }
26: }
27:
28: