Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
sbellity committed Oct 25, 2013
1 parent 8bb34e6 commit 842b83d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ API (GET) responses will be cached in Memcached if caching is enabled.
<?php
$oahu->get('projects', array('limit' => 10, 'page' => 2))

### Getting the current User if connected via Oahu connect

$accountId = $oahu->validateUserAccount();
### Getting the infos on a User Account by its id

$accountInfos = $oahu->getAccount($accountId);

### Getting the current User Account if connected via Oahu connect

$accountInfos = $oahu->getCurrentAccount();

### APIs

* [Clients](docs/clients.md)
Expand Down
10 changes: 10 additions & 0 deletions src/Oahu/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ public function validateUserAccount($account_object=null){
}
}

public function getAccount($accountId) {
return $this->_get('accounts/' . $accountId);
}

public function getCurrentAccount() {
$accountId = $this->validateUserAccount();
if ($accountId) {
return $this->getAccount($accountId);
}
}

// Project API
public function listProjects($params=array()) {
Expand Down

0 comments on commit 842b83d

Please sign in to comment.