-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace rock\components; | ||
|
||
|
||
/** | ||
* Linkable is the interface that should be implemented by classes that typically represent locatable resources. | ||
*/ | ||
interface Linkable | ||
{ | ||
/** | ||
* Returns a list of links. | ||
* | ||
* Each link is either a URI or a {@see \rock\helpers\Link} object. The return value of this method should | ||
* be an array whose keys are the relation names and values the corresponding links. | ||
* | ||
* If a relation name corresponds to multiple links, use an array to represent them. | ||
* | ||
* For example, | ||
* | ||
* ```php | ||
* [ | ||
* 'self' => 'http://example.com/users/1', | ||
* 'friends' => [ | ||
* 'http://example.com/users/2', | ||
* 'http://example.com/users/3', | ||
* ], | ||
* ] | ||
* ``` | ||
* | ||
* @return array the links | ||
*/ | ||
public function getLinks(); | ||
} |