Пример #1
0
 public function get($id)
 {
     if ($object = Object::select(array('objects.id', 'objects.name', 'objects.title', 'objects.excerpt'))->where('id', $id)->first()) {
         $this->processObject($object);
         return $object;
     }
 }
Пример #2
0
 public function getCategory($id)
 {
     if ($category = Object::select(array('objects.id', 'objects.name', 'objects.title', 'objects.excerpt'))->where('id', $id)->first()) {
         return response()->json($this->processCategory($category));
     }
 }
Пример #3
0
 public function get($id)
 {
     $object = Object::select(array('objects.id', 'obj.id AS objectTypeID', 'objects.type', 'objects.name', 'objects.title', 'objects.excerpt', 'objects.content', 'objects.score'))->join('objects as obj', function ($join) {
         $join->on('obj.name', '=', DB::raw("concat( '_object_type_', objects.type )"));
     })->where('objects.id', $id)->first();
     if ($object) {
         $this->processObject2($object);
         return $object;
     }
 }