Exemplo n.º 1
0
 public static function testget()
 {
     return function ($request, $response) {
         $brand = Brand::findById($request->id);
         echo $brand;
     };
 }
Exemplo n.º 2
0
 public function setBrand($value)
 {
     if ($value instanceof Brand) {
         $this->_orm->brand_id = $value->id;
         return true;
     }
     $brand = Brand::findById($value);
     if ($brand) {
         $this->_orm->brand_id = $value;
         return true;
     } else {
         throw new Exception("Brand does not exist");
     }
 }
Exemplo n.º 3
0
<?php

require "../brand.php";
//$brand = new Brand();
//$brand->name = "Avon Naturals";
//$brand->save();
$brand = Brand::findById(3);
echo $brand->products[1]->as_joined_json();