Open guice opened 4 years ago
In this piece of code:
https://github.com/CristalTeam/php-api-wrapper/blob/4f52883e250b8ea4b38c7c6b09d0ead6a0c562cb/src/Api.php#L48-L53
You check for a method based on the entity attribute name. If the entity is named with a _ or -, there isn't a way to properly overload this.
_
-
For example:
$entity = 'entity-attribute'
The proper endpoint is: /api/entity-attribute/
/api/entity-attribute/
But you can't have a method by the name of getEntity-Attribute.
getEntity-Attribute
The solution is to PascalCase the entity name before checking for a get method.
get
In this piece of code:
https://github.com/CristalTeam/php-api-wrapper/blob/4f52883e250b8ea4b38c7c6b09d0ead6a0c562cb/src/Api.php#L48-L53
You check for a method based on the entity attribute name. If the entity is named with a
_
or-
, there isn't a way to properly overload this.For example:
The proper endpoint is:
/api/entity-attribute/
But you can't have a method by the name of
getEntity-Attribute
.The solution is to PascalCase the entity name before checking for a
get
method.