-
Notifications
You must be signed in to change notification settings - Fork 10
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
Nil Portugués
committed
Oct 14, 2015
1 parent
0cdb9e1
commit 1c50041
Showing
8 changed files
with
242 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace NilPortugues\Api\Mapping\ClassMapping; | ||
|
||
interface ApiMappingInterface | ||
{ | ||
/** | ||
* Returns a string with the full class name, including namespace. | ||
* | ||
* @return string | ||
*/ | ||
public function getClass(); | ||
|
||
/** | ||
* Returns a string representing the resource name as it will be shown after the mapping. | ||
* | ||
* @return string | ||
*/ | ||
public function getAlias(); | ||
|
||
/** | ||
* Returns an array of properties that will be renamed. | ||
* Key is current property from the class. Value is the property's alias name. | ||
* | ||
* @return array | ||
*/ | ||
public function getAliasedProperties(); | ||
|
||
/** | ||
* List of properties in the class that will be ignored by the mapping. | ||
* | ||
* @return array | ||
*/ | ||
public function getHideProperties(); | ||
|
||
/** | ||
* Returns an array of properties that are used as an ID value. | ||
* | ||
* @return array | ||
*/ | ||
public function getIdProperties(); | ||
|
||
/** | ||
* Returns a list of URLs. This urls must have placeholders to be replaced with the getIdProperties() values. | ||
* | ||
* @return array | ||
*/ | ||
public function getUrls(); | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace NilPortugues\Api\Mapping\ClassMapping; | ||
|
||
interface HalJsonMapping extends ApiMappingInterface | ||
{ | ||
/** | ||
* Returns an array of curies. | ||
* | ||
* @return array | ||
*/ | ||
public function getCuries(); | ||
} |
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,14 @@ | ||
<?php | ||
|
||
namespace NilPortugues\Api\Mapping\ClassMapping; | ||
|
||
interface JsonApiMapping | ||
{ | ||
/** | ||
* Returns an array containing the relationship mappings as an array. | ||
* Key for each relationship defined must match a property of the mapped class. | ||
* | ||
* @return array | ||
*/ | ||
public function getRelationships(); | ||
} |
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
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