Complex classes like AbstractAdmin often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use AbstractAdmin, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 59 | abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface, AdminTreeInterface |
||
| 60 | { |
||
| 61 | public const CONTEXT_MENU = 'menu'; |
||
| 62 | public const CONTEXT_DASHBOARD = 'dashboard'; |
||
| 63 | |||
| 64 | public const CLASS_REGEX = |
||
| 65 | '@ |
||
| 66 | (?:([A-Za-z0-9]*)\\\)? # vendor name / app name |
||
| 67 | (Bundle\\\)? # optional bundle directory |
||
| 68 | ([A-Za-z0-9]+?)(?:Bundle)?\\\ # bundle name, with optional suffix |
||
| 69 | ( |
||
| 70 | Entity|Document|Model|PHPCR|CouchDocument|Phpcr| |
||
| 71 | Doctrine\\\Orm|Doctrine\\\Phpcr|Doctrine\\\MongoDB|Doctrine\\\CouchDB |
||
| 72 | )\\\(.*)@x'; |
||
| 73 | |||
| 74 | public const MOSAIC_ICON_CLASS = 'fa fa-th-large fa-fw'; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * The list FieldDescription constructed from the configureListField method. |
||
| 78 | * |
||
| 79 | * @var array |
||
| 80 | */ |
||
| 81 | protected $listFieldDescriptions = []; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * The show FieldDescription constructed from the configureShowFields method. |
||
| 85 | * |
||
| 86 | * @var array |
||
| 87 | */ |
||
| 88 | protected $showFieldDescriptions = []; |
||
| 89 | |||
| 90 | /** |
||
| 91 | * The list FieldDescription constructed from the configureFormField method. |
||
| 92 | * |
||
| 93 | * @var array |
||
| 94 | */ |
||
| 95 | protected $formFieldDescriptions = []; |
||
| 96 | |||
| 97 | /** |
||
| 98 | * The filter FieldDescription constructed from the configureFilterField method. |
||
| 99 | * |
||
| 100 | * @var array |
||
| 101 | */ |
||
| 102 | protected $filterFieldDescriptions = []; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * The number of result to display in the list. |
||
| 106 | * |
||
| 107 | * @var int |
||
| 108 | */ |
||
| 109 | protected $maxPerPage = 32; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * The maximum number of page numbers to display in the list. |
||
| 113 | * |
||
| 114 | * @var int |
||
| 115 | */ |
||
| 116 | protected $maxPageLinks = 25; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * The base route name used to generate the routing information. |
||
| 120 | * |
||
| 121 | * @var string |
||
| 122 | */ |
||
| 123 | protected $baseRouteName; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * The base route pattern used to generate the routing information. |
||
| 127 | * |
||
| 128 | * @var string |
||
| 129 | */ |
||
| 130 | protected $baseRoutePattern; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * The base name controller used to generate the routing information. |
||
| 134 | * |
||
| 135 | * @var string |
||
| 136 | */ |
||
| 137 | protected $baseControllerName; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * The label class name (used in the title/breadcrumb ...). |
||
| 141 | * |
||
| 142 | * @var string |
||
| 143 | */ |
||
| 144 | protected $classnameLabel; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * The translation domain to be used to translate messages. |
||
| 148 | * |
||
| 149 | * @var string |
||
| 150 | */ |
||
| 151 | protected $translationDomain = 'messages'; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * Options to set to the form (ie, validation_groups). |
||
| 155 | * |
||
| 156 | * @var array |
||
| 157 | */ |
||
| 158 | protected $formOptions = []; |
||
| 159 | |||
| 160 | /** |
||
| 161 | * Default values to the datagrid. |
||
| 162 | * |
||
| 163 | * @var array |
||
| 164 | */ |
||
| 165 | protected $datagridValues = [ |
||
| 166 | '_page' => 1, |
||
| 167 | '_per_page' => 32, |
||
| 168 | ]; |
||
| 169 | |||
| 170 | /** |
||
| 171 | * Predefined per page options. |
||
| 172 | * |
||
| 173 | * @var array |
||
| 174 | */ |
||
| 175 | protected $perPageOptions = [16, 32, 64, 128, 256]; |
||
| 176 | |||
| 177 | /** |
||
| 178 | * Pager type. |
||
| 179 | * |
||
| 180 | * @var string |
||
| 181 | */ |
||
| 182 | protected $pagerType = Pager::TYPE_DEFAULT; |
||
| 183 | |||
| 184 | /** |
||
| 185 | * The code related to the admin. |
||
| 186 | * |
||
| 187 | * @var string |
||
| 188 | */ |
||
| 189 | protected $code; |
||
| 190 | |||
| 191 | /** |
||
| 192 | * The label. |
||
| 193 | * |
||
| 194 | * @var string |
||
| 195 | */ |
||
| 196 | protected $label; |
||
| 197 | |||
| 198 | /** |
||
| 199 | * Whether or not to persist the filters in the session. |
||
| 200 | * |
||
| 201 | * NEXT_MAJOR: remove this property |
||
| 202 | * |
||
| 203 | * @var bool |
||
| 204 | * |
||
| 205 | * @deprecated since sonata-project/admin-bundle 3.34, to be removed in 4.0. |
||
| 206 | */ |
||
| 207 | protected $persistFilters = false; |
||
| 208 | |||
| 209 | /** |
||
| 210 | * Array of routes related to this admin. |
||
| 211 | * |
||
| 212 | * @var RouteCollection |
||
| 213 | */ |
||
| 214 | protected $routes; |
||
| 215 | |||
| 216 | /** |
||
| 217 | * The subject only set in edit/update/create mode. |
||
| 218 | * |
||
| 219 | * @var object|null |
||
| 220 | */ |
||
| 221 | protected $subject; |
||
| 222 | |||
| 223 | /** |
||
| 224 | * Define a Collection of child admin, ie /admin/order/{id}/order-element/{childId}. |
||
| 225 | * |
||
| 226 | * @var array |
||
| 227 | */ |
||
| 228 | protected $children = []; |
||
| 229 | |||
| 230 | /** |
||
| 231 | * Reference the parent admin. |
||
| 232 | * |
||
| 233 | * @var AdminInterface|null |
||
| 234 | */ |
||
| 235 | protected $parent; |
||
| 236 | |||
| 237 | /** |
||
| 238 | * The related parent association, ie if OrderElement has a parent property named order, |
||
| 239 | * then the $parentAssociationMapping must be a string named `order`. |
||
| 240 | * |
||
| 241 | * NEXT_MAJOR: remove this attribute. |
||
| 242 | * |
||
| 243 | * @deprecated This attribute is deprecated since sonata-project/admin-bundle 3.24 and will be removed in 4.0 |
||
| 244 | * |
||
| 245 | * @var string |
||
| 246 | */ |
||
| 247 | protected $baseCodeRoute = ''; |
||
| 248 | |||
| 249 | /** |
||
| 250 | * NEXT_MAJOR: should be default array and private. |
||
| 251 | * |
||
| 252 | * @var string|array |
||
| 253 | */ |
||
| 254 | protected $parentAssociationMapping; |
||
| 255 | |||
| 256 | /** |
||
| 257 | * Reference the parent FieldDescription related to this admin |
||
| 258 | * only set for FieldDescription which is associated to an Sub Admin instance. |
||
| 259 | * |
||
| 260 | * @var FieldDescriptionInterface |
||
| 261 | */ |
||
| 262 | protected $parentFieldDescription; |
||
| 263 | |||
| 264 | /** |
||
| 265 | * If true then the current admin is part of the nested admin set (from the url). |
||
| 266 | * |
||
| 267 | * @var bool |
||
| 268 | */ |
||
| 269 | protected $currentChild = false; |
||
| 270 | |||
| 271 | /** |
||
| 272 | * The uniqid is used to avoid clashing with 2 admin related to the code |
||
| 273 | * ie: a Block linked to a Block. |
||
| 274 | * |
||
| 275 | * @var string |
||
| 276 | */ |
||
| 277 | protected $uniqid; |
||
| 278 | |||
| 279 | /** |
||
| 280 | * The Entity or Document manager. |
||
| 281 | * |
||
| 282 | * @var ModelManagerInterface |
||
| 283 | */ |
||
| 284 | protected $modelManager; |
||
| 285 | |||
| 286 | /** |
||
| 287 | * The current request object. |
||
| 288 | * |
||
| 289 | * @var Request|null |
||
| 290 | */ |
||
| 291 | protected $request; |
||
| 292 | |||
| 293 | /** |
||
| 294 | * The translator component. |
||
| 295 | * |
||
| 296 | * NEXT_MAJOR: remove this property |
||
| 297 | * |
||
| 298 | * @var \Symfony\Component\Translation\TranslatorInterface |
||
| 299 | * |
||
| 300 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 301 | */ |
||
| 302 | protected $translator; |
||
| 303 | |||
| 304 | /** |
||
| 305 | * The related form contractor. |
||
| 306 | * |
||
| 307 | * @var FormContractorInterface |
||
| 308 | */ |
||
| 309 | protected $formContractor; |
||
| 310 | |||
| 311 | /** |
||
| 312 | * The related list builder. |
||
| 313 | * |
||
| 314 | * @var ListBuilderInterface |
||
| 315 | */ |
||
| 316 | protected $listBuilder; |
||
| 317 | |||
| 318 | /** |
||
| 319 | * The related view builder. |
||
| 320 | * |
||
| 321 | * @var ShowBuilderInterface |
||
| 322 | */ |
||
| 323 | protected $showBuilder; |
||
| 324 | |||
| 325 | /** |
||
| 326 | * The related datagrid builder. |
||
| 327 | * |
||
| 328 | * @var DatagridBuilderInterface |
||
| 329 | */ |
||
| 330 | protected $datagridBuilder; |
||
| 331 | |||
| 332 | /** |
||
| 333 | * @var RouteBuilderInterface |
||
| 334 | */ |
||
| 335 | protected $routeBuilder; |
||
| 336 | |||
| 337 | /** |
||
| 338 | * The datagrid instance. |
||
| 339 | * |
||
| 340 | * @var DatagridInterface|null |
||
| 341 | */ |
||
| 342 | protected $datagrid; |
||
| 343 | |||
| 344 | /** |
||
| 345 | * The router instance. |
||
| 346 | * |
||
| 347 | * @var RouteGeneratorInterface|null |
||
| 348 | */ |
||
| 349 | protected $routeGenerator; |
||
| 350 | |||
| 351 | /** |
||
| 352 | * @var SecurityHandlerInterface |
||
| 353 | */ |
||
| 354 | protected $securityHandler; |
||
| 355 | |||
| 356 | /** |
||
| 357 | * @var ValidatorInterface |
||
| 358 | */ |
||
| 359 | protected $validator; |
||
| 360 | |||
| 361 | /** |
||
| 362 | * The configuration pool. |
||
| 363 | * |
||
| 364 | * @var Pool |
||
| 365 | */ |
||
| 366 | protected $configurationPool; |
||
| 367 | |||
| 368 | /** |
||
| 369 | * @var ItemInterface |
||
| 370 | */ |
||
| 371 | protected $menu; |
||
| 372 | |||
| 373 | /** |
||
| 374 | * @var FactoryInterface |
||
| 375 | */ |
||
| 376 | protected $menuFactory; |
||
| 377 | |||
| 378 | /** |
||
| 379 | * @var array<string, bool> |
||
| 380 | */ |
||
| 381 | protected $loaded = [ |
||
| 382 | 'view_fields' => false, |
||
| 383 | 'view_groups' => false, |
||
| 384 | 'routes' => false, |
||
| 385 | 'tab_menu' => false, |
||
| 386 | ]; |
||
| 387 | |||
| 388 | /** |
||
| 389 | * @var string[] |
||
| 390 | */ |
||
| 391 | protected $formTheme = []; |
||
| 392 | |||
| 393 | /** |
||
| 394 | * @var string[] |
||
| 395 | */ |
||
| 396 | protected $filterTheme = []; |
||
| 397 | |||
| 398 | /** |
||
| 399 | * @var AdminExtensionInterface[] |
||
| 400 | */ |
||
| 401 | protected $extensions = []; |
||
| 402 | |||
| 403 | /** |
||
| 404 | * @var LabelTranslatorStrategyInterface |
||
| 405 | */ |
||
| 406 | protected $labelTranslatorStrategy; |
||
| 407 | |||
| 408 | /** |
||
| 409 | * Setting to true will enable preview mode for |
||
| 410 | * the entity and show a preview button in the |
||
| 411 | * edit/create forms. |
||
| 412 | * |
||
| 413 | * @var bool |
||
| 414 | */ |
||
| 415 | protected $supportsPreviewMode = false; |
||
| 416 | |||
| 417 | /** |
||
| 418 | * Roles and permissions per role. |
||
| 419 | * |
||
| 420 | * @var array 'role' => ['permission', 'permission'] |
||
| 421 | */ |
||
| 422 | protected $securityInformation = []; |
||
| 423 | |||
| 424 | protected $cacheIsGranted = []; |
||
| 425 | |||
| 426 | /** |
||
| 427 | * Action list for the search result. |
||
| 428 | * |
||
| 429 | * @var string[] |
||
| 430 | */ |
||
| 431 | protected $searchResultActions = ['edit', 'show']; |
||
| 432 | |||
| 433 | protected $listModes = [ |
||
| 434 | 'list' => [ |
||
| 435 | 'class' => 'fa fa-list fa-fw', |
||
| 436 | ], |
||
| 437 | 'mosaic' => [ |
||
| 438 | 'class' => self::MOSAIC_ICON_CLASS, |
||
| 439 | ], |
||
| 440 | ]; |
||
| 441 | |||
| 442 | /** |
||
| 443 | * The Access mapping. |
||
| 444 | * |
||
| 445 | * @var array [action1 => requiredRole1, action2 => [requiredRole2, requiredRole3]] |
||
| 446 | */ |
||
| 447 | protected $accessMapping = []; |
||
| 448 | |||
| 449 | /** |
||
| 450 | * @var MutableTemplateRegistryInterface |
||
| 451 | */ |
||
| 452 | private $templateRegistry; |
||
| 453 | |||
| 454 | /** |
||
| 455 | * The class name managed by the admin class. |
||
| 456 | * |
||
| 457 | * @var string |
||
| 458 | */ |
||
| 459 | private $class; |
||
| 460 | |||
| 461 | /** |
||
| 462 | * The subclasses supported by the admin class. |
||
| 463 | * |
||
| 464 | * @var array<string, string> |
||
| 465 | */ |
||
| 466 | private $subClasses = []; |
||
| 467 | |||
| 468 | /** |
||
| 469 | * The list collection. |
||
| 470 | * |
||
| 471 | * @var FieldDescriptionCollection |
||
| 472 | */ |
||
| 473 | private $list; |
||
| 474 | |||
| 475 | /** |
||
| 476 | * @var FieldDescriptionCollection|null |
||
| 477 | */ |
||
| 478 | private $show; |
||
| 479 | |||
| 480 | /** |
||
| 481 | * @var Form|null |
||
| 482 | */ |
||
| 483 | private $form; |
||
| 484 | |||
| 485 | /** |
||
| 486 | * The cached base route name. |
||
| 487 | * |
||
| 488 | * @var string |
||
| 489 | */ |
||
| 490 | private $cachedBaseRouteName; |
||
| 491 | |||
| 492 | /** |
||
| 493 | * The cached base route pattern. |
||
| 494 | * |
||
| 495 | * @var string |
||
| 496 | */ |
||
| 497 | private $cachedBaseRoutePattern; |
||
| 498 | |||
| 499 | /** |
||
| 500 | * The form group disposition. |
||
| 501 | * |
||
| 502 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 503 | * hold boolean values. |
||
| 504 | * |
||
| 505 | * @var array|bool |
||
| 506 | */ |
||
| 507 | private $formGroups = false; |
||
| 508 | |||
| 509 | /** |
||
| 510 | * The form tabs disposition. |
||
| 511 | * |
||
| 512 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 513 | * hold boolean values. |
||
| 514 | * |
||
| 515 | * @var array|bool |
||
| 516 | */ |
||
| 517 | private $formTabs = false; |
||
| 518 | |||
| 519 | /** |
||
| 520 | * The view group disposition. |
||
| 521 | * |
||
| 522 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 523 | * hold boolean values. |
||
| 524 | * |
||
| 525 | * @var array|bool |
||
| 526 | */ |
||
| 527 | private $showGroups = false; |
||
| 528 | |||
| 529 | /** |
||
| 530 | * The view tab disposition. |
||
| 531 | * |
||
| 532 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 533 | * hold boolean values. |
||
| 534 | * |
||
| 535 | * @var array|bool |
||
| 536 | */ |
||
| 537 | private $showTabs = false; |
||
| 538 | |||
| 539 | /** |
||
| 540 | * The manager type to use for the admin. |
||
| 541 | * |
||
| 542 | * @var string |
||
| 543 | */ |
||
| 544 | private $managerType; |
||
| 545 | |||
| 546 | /** |
||
| 547 | * Component responsible for persisting filters. |
||
| 548 | * |
||
| 549 | * @var FilterPersisterInterface|null |
||
| 550 | */ |
||
| 551 | private $filterPersister; |
||
| 552 | |||
| 553 | /** |
||
| 554 | * @param string $code |
||
| 555 | * @param string $class |
||
| 556 | * @param string|null $baseControllerName |
||
| 557 | */ |
||
| 558 | public function __construct($code, $class, $baseControllerName = null) |
||
| 559 | { |
||
| 560 | if (!\is_string($code)) { |
||
| 561 | @trigger_error(sprintf( |
||
|
|
|||
| 562 | 'Passing other type than string as argument 1 for method %s() is deprecated since sonata-project/admin-bundle 3.65. It will accept only string in version 4.0.', |
||
| 563 | __METHOD__ |
||
| 564 | ), E_USER_DEPRECATED); |
||
| 565 | } |
||
| 566 | $this->code = $code; |
||
| 567 | if (!\is_string($class)) { |
||
| 568 | @trigger_error(sprintf( |
||
| 569 | 'Passing other type than string as argument 2 for method %s() is deprecated since sonata-project/admin-bundle 3.65. It will accept only string in version 4.0.', |
||
| 570 | __METHOD__ |
||
| 571 | ), E_USER_DEPRECATED); |
||
| 572 | } |
||
| 573 | $this->class = $class; |
||
| 574 | if (null !== $baseControllerName && !\is_string($baseControllerName)) { |
||
| 575 | @trigger_error(sprintf( |
||
| 576 | 'Passing other type than string or null as argument 3 for method %s() is deprecated since sonata-project/admin-bundle 3.65. It will accept only string and null in version 4.0.', |
||
| 577 | __METHOD__ |
||
| 578 | ), E_USER_DEPRECATED); |
||
| 579 | } |
||
| 580 | $this->baseControllerName = $baseControllerName; |
||
| 581 | |||
| 582 | $this->predefinePerPageOptions(); |
||
| 583 | $this->datagridValues['_per_page'] = $this->maxPerPage; |
||
| 584 | } |
||
| 585 | |||
| 586 | /** |
||
| 587 | * {@inheritdoc} |
||
| 588 | */ |
||
| 589 | public function getExportFormats() |
||
| 590 | { |
||
| 591 | return [ |
||
| 592 | 'json', 'xml', 'csv', 'xls', |
||
| 593 | ]; |
||
| 594 | } |
||
| 595 | |||
| 596 | /** |
||
| 597 | * {@inheritdoc} |
||
| 598 | */ |
||
| 599 | public function getExportFields(): array |
||
| 600 | { |
||
| 601 | $fields = $this->getModelManager()->getExportFields($this->getClass()); |
||
| 602 | |||
| 603 | foreach ($this->getExtensions() as $extension) { |
||
| 604 | if (method_exists($extension, 'configureExportFields')) { |
||
| 605 | $fields = $extension->configureExportFields($this, $fields); |
||
| 606 | } |
||
| 607 | } |
||
| 608 | |||
| 609 | return $fields; |
||
| 610 | } |
||
| 611 | |||
| 612 | public function getDataSourceIterator() |
||
| 613 | { |
||
| 614 | $datagrid = $this->getDatagrid(); |
||
| 615 | $datagrid->buildPager(); |
||
| 616 | |||
| 617 | $fields = []; |
||
| 618 | |||
| 619 | foreach ($this->getExportFields() as $key => $field) { |
||
| 620 | $label = $this->getTranslationLabel($field, 'export', 'label'); |
||
| 621 | $transLabel = $this->trans($label); |
||
| 622 | |||
| 623 | // NEXT_MAJOR: Remove this hack, because all field labels will be translated with the major release |
||
| 624 | // No translation key exists |
||
| 625 | if ($transLabel === $label) { |
||
| 626 | $fields[$key] = $field; |
||
| 627 | } else { |
||
| 628 | $fields[$transLabel] = $field; |
||
| 629 | } |
||
| 630 | } |
||
| 631 | |||
| 632 | return $this->getModelManager()->getDataSourceIterator($datagrid, $fields); |
||
| 633 | } |
||
| 634 | |||
| 635 | public function validate(ErrorElement $errorElement, $object): void |
||
| 636 | { |
||
| 637 | } |
||
| 638 | |||
| 639 | /** |
||
| 640 | * define custom variable. |
||
| 641 | */ |
||
| 642 | public function initialize(): void |
||
| 643 | { |
||
| 644 | if (!$this->classnameLabel) { |
||
| 645 | /* NEXT_MAJOR: remove cast to string, null is not supposed to be |
||
| 646 | supported but was documented as such */ |
||
| 647 | $this->classnameLabel = substr( |
||
| 648 | (string) $this->getClass(), |
||
| 649 | strrpos((string) $this->getClass(), '\\') + 1 |
||
| 650 | ); |
||
| 651 | } |
||
| 652 | |||
| 653 | $this->configure(); |
||
| 654 | } |
||
| 655 | |||
| 656 | public function update($object) |
||
| 676 | |||
| 677 | public function create($object) |
||
| 699 | |||
| 700 | public function delete($object): void |
||
| 715 | |||
| 716 | public function preValidate(object $object): void |
||
| 719 | |||
| 720 | public function preUpdate($object): void |
||
| 723 | |||
| 724 | public function postUpdate($object): void |
||
| 727 | |||
| 728 | public function prePersist($object): void |
||
| 731 | |||
| 732 | public function postPersist($object): void |
||
| 735 | |||
| 736 | public function preRemove($object): void |
||
| 739 | |||
| 740 | public function postRemove($object): void |
||
| 743 | |||
| 744 | public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements): void |
||
| 747 | |||
| 748 | public function getFilterParameters() |
||
| 749 | { |
||
| 750 | $parameters = []; |
||
| 751 | |||
| 752 | // build the values array |
||
| 753 | if ($this->hasRequest()) { |
||
| 799 | |||
| 800 | /** |
||
| 801 | * Returns the name of the parent related field, so the field can be use to set the default |
||
| 802 | * value (ie the parent object) or to filter the object. |
||
| 803 | * |
||
| 804 | * @throws \InvalidArgumentException |
||
| 805 | * |
||
| 806 | * @return string|null |
||
| 807 | */ |
||
| 808 | public function getParentAssociationMapping() |
||
| 828 | |||
| 829 | /** |
||
| 830 | * @param string $code |
||
| 831 | * @param string $value |
||
| 832 | */ |
||
| 833 | final public function addParentAssociationMapping($code, $value): void |
||
| 837 | |||
| 838 | /** |
||
| 839 | * Returns the baseRoutePattern used to generate the routing information. |
||
| 840 | * |
||
| 841 | * @throws \RuntimeException |
||
| 842 | * |
||
| 843 | * @return string the baseRoutePattern used to generate the routing information |
||
| 844 | */ |
||
| 845 | public function getBaseRoutePattern() |
||
| 887 | |||
| 888 | /** |
||
| 889 | * Returns the baseRouteName used to generate the routing information. |
||
| 890 | * |
||
| 891 | * @throws \RuntimeException |
||
| 892 | * |
||
| 893 | * @return string the baseRouteName used to generate the routing information |
||
| 894 | */ |
||
| 895 | public function getBaseRouteName() |
||
| 936 | |||
| 937 | public function getClass() |
||
| 960 | |||
| 961 | public function getSubClasses(): array |
||
| 965 | |||
| 966 | /** |
||
| 967 | * NEXT_MAJOR: remove this method. |
||
| 968 | */ |
||
| 969 | public function addSubClass($subClass): void |
||
| 980 | |||
| 981 | public function setSubClasses(array $subClasses): void |
||
| 985 | |||
| 986 | public function hasSubClass($name) |
||
| 990 | |||
| 991 | public function hasActiveSubClass() |
||
| 999 | |||
| 1000 | public function getActiveSubClass() |
||
| 1020 | |||
| 1021 | public function getActiveSubclassCode() |
||
| 1059 | |||
| 1060 | public function getBatchActions() |
||
| 1090 | |||
| 1091 | public function getRoutes() |
||
| 1097 | |||
| 1098 | public function getRouterIdParameter() |
||
| 1102 | |||
| 1103 | public function getIdParameter() |
||
| 1113 | |||
| 1114 | public function hasRoute($name) |
||
| 1122 | |||
| 1123 | public function isCurrentRoute(string $name, ?string $adminCode = null): bool |
||
| 1144 | |||
| 1145 | public function generateObjectUrl($name, $object, array $parameters = [], $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1151 | |||
| 1152 | public function generateUrl($name, array $parameters = [], $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1156 | |||
| 1157 | public function generateMenuUrl($name, array $parameters = [], $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1161 | |||
| 1162 | final public function setTemplateRegistry(MutableTemplateRegistryInterface $templateRegistry): void |
||
| 1166 | |||
| 1167 | /** |
||
| 1168 | * @param array<string, string> $templates |
||
| 1169 | */ |
||
| 1170 | public function setTemplates(array $templates): void |
||
| 1174 | |||
| 1175 | /** |
||
| 1176 | * {@inheritdoc} |
||
| 1177 | */ |
||
| 1178 | public function setTemplate($name, $template): void |
||
| 1182 | |||
| 1183 | public function getNewInstance() |
||
| 1192 | |||
| 1193 | public function getFormBuilder() |
||
| 1206 | |||
| 1207 | /** |
||
| 1208 | * This method is being called by the main admin class and the child class, |
||
| 1209 | * the getFormBuilder is only call by the main admin class. |
||
| 1210 | */ |
||
| 1211 | public function defineFormBuilder(FormBuilderInterface $formBuilder): void |
||
| 1237 | |||
| 1238 | public function attachAdminClass(FieldDescriptionInterface $fieldDescription): void |
||
| 1260 | |||
| 1261 | public function getObject($id) |
||
| 1270 | |||
| 1271 | public function getForm() |
||
| 1277 | |||
| 1278 | public function getList() |
||
| 1284 | |||
| 1285 | /** |
||
| 1286 | * @final since sonata-project/admin-bundle 3.63.0 |
||
| 1287 | */ |
||
| 1288 | public function createQuery($context = 'list') |
||
| 1306 | |||
| 1307 | public function getDatagrid() |
||
| 1313 | |||
| 1314 | public function buildTabMenu($action, ?AdminInterface $childAdmin = null): ItemInterface |
||
| 1341 | |||
| 1342 | /** |
||
| 1343 | * @param string $action |
||
| 1344 | * |
||
| 1345 | * @return ItemInterface |
||
| 1346 | */ |
||
| 1347 | public function getSideMenu($action, ?AdminInterface $childAdmin = null) |
||
| 1357 | |||
| 1358 | public function getRootCode(): string |
||
| 1362 | |||
| 1363 | public function getRoot(): AdminInterface |
||
| 1373 | |||
| 1374 | public function setBaseControllerName($baseControllerName): void |
||
| 1378 | |||
| 1379 | public function getBaseControllerName() |
||
| 1383 | |||
| 1384 | /** |
||
| 1385 | * @param string $label |
||
| 1386 | */ |
||
| 1387 | public function setLabel($label): void |
||
| 1391 | |||
| 1392 | public function getLabel() |
||
| 1396 | |||
| 1397 | /** |
||
| 1398 | * @param bool $persist |
||
| 1399 | * |
||
| 1400 | * NEXT_MAJOR: remove this method |
||
| 1401 | * |
||
| 1402 | * @deprecated since sonata-project/admin-bundle 3.34, to be removed in 4.0. |
||
| 1403 | */ |
||
| 1404 | public function setPersistFilters($persist): void |
||
| 1413 | |||
| 1414 | public function setFilterPersister(?FilterPersisterInterface $filterPersister = null): void |
||
| 1420 | |||
| 1421 | /** |
||
| 1422 | * @param int $maxPerPage |
||
| 1423 | */ |
||
| 1424 | public function setMaxPerPage($maxPerPage): void |
||
| 1428 | |||
| 1429 | /** |
||
| 1430 | * @return int |
||
| 1431 | */ |
||
| 1432 | public function getMaxPerPage() |
||
| 1436 | |||
| 1437 | /** |
||
| 1438 | * @param int $maxPageLinks |
||
| 1439 | */ |
||
| 1440 | public function setMaxPageLinks($maxPageLinks): void |
||
| 1444 | |||
| 1445 | /** |
||
| 1446 | * @return int |
||
| 1447 | */ |
||
| 1448 | public function getMaxPageLinks() |
||
| 1452 | |||
| 1453 | public function getFormGroups() |
||
| 1464 | |||
| 1465 | public function setFormGroups(array $formGroups): void |
||
| 1469 | |||
| 1470 | public function removeFieldFromFormGroup($key): void |
||
| 1480 | |||
| 1481 | /** |
||
| 1482 | * @param string $group |
||
| 1483 | */ |
||
| 1484 | public function reorderFormGroup($group, array $keys): void |
||
| 1491 | |||
| 1492 | public function getFormTabs() |
||
| 1503 | |||
| 1504 | public function setFormTabs(array $formTabs): void |
||
| 1508 | |||
| 1509 | public function getShowTabs() |
||
| 1520 | |||
| 1521 | public function setShowTabs(array $showTabs): void |
||
| 1525 | |||
| 1526 | public function getShowGroups() |
||
| 1537 | |||
| 1538 | public function setShowGroups(array $showGroups): void |
||
| 1542 | |||
| 1543 | public function reorderShowGroup($group, array $keys): void |
||
| 1550 | |||
| 1551 | public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription): void |
||
| 1555 | |||
| 1556 | public function getParentFieldDescription() |
||
| 1560 | |||
| 1561 | public function hasParentFieldDescription() |
||
| 1565 | |||
| 1566 | public function setSubject($subject): void |
||
| 1583 | |||
| 1584 | public function getSubject() |
||
| 1596 | |||
| 1597 | public function hasSubject() |
||
| 1601 | |||
| 1602 | public function getFormFieldDescriptions() |
||
| 1608 | |||
| 1609 | public function getFormFieldDescription($name) |
||
| 1613 | |||
| 1614 | /** |
||
| 1615 | * Returns true if the admin has a FieldDescription with the given $name. |
||
| 1616 | * |
||
| 1617 | * @param string $name |
||
| 1618 | * |
||
| 1619 | * @return bool |
||
| 1620 | */ |
||
| 1621 | public function hasFormFieldDescription($name) |
||
| 1625 | |||
| 1626 | public function addFormFieldDescription($name, FieldDescriptionInterface $fieldDescription): void |
||
| 1630 | |||
| 1631 | /** |
||
| 1632 | * remove a FieldDescription. |
||
| 1633 | * |
||
| 1634 | * @param string $name |
||
| 1635 | */ |
||
| 1636 | public function removeFormFieldDescription($name): void |
||
| 1640 | |||
| 1641 | /** |
||
| 1642 | * build and return the collection of form FieldDescription. |
||
| 1643 | * |
||
| 1644 | * @return array collection of form FieldDescription |
||
| 1645 | */ |
||
| 1646 | public function getShowFieldDescriptions() |
||
| 1652 | |||
| 1653 | /** |
||
| 1654 | * Returns the form FieldDescription with the given $name. |
||
| 1655 | * |
||
| 1656 | * @param string $name |
||
| 1657 | * |
||
| 1658 | * @return FieldDescriptionInterface |
||
| 1659 | */ |
||
| 1660 | public function getShowFieldDescription($name) |
||
| 1666 | |||
| 1667 | public function hasShowFieldDescription($name) |
||
| 1671 | |||
| 1672 | public function addShowFieldDescription($name, FieldDescriptionInterface $fieldDescription): void |
||
| 1676 | |||
| 1677 | public function removeShowFieldDescription($name): void |
||
| 1681 | |||
| 1682 | public function getListFieldDescriptions() |
||
| 1688 | |||
| 1689 | public function getListFieldDescription($name) |
||
| 1693 | |||
| 1694 | public function hasListFieldDescription($name) |
||
| 1700 | |||
| 1701 | public function addListFieldDescription($name, FieldDescriptionInterface $fieldDescription): void |
||
| 1705 | |||
| 1706 | public function removeListFieldDescription($name): void |
||
| 1710 | |||
| 1711 | public function getFilterFieldDescription($name) |
||
| 1715 | |||
| 1716 | public function hasFilterFieldDescription($name) |
||
| 1720 | |||
| 1721 | public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription): void |
||
| 1725 | |||
| 1726 | public function removeFilterFieldDescription($name): void |
||
| 1730 | |||
| 1731 | public function getFilterFieldDescriptions() |
||
| 1737 | |||
| 1738 | public function addChild(AdminInterface $child): void |
||
| 1770 | |||
| 1771 | public function hasChild($code) |
||
| 1775 | |||
| 1776 | public function getChildren() |
||
| 1780 | |||
| 1781 | public function getChild($code) |
||
| 1785 | |||
| 1786 | public function setParent(AdminInterface $parent): void |
||
| 1790 | |||
| 1791 | public function getParent() |
||
| 1795 | |||
| 1796 | final public function getRootAncestor() |
||
| 1806 | |||
| 1807 | final public function getChildDepth() |
||
| 1819 | |||
| 1820 | final public function getCurrentLeafChildAdmin() |
||
| 1834 | |||
| 1835 | public function isChild() |
||
| 1839 | |||
| 1840 | /** |
||
| 1841 | * Returns true if the admin has children, false otherwise. |
||
| 1842 | * |
||
| 1843 | * @return bool if the admin has children |
||
| 1844 | */ |
||
| 1845 | public function hasChildren() |
||
| 1849 | |||
| 1850 | public function setUniqid($uniqid): void |
||
| 1854 | |||
| 1855 | public function getUniqid() |
||
| 1863 | |||
| 1864 | /** |
||
| 1865 | * {@inheritdoc} |
||
| 1866 | */ |
||
| 1867 | public function getClassnameLabel() |
||
| 1871 | |||
| 1872 | public function getPersistentParameters() |
||
| 1888 | |||
| 1889 | /** |
||
| 1890 | * {@inheritdoc} |
||
| 1891 | */ |
||
| 1892 | public function getPersistentParameter(string $name) |
||
| 1898 | |||
| 1899 | public function setCurrentChild($currentChild): void |
||
| 1903 | |||
| 1904 | /** |
||
| 1905 | * NEXT_MAJOR: Remove this method. |
||
| 1906 | * |
||
| 1907 | * @deprecated since sonata-project/admin-bundle 3.65, to be removed in 4.0 |
||
| 1908 | */ |
||
| 1909 | public function getCurrentChild() |
||
| 1922 | |||
| 1923 | public function isCurrentChild(): bool |
||
| 1927 | |||
| 1928 | /** |
||
| 1929 | * Returns the current child admin instance. |
||
| 1930 | * |
||
| 1931 | * @return AdminInterface|null the current child admin instance |
||
| 1932 | */ |
||
| 1933 | public function getCurrentChildAdmin() |
||
| 1943 | |||
| 1944 | public function trans($id, array $parameters = [], $domain = null, $locale = null) |
||
| 1955 | |||
| 1956 | /** |
||
| 1957 | * Translate a message id. |
||
| 1958 | * |
||
| 1959 | * NEXT_MAJOR: remove this method |
||
| 1960 | * |
||
| 1961 | * @param string $id |
||
| 1962 | * @param int $count |
||
| 1963 | * @param string|null $domain |
||
| 1964 | * @param string|null $locale |
||
| 1965 | * |
||
| 1966 | * @return string the translated string |
||
| 1967 | * |
||
| 1968 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 1969 | */ |
||
| 1970 | public function transChoice($id, $count, array $parameters = [], $domain = null, $locale = null) |
||
| 1981 | |||
| 1982 | public function setTranslationDomain($translationDomain): void |
||
| 1986 | |||
| 1987 | public function getTranslationDomain() |
||
| 1991 | |||
| 1992 | /** |
||
| 1993 | * {@inheritdoc} |
||
| 1994 | * |
||
| 1995 | * NEXT_MAJOR: remove this method |
||
| 1996 | * |
||
| 1997 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 1998 | */ |
||
| 1999 | public function setTranslator(TranslatorInterface $translator): void |
||
| 2011 | |||
| 2012 | /** |
||
| 2013 | * {@inheritdoc} |
||
| 2014 | * |
||
| 2015 | * NEXT_MAJOR: remove this method |
||
| 2016 | * |
||
| 2017 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 2018 | */ |
||
| 2019 | public function getTranslator() |
||
| 2028 | |||
| 2029 | public function getTranslationLabel($label, $context = '', $type = '') |
||
| 2033 | |||
| 2034 | public function setRequest(Request $request): void |
||
| 2042 | |||
| 2043 | public function getRequest() |
||
| 2051 | |||
| 2052 | public function hasRequest() |
||
| 2056 | |||
| 2057 | public function setFormContractor(FormContractorInterface $formBuilder): void |
||
| 2061 | |||
| 2062 | /** |
||
| 2063 | * @return FormContractorInterface |
||
| 2064 | */ |
||
| 2065 | public function getFormContractor() |
||
| 2069 | |||
| 2070 | public function setDatagridBuilder(DatagridBuilderInterface $datagridBuilder): void |
||
| 2074 | |||
| 2075 | public function getDatagridBuilder() |
||
| 2079 | |||
| 2080 | public function setListBuilder(ListBuilderInterface $listBuilder): void |
||
| 2084 | |||
| 2085 | public function getListBuilder() |
||
| 2089 | |||
| 2090 | public function setShowBuilder(ShowBuilderInterface $showBuilder): void |
||
| 2094 | |||
| 2095 | /** |
||
| 2096 | * @return ShowBuilderInterface |
||
| 2097 | */ |
||
| 2098 | public function getShowBuilder() |
||
| 2102 | |||
| 2103 | public function setConfigurationPool(Pool $configurationPool): void |
||
| 2107 | |||
| 2108 | /** |
||
| 2109 | * @return Pool |
||
| 2110 | */ |
||
| 2111 | public function getConfigurationPool() |
||
| 2115 | |||
| 2116 | public function setRouteGenerator(RouteGeneratorInterface $routeGenerator): void |
||
| 2120 | |||
| 2121 | /** |
||
| 2122 | * @return RouteGeneratorInterface |
||
| 2123 | */ |
||
| 2124 | public function getRouteGenerator() |
||
| 2128 | |||
| 2129 | public function getCode() |
||
| 2133 | |||
| 2134 | public function getBaseCodeRoute() |
||
| 2142 | |||
| 2143 | public function getModelManager() |
||
| 2147 | |||
| 2148 | public function setModelManager(ModelManagerInterface $modelManager): void |
||
| 2152 | |||
| 2153 | public function getManagerType() |
||
| 2157 | |||
| 2158 | /** |
||
| 2159 | * @param string $type |
||
| 2160 | */ |
||
| 2161 | public function setManagerType($type): void |
||
| 2165 | |||
| 2166 | public function getObjectIdentifier() |
||
| 2170 | |||
| 2171 | /** |
||
| 2172 | * Set the roles and permissions per role. |
||
| 2173 | */ |
||
| 2174 | public function setSecurityInformation(array $information): void |
||
| 2178 | |||
| 2179 | public function getSecurityInformation() |
||
| 2183 | |||
| 2184 | /** |
||
| 2185 | * Return the list of permissions the user should have in order to display the admin. |
||
| 2186 | * |
||
| 2187 | * @param string $context |
||
| 2188 | * |
||
| 2189 | * @return array |
||
| 2190 | */ |
||
| 2191 | public function getPermissionsShow($context) |
||
| 2200 | |||
| 2201 | public function showIn($context) |
||
| 2210 | |||
| 2211 | public function createObjectSecurity($object): void |
||
| 2215 | |||
| 2216 | public function setSecurityHandler(SecurityHandlerInterface $securityHandler): void |
||
| 2220 | |||
| 2221 | public function getSecurityHandler() |
||
| 2225 | |||
| 2226 | public function isGranted($name, $object = null) |
||
| 2237 | |||
| 2238 | public function getUrlSafeIdentifier($entity) |
||
| 2242 | |||
| 2243 | public function getNormalizedIdentifier($entity) |
||
| 2247 | |||
| 2248 | public function id($entity) |
||
| 2252 | |||
| 2253 | public function setValidator(ValidatorInterface $validator): void |
||
| 2257 | |||
| 2258 | public function getValidator() |
||
| 2262 | |||
| 2263 | public function getShow() |
||
| 2269 | |||
| 2270 | public function setFormTheme(array $formTheme): void |
||
| 2274 | |||
| 2275 | public function getFormTheme() |
||
| 2279 | |||
| 2280 | public function setFilterTheme(array $filterTheme): void |
||
| 2284 | |||
| 2285 | public function getFilterTheme() |
||
| 2289 | |||
| 2290 | public function addExtension(AdminExtensionInterface $extension): void |
||
| 2294 | |||
| 2295 | public function getExtensions() |
||
| 2299 | |||
| 2300 | public function setMenuFactory(FactoryInterface $menuFactory): void |
||
| 2304 | |||
| 2305 | public function getMenuFactory() |
||
| 2309 | |||
| 2310 | public function setRouteBuilder(RouteBuilderInterface $routeBuilder): void |
||
| 2314 | |||
| 2315 | public function getRouteBuilder() |
||
| 2319 | |||
| 2320 | public function toString($object) |
||
| 2332 | |||
| 2333 | public function setLabelTranslatorStrategy(LabelTranslatorStrategyInterface $labelTranslatorStrategy): void |
||
| 2337 | |||
| 2338 | public function getLabelTranslatorStrategy() |
||
| 2342 | |||
| 2343 | public function supportsPreviewMode() |
||
| 2347 | |||
| 2348 | /** |
||
| 2349 | * Set custom per page options. |
||
| 2350 | */ |
||
| 2351 | public function setPerPageOptions(array $options): void |
||
| 2355 | |||
| 2356 | /** |
||
| 2357 | * Returns predefined per page options. |
||
| 2358 | * |
||
| 2359 | * @return array |
||
| 2360 | */ |
||
| 2361 | public function getPerPageOptions() |
||
| 2365 | |||
| 2366 | /** |
||
| 2367 | * Set pager type. |
||
| 2368 | * |
||
| 2369 | * @param string $pagerType |
||
| 2370 | */ |
||
| 2371 | public function setPagerType($pagerType): void |
||
| 2375 | |||
| 2376 | /** |
||
| 2377 | * Get pager type. |
||
| 2378 | * |
||
| 2379 | * @return string |
||
| 2380 | */ |
||
| 2381 | public function getPagerType() |
||
| 2385 | |||
| 2386 | /** |
||
| 2387 | * Returns true if the per page value is allowed, false otherwise. |
||
| 2388 | * |
||
| 2389 | * @param int $perPage |
||
| 2390 | * |
||
| 2391 | * @return bool |
||
| 2392 | */ |
||
| 2393 | public function determinedPerPageValue($perPage) |
||
| 2397 | |||
| 2398 | public function isAclEnabled() |
||
| 2402 | |||
| 2403 | public function getObjectMetadata($object) |
||
| 2407 | |||
| 2408 | public function getListModes() |
||
| 2412 | |||
| 2413 | public function setListMode($mode): void |
||
| 2421 | |||
| 2422 | public function getListMode() |
||
| 2430 | |||
| 2431 | public function getAccessMapping() |
||
| 2435 | |||
| 2436 | public function checkAccess($action, $object = null): void |
||
| 2458 | |||
| 2459 | /** |
||
| 2460 | * {@inheritdoc} |
||
| 2461 | */ |
||
| 2462 | public function hasAccess(string $action, ?object $object = null): bool |
||
| 2482 | |||
| 2483 | /** |
||
| 2484 | * @param object|null $object |
||
| 2485 | */ |
||
| 2486 | final public function getActionButtons(string $action, $object = null): array |
||
| 2554 | |||
| 2555 | /** |
||
| 2556 | * {@inheritdoc} |
||
| 2557 | */ |
||
| 2558 | public function getDashboardActions() |
||
| 2583 | |||
| 2584 | /** |
||
| 2585 | * {@inheritdoc} |
||
| 2586 | */ |
||
| 2587 | final public function showMosaicButton($isShown): void |
||
| 2595 | |||
| 2596 | /** |
||
| 2597 | * @param object $object |
||
| 2598 | */ |
||
| 2599 | final public function getSearchResultLink($object): ?string |
||
| 2609 | |||
| 2610 | /** |
||
| 2611 | * Checks if a filter type is set to a default value. |
||
| 2612 | */ |
||
| 2613 | final public function isDefaultFilter(string $name): bool |
||
| 2624 | |||
| 2625 | public function canAccessObject(string $action, object $object): bool |
||
| 2629 | |||
| 2630 | public function configureActionButtons(array $buttonList, string $action, ?object $object = null): array |
||
| 2634 | |||
| 2635 | /** |
||
| 2636 | * Hook to run after initilization. |
||
| 2637 | */ |
||
| 2638 | protected function configure(): void |
||
| 2641 | |||
| 2642 | protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterface |
||
| 2646 | |||
| 2647 | /** |
||
| 2648 | * urlize the given word. |
||
| 2649 | * |
||
| 2650 | * @param string $word |
||
| 2651 | * @param string $sep the separator |
||
| 2652 | * |
||
| 2653 | * @return string |
||
| 2654 | */ |
||
| 2655 | final protected function urlize($word, $sep = '_') |
||
| 2659 | |||
| 2660 | final protected function getTemplateRegistry(): MutableTemplateRegistryInterface |
||
| 2664 | |||
| 2665 | /** |
||
| 2666 | * Returns a list of default filters. |
||
| 2667 | * |
||
| 2668 | * @return array |
||
| 2669 | */ |
||
| 2670 | final protected function getDefaultFilterValues() |
||
| 2685 | |||
| 2686 | protected function configureFormFields(FormMapper $form): void |
||
| 2689 | |||
| 2690 | protected function configureListFields(ListMapper $list): void |
||
| 2693 | |||
| 2694 | protected function configureDatagridFilters(DatagridMapper $filter): void |
||
| 2697 | |||
| 2698 | protected function configureShowFields(ShowMapper $show): void |
||
| 2701 | |||
| 2702 | protected function configureRoutes(RouteCollection $collection): void |
||
| 2705 | |||
| 2706 | /** |
||
| 2707 | * Allows you to customize batch actions. |
||
| 2708 | * |
||
| 2709 | * @param array $actions List of actions |
||
| 2710 | * |
||
| 2711 | * @return array |
||
| 2712 | */ |
||
| 2713 | protected function configureBatchActions($actions) |
||
| 2717 | |||
| 2718 | /** |
||
| 2719 | * NEXT_MAJOR: remove this method. |
||
| 2720 | * |
||
| 2721 | * @deprecated Use configureTabMenu instead |
||
| 2722 | */ |
||
| 2723 | protected function configureSideMenu(ItemInterface $menu, $action, ?AdminInterface $childAdmin = null) |
||
| 2726 | |||
| 2727 | /** |
||
| 2728 | * Configures the tab menu in your admin. |
||
| 2729 | * |
||
| 2730 | * @param string $action |
||
| 2731 | */ |
||
| 2732 | protected function configureTabMenu(ItemInterface $menu, $action, ?AdminInterface $childAdmin = null) |
||
| 2738 | |||
| 2739 | /** |
||
| 2740 | * build the view FieldDescription array. |
||
| 2741 | */ |
||
| 2742 | protected function buildShow(): void |
||
| 2757 | |||
| 2758 | /** |
||
| 2759 | * build the list FieldDescription array. |
||
| 2760 | */ |
||
| 2761 | protected function buildList(): void |
||
| 2813 | |||
| 2814 | /** |
||
| 2815 | * Build the form FieldDescription collection. |
||
| 2816 | */ |
||
| 2817 | protected function buildForm(): void |
||
| 2850 | |||
| 2851 | /** |
||
| 2852 | * Gets the subclass corresponding to the given name. |
||
| 2853 | * |
||
| 2854 | * @param string $name The name of the sub class |
||
| 2855 | * |
||
| 2856 | * @return string the subclass |
||
| 2857 | */ |
||
| 2858 | protected function getSubClass($name) |
||
| 2870 | |||
| 2871 | /** |
||
| 2872 | * Attach the inline validator to the model metadata, this must be done once per admin. |
||
| 2873 | */ |
||
| 2874 | protected function attachInlineValidator(): void |
||
| 2901 | |||
| 2902 | /** |
||
| 2903 | * Predefine per page options. |
||
| 2904 | */ |
||
| 2905 | protected function predefinePerPageOptions(): void |
||
| 2911 | |||
| 2912 | /** |
||
| 2913 | * Return list routes with permissions name. |
||
| 2914 | * |
||
| 2915 | * @return array<string, string> |
||
| 2916 | */ |
||
| 2917 | protected function getAccess() |
||
| 2939 | |||
| 2940 | /** |
||
| 2941 | * Configures a list of default filters. |
||
| 2942 | */ |
||
| 2943 | protected function configureDefaultFilterValues(array &$filterValues): void |
||
| 2946 | |||
| 2947 | /** |
||
| 2948 | * {@inheritdoc} |
||
| 2949 | */ |
||
| 2950 | private function buildDatagrid(): void |
||
| 3002 | |||
| 3003 | /** |
||
| 3004 | * Build all the related urls to the current admin. |
||
| 3005 | */ |
||
| 3006 | private function buildRoutes(): void |
||
| 3029 | } |
||
| 3030 | |||
| 3032 |
If you suppress an error, we recommend checking for the error condition explicitly: