@@ -39,6 +39,9 @@ public function __clone()
3939 }
4040 }
4141
42+ /**
43+ * @deprecated since 4.25.0 and it will be removed in EasyAdmin 5.0.0.
44+ */
4245 public function setPageName (?string $ pageName ): void
4346 {
4447 $ this ->pageName = $ pageName ;
@@ -109,16 +112,55 @@ public function disableActions(array $actionNames): void
109112
110113 /**
111114 * @return ActionCollection|array<string,array<string,ActionDto>>
115+ *
116+ * @deprecated since 4.25.0 and it will be removed in EasyAdmin 5.0.0. Use `getPageActions` or `getActionList` instead.
112117 */
113118 public function getActions (): ActionCollection |array
114119 {
120+ trigger_deprecation (
121+ 'easycorp/easyadmin-bundle ' ,
122+ '4.25.0 ' ,
123+ 'Calling "%s" is deprecated and will be removed in 5.0.0. Use `getPageActions` or `getActionList` instead. ' ,
124+ __METHOD__ ,
125+ );
126+
115127 return null === $ this ->pageName ? $ this ->actions : ActionCollection::new ($ this ->actions [$ this ->pageName ]);
116128 }
117129
130+ public function getPageActions (string $ pageName ): ActionCollection
131+ {
132+ return ActionCollection::new ($ this ->actions [$ pageName ]);
133+ }
134+
135+ /**
136+ * @return array<string,array<string,ActionDto>>
137+ */
138+ public function getActionList (): array
139+ {
140+ return $ this ->actions ;
141+ }
142+
118143 /**
119144 * @param array<string, ActionDto> $newActions
145+ *
146+ * @deprecated since 4.25.0 and it will be removed in EasyAdmin 5.0.0. Use `setPageActions` instead.
120147 */
121148 public function setActions (string $ pageName , array $ newActions ): void
149+ {
150+ trigger_deprecation (
151+ 'easycorp/easyadmin-bundle ' ,
152+ '4.25.0 ' ,
153+ 'Calling "%s" is deprecated and will be removed in 5.0.0. Use `setPageActions` instead. ' ,
154+ __METHOD__ ,
155+ );
156+
157+ $ this ->actions [$ pageName ] = $ newActions ;
158+ }
159+
160+ /**
161+ * @param array<string, ActionDto> $newActions
162+ */
163+ public function setPageActions (string $ pageName , array $ newActions ): void
122164 {
123165 $ this ->actions [$ pageName ] = $ newActions ;
124166 }
0 commit comments