Created
August 10, 2012 21:23
-
-
Save baldurrensch/3318103 to your computer and use it in GitHub Desktop.
HalResource Interface
This file contains hidden or 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
<?php | |
namespace Hautelook\ApiBundle\Entity; | |
/** | |
* Hautelook\MainBundle\Entity\HalResource | |
* This interface should be implemented by all entities that are used in a Hal enabled JSON response. | |
* It standardizes the way to specify the resource rel and the links that should be added to the entities. | |
* | |
* @author Baldur Rensch <[email protected]> | |
*/ | |
interface HalResource | |
{ | |
/** | |
* Returns the Resource's "Rel" | |
* @return String | |
*/ | |
public static function getHalRel(); | |
/** | |
* Returns an array of \Hal\Link links. This array should then be passed into the \Hal\Resource::setLinks() function. | |
* @return array | |
*/ | |
public function getHalLinks(); | |
/** | |
* Returns the link to the entity specified by the primary keys | |
* @return String | |
*/ | |
public static function getHalSelfByPK($primaryKeys = null); | |
/** | |
* Returns the link to the entity | |
* @return String | |
*/ | |
public function getHalSelf(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment