Skip to content

Commit

Permalink
Example.php: Some comment modifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivantcholakov committed Jul 23, 2015
1 parent 83f0c1c commit c82d05e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/controllers/api/Example.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function __construct()
public function users_get()
{
// Users from a data store e.g. database
// $user = $this->some_model->getSomething($id);
$users = [
['id' => 1, 'name' => 'John', 'email' => 'john@example.com', 'fact' => 'Loves coding'],
['id' => 2, 'name' => 'Jim', 'email' => 'jim@example.com', 'fact' => 'Developed on CodeIgniter'],
Expand All @@ -42,7 +41,8 @@ public function users_get()

$id = $this->get('id');

// If the id parameter and query parameter don't exist, return all users instead
// If the id parameter doesn't exist return all the users

if ($id === NULL)
{
// Check if the users data store contains users (in case the database result returns NULL)
Expand All @@ -61,6 +61,8 @@ public function users_get()
}
}

// Find and return a single record for a particular user.

$id = (int) $id;

// Validate the id.
Expand Down

0 comments on commit c82d05e

Please sign in to comment.