Invite::get PHP Method

get() public method

public get ( $id )
    public function get($id)
    {
        $sth = $this->db->prepare('SELECT * FROM invites WHERE id = ?');
        $sth->bindParam(1, $id, PDO::PARAM_INT);
        $sth->execute();
        $res = $sth->fetch(PDO::FETCH_ASSOC);
        if (!$res) {
            throw new Exception(L::get("INVITE_NOT_FOUND"), 404);
        }
        return $res;
    }

Usage Example

Example #1
0
 /**
  * Get the list of all security groups
  * @return getGroups view
  */
 public function getGroups()
 {
     //Get All security groups
     $ec2 = App::make('aws')->get('ec2');
     $security_groups = $ec2->describeSecurityGroups();
     $security_groups = $security_groups['SecurityGroups'];
     //Get all active leases
     $leases = Lease::get();
     //get all active Invites
     $invites = Invite::get();
     return View::make('getGroups')->with('security_groups', $security_groups)->with('leases', $leases)->with('invites', $invites);
 }