public function loadUser(EventInterface $event) {
        $request = $event->getRequest();
        $response = $event->getResponse();
        $user = $request->getUser();
        $database = $event->getDatabase();

        $numImages = $database->getNumImages($user);
        $lastModified = $database->getLastModified([$user]);

        $userModel = new Model\User();
        $userModel->setUserId($user)
                  ->setNumImages($numImages)
                  ->setLastModified($lastModified);

        $response->setModel($userModel)
                 ->setLastModified($lastModified);
    }
public function loadUser(EventInterface $event) {
        $request = $event->getRequest();
        $response = $event->getResponse();
        $user = $request->getUser();
        $database = $event->getDatabase();

        $numImages = $database->getNumImages($user);
        $lastModified = $database->getLastModified([$user]);

        $userModel = new Model\User();
        $userModel->setUserId($user)
                  ->setNumImages($numImages)
                  ->setLastModified($lastModified);

        $response->setModel($userModel)
                 ->setLastModified($lastModified);
    }
public function loadUser ( EventInterface $ event ) { $ request = $ event -> getRequest ( ) ; $ response = $ event -> getResponse ( ) ; $ user = $ request -> getUser ( ) ; $ database = $ event -> getDatabase ( ) ; $ numImages = $ database -> getNumImages ( $ user ) ; $ lastModified = $ database -> getLastModified ( [ $ user ] ) ; $ userModel = new Model \ User ( ) ; $ userModel -> setUserId ( $ user ) -> setNumImages ( $ numImages ) -> setLastModified ( $ lastModified ) ; $ response -> setModel ( $ userModel ) -> setLastModified ( $ lastModified ) ; }
Load user data

@param EventInterface $event An event instance
Load user data