Clockwork\Request\Request::toArray PHP Метод

toArray() публичный Метод

Return request data as an array
public toArray ( )
    public function toArray()
    {
        return ['id' => $this->id, 'time' => $this->time, 'method' => $this->method, 'uri' => $this->uri, 'headers' => $this->headers, 'controller' => $this->controller, 'getData' => $this->getData, 'postData' => $this->postData, 'sessionData' => $this->sessionData, 'cookies' => $this->cookies, 'responseTime' => $this->responseTime, 'responseStatus' => $this->responseStatus, 'responseDuration' => $this->getResponseDuration(), 'databaseQueries' => $this->databaseQueries, 'databaseDuration' => $this->getDatabaseDuration(), 'timelineData' => $this->timelineData, 'log' => array_values($this->log), 'routes' => $this->routes, 'emailsData' => $this->emailsData, 'viewsData' => $this->viewsData, 'userData' => $this->userData];
    }

Usage Example

Пример #1
0
 /**
  * Store the request in the database
  */
 public function store(Request $request)
 {
     $data = $this->applyFilter($request->toArray());
     foreach ($this->needs_serialization as $key) {
         $data[$key] = @json_encode($data[$key]);
     }
     $data['version'] = Clockwork::VERSION;
     $stmt = $this->pdo->prepare("INSERT INTO {$this->table} " . '(id, version, time, method, uri, headers, controller, getData, postData, sessionData, cookies, responseTime, responseStatus, responseDuration, databaseQueries, databaseDuration, timelineData, log, routes, emailsData, viewsData, userData) ' . 'VALUES ' . '(:id, :version, :time, :method, :uri, :headers, :controller, :getData, :postData, :sessionData, :cookies, :responseTime, :responseStatus, :responseDuration, :databaseQueries, :databaseDuration, :timelineData, :log, :routes, :emailsData, :viewsData, :userData)');
     $stmt->execute($data);
 }
All Usage Examples Of Clockwork\Request\Request::toArray