@@ -971,8 +971,8 @@ namespace App\Entity;
971
971
use Doctrine\O RM\M apping as ORM;
972
972
973
973
/**
974
- * @ORM\E ntity
975
- */
974
+ * @ORM\E ntity
975
+ */
976
976
class Place
977
977
{
978
978
/**
@@ -1041,24 +1041,25 @@ Because we want to get the weather for a known place, it is more reasonable to q
1041
1041
1042
1042
namespace App\E ntity;
1043
1043
1044
+ use ApiPlatform\C ore\A nnotation\A piResource;
1044
1045
use App\C ontroller\G etWeather;
1045
1046
use Doctrine\O RM\M apping as ORM;
1046
1047
1047
1048
/**
1048
- * @ORM\E ntity
1049
- *
1050
- * @ApiResource(
1051
- * itemOperations={
1052
- * "get",
1053
- * "put",
1054
- * "delete",
1055
- * "get_weather": {
1056
- * "method": "GET",
1057
- * "path": "/places/{id}/weather",
1058
- * "controller": GetWeather::class
1059
- * }
1060
- * }, collectionOperations={"get", "post"})
1061
- */
1049
+ * @ORM\E ntity
1050
+ *
1051
+ * @ApiResource(
1052
+ * itemOperations={
1053
+ * "get",
1054
+ * "put",
1055
+ * "delete",
1056
+ * "get_weather": {
1057
+ * "method": "GET",
1058
+ * "path": "/places/{id}/weather",
1059
+ * "controller": GetWeather::class
1060
+ * }
1061
+ * }, collectionOperations={"get", "post"})
1062
+ */
1062
1063
class Place
1063
1064
{
1064
1065
// ...
@@ -1074,9 +1075,11 @@ This implies that API Platform has to know about this entity, so we will need to
1074
1075
1075
1076
namespace App\E ntity;
1076
1077
1078
+ use ApiPlatform\C ore\A nnotation\A piResource;
1079
+
1077
1080
/**
1078
- * @ApiResource
1079
- */
1081
+ * @ApiResource
1082
+ */
1080
1083
class Weather
1081
1084
{
1082
1085
// ...
@@ -1092,14 +1095,16 @@ Since we are required to expose at least one route, let's expose just one and di
1092
1095
1093
1096
namespace App\E ntity;
1094
1097
1098
+ use ApiPlatform\C ore\A nnotation\A piResource;
1099
+
1095
1100
/**
1096
- * @ApiResource(itemOperations={
1097
- * "get": {
1098
- * "method": "GET",
1099
- * "controller": SomeRandomController::class
1100
- * }
1101
- * })
1102
- */
1101
+ * @ApiResource(itemOperations={
1102
+ * "get": {
1103
+ * "method": "GET",
1104
+ * "controller": SomeRandomController::class
1105
+ * }
1106
+ * })
1107
+ */
1103
1108
class Weather
1104
1109
{
1105
1110
// ...
0 commit comments