Esempio n. 1
0
 public static function getType($filter = null)
 {
     if (is_null($filter)) {
         $c = Assettype::get();
     } else {
         $c = Assettype::whereRaw($filter)->get();
     }
     self::$rack = $c;
     return new self();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $key = Input::get('key');
     $user = \Apiauth::user($key);
     $type = \Assettype::get();
     for ($i = 0; $i < count($type); $i++) {
         $type[$i]->extId = $type[$i]->_id;
         unset($type[$i]->_id);
         unset($type[$i]->_token);
         $type[$i]->createdDate = date('Y-m-d H:i:s', $type[$i]->createdDate->sec);
         $type[$i]->lastUpdate = date('Y-m-d H:i:s', $type[$i]->lastUpdate->sec);
     }
     $actor = $user->fullname . ' : ' . $user->email;
     \Event::fire('log.api', array($this->controller_name, 'get', $actor, 'rack list'));
     return $type;
 }