O'Reilly logo

Zend Framework 2.0 by Example Beginner's Guide by Krishna Shasankar V

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – implementing an admin UI to manage users

In this task we will be creating an administration user interface for managing users in our application. The following operations will include listing all users, editing existing users, deleting users, and adding users:

  1. Modify CommunicationApp/module/Users/src/Users/Model/UserTable.php using the following code. Add the following functions:
    • fetchAll()
    • getUser($id)
    • getUserByEmail($userEmail)
    • deleteUser($id)
      public function fetchAll() { $resultSet = $this->tableGateway->select(); return $resultSet; } public function getUser($id) { $id = (int) $id; $rowset = $this->tableGateway->select(array('id' => $id)); $row = $rowset->current(); if (!$row) { throw new \Exception("Could not find row $id"); } ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required