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 |
||
| 61 | abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface, AdminTreeInterface |
||
| 62 | { |
||
| 63 | public const CONTEXT_MENU = 'menu'; |
||
| 64 | public const CONTEXT_DASHBOARD = 'dashboard'; |
||
| 65 | |||
| 66 | public const CLASS_REGEX = |
||
| 67 | '@ |
||
| 68 | (?:([A-Za-z0-9]*)\\\)? # vendor name / app name |
||
| 69 | (Bundle\\\)? # optional bundle directory |
||
| 70 | ([A-Za-z0-9]+?)(?:Bundle)?\\\ # bundle name, with optional suffix |
||
| 71 | ( |
||
| 72 | Entity|Document|Model|PHPCR|CouchDocument|Phpcr| |
||
| 73 | Doctrine\\\Orm|Doctrine\\\Phpcr|Doctrine\\\MongoDB|Doctrine\\\CouchDB |
||
| 74 | )\\\(.*)@x'; |
||
| 75 | |||
| 76 | public const MOSAIC_ICON_CLASS = 'fa fa-th-large fa-fw'; |
||
| 77 | |||
| 78 | /** |
||
| 79 | * The list FieldDescription constructed from the configureListField method. |
||
| 80 | * |
||
| 81 | * @var FieldDescriptionInterface[] |
||
| 82 | */ |
||
| 83 | protected $listFieldDescriptions = []; |
||
| 84 | |||
| 85 | /** |
||
| 86 | * The show FieldDescription constructed from the configureShowFields method. |
||
| 87 | * |
||
| 88 | * @var FieldDescriptionInterface[] |
||
| 89 | */ |
||
| 90 | protected $showFieldDescriptions = []; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * The list FieldDescription constructed from the configureFormField method. |
||
| 94 | * |
||
| 95 | * @var FieldDescriptionInterface[] |
||
| 96 | */ |
||
| 97 | protected $formFieldDescriptions = []; |
||
| 98 | |||
| 99 | /** |
||
| 100 | * The filter FieldDescription constructed from the configureFilterField method. |
||
| 101 | * |
||
| 102 | * @var FieldDescriptionInterface[] |
||
| 103 | */ |
||
| 104 | protected $filterFieldDescriptions = []; |
||
| 105 | |||
| 106 | /** |
||
| 107 | * NEXT_MAJOR: Remove this property. |
||
| 108 | * |
||
| 109 | * The number of result to display in the list. |
||
| 110 | * |
||
| 111 | * @deprecated since sonata-project/admin-bundle 3.67. |
||
| 112 | * |
||
| 113 | * @var int |
||
| 114 | */ |
||
| 115 | protected $maxPerPage = 32; |
||
| 116 | |||
| 117 | /** |
||
| 118 | * The maximum number of page numbers to display in the list. |
||
| 119 | * |
||
| 120 | * @var int |
||
| 121 | */ |
||
| 122 | protected $maxPageLinks = 25; |
||
| 123 | |||
| 124 | /** |
||
| 125 | * The base route name used to generate the routing information. |
||
| 126 | * |
||
| 127 | * @var string |
||
| 128 | */ |
||
| 129 | protected $baseRouteName; |
||
| 130 | |||
| 131 | /** |
||
| 132 | * The base route pattern used to generate the routing information. |
||
| 133 | * |
||
| 134 | * @var string |
||
| 135 | */ |
||
| 136 | protected $baseRoutePattern; |
||
| 137 | |||
| 138 | /** |
||
| 139 | * The base name controller used to generate the routing information. |
||
| 140 | * |
||
| 141 | * @var string |
||
| 142 | */ |
||
| 143 | protected $baseControllerName; |
||
| 144 | |||
| 145 | /** |
||
| 146 | * The label class name (used in the title/breadcrumb ...). |
||
| 147 | * |
||
| 148 | * @var string |
||
| 149 | */ |
||
| 150 | protected $classnameLabel; |
||
| 151 | |||
| 152 | /** |
||
| 153 | * The translation domain to be used to translate messages. |
||
| 154 | * |
||
| 155 | * @var string |
||
| 156 | */ |
||
| 157 | protected $translationDomain = 'messages'; |
||
| 158 | |||
| 159 | /** |
||
| 160 | * Options to set to the form (ie, validation_groups). |
||
| 161 | * |
||
| 162 | * @var array |
||
| 163 | */ |
||
| 164 | protected $formOptions = []; |
||
| 165 | |||
| 166 | /** |
||
| 167 | * NEXT_MAJOR: Remove this property. |
||
| 168 | * |
||
| 169 | * Default values to the datagrid. |
||
| 170 | * |
||
| 171 | * @deprecated since sonata-project/admin-bundle 3.67, use configureDefaultSortValues() instead. |
||
| 172 | * |
||
| 173 | * @var array |
||
| 174 | */ |
||
| 175 | protected $datagridValues = [ |
||
| 176 | '_page' => 1, |
||
| 177 | '_per_page' => 32, |
||
| 178 | ]; |
||
| 179 | |||
| 180 | /** |
||
| 181 | * NEXT_MAJOR: Remove this property. |
||
| 182 | * |
||
| 183 | * Predefined per page options. |
||
| 184 | * |
||
| 185 | * @deprecated since sonata-project/admin-bundle 3.67. |
||
| 186 | * |
||
| 187 | * @var array |
||
| 188 | */ |
||
| 189 | protected $perPageOptions = [16, 32, 64, 128, 256]; |
||
| 190 | |||
| 191 | /** |
||
| 192 | * Pager type. |
||
| 193 | * |
||
| 194 | * @var string |
||
| 195 | */ |
||
| 196 | protected $pagerType = Pager::TYPE_DEFAULT; |
||
| 197 | |||
| 198 | /** |
||
| 199 | * The code related to the admin. |
||
| 200 | * |
||
| 201 | * @var string |
||
| 202 | */ |
||
| 203 | protected $code; |
||
| 204 | |||
| 205 | /** |
||
| 206 | * The label. |
||
| 207 | * |
||
| 208 | * @var string |
||
| 209 | */ |
||
| 210 | protected $label; |
||
| 211 | |||
| 212 | /** |
||
| 213 | * Whether or not to persist the filters in the session. |
||
| 214 | * |
||
| 215 | * NEXT_MAJOR: remove this property |
||
| 216 | * |
||
| 217 | * @var bool |
||
| 218 | * |
||
| 219 | * @deprecated since sonata-project/admin-bundle 3.34, to be removed in 4.0. |
||
| 220 | */ |
||
| 221 | protected $persistFilters = false; |
||
| 222 | |||
| 223 | /** |
||
| 224 | * Array of routes related to this admin. |
||
| 225 | * |
||
| 226 | * @var RouteCollection |
||
| 227 | */ |
||
| 228 | protected $routes; |
||
| 229 | |||
| 230 | /** |
||
| 231 | * The subject only set in edit/update/create mode. |
||
| 232 | * |
||
| 233 | * @var object|null |
||
| 234 | */ |
||
| 235 | protected $subject; |
||
| 236 | |||
| 237 | /** |
||
| 238 | * Define a Collection of child admin, ie /admin/order/{id}/order-element/{childId}. |
||
| 239 | * |
||
| 240 | * @var array |
||
| 241 | */ |
||
| 242 | protected $children = []; |
||
| 243 | |||
| 244 | /** |
||
| 245 | * Reference the parent admin. |
||
| 246 | * |
||
| 247 | * @var AdminInterface|null |
||
| 248 | */ |
||
| 249 | protected $parent; |
||
| 250 | |||
| 251 | /** |
||
| 252 | * The base code route refer to the prefix used to generate the route name. |
||
| 253 | * |
||
| 254 | * NEXT_MAJOR: remove this attribute. |
||
| 255 | * |
||
| 256 | * @deprecated This attribute is deprecated since sonata-project/admin-bundle 3.24 and will be removed in 4.0 |
||
| 257 | * |
||
| 258 | * @var string |
||
| 259 | */ |
||
| 260 | protected $baseCodeRoute = ''; |
||
| 261 | |||
| 262 | /** |
||
| 263 | * NEXT_MAJOR: should be default array and private. |
||
| 264 | * |
||
| 265 | * @var string|array |
||
| 266 | */ |
||
| 267 | protected $parentAssociationMapping; |
||
| 268 | |||
| 269 | /** |
||
| 270 | * Reference the parent FieldDescription related to this admin |
||
| 271 | * only set for FieldDescription which is associated to an Sub Admin instance. |
||
| 272 | * |
||
| 273 | * @var FieldDescriptionInterface |
||
| 274 | */ |
||
| 275 | protected $parentFieldDescription; |
||
| 276 | |||
| 277 | /** |
||
| 278 | * If true then the current admin is part of the nested admin set (from the url). |
||
| 279 | * |
||
| 280 | * @var bool |
||
| 281 | */ |
||
| 282 | protected $currentChild = false; |
||
| 283 | |||
| 284 | /** |
||
| 285 | * The uniqid is used to avoid clashing with 2 admin related to the code |
||
| 286 | * ie: a Block linked to a Block. |
||
| 287 | * |
||
| 288 | * @var string |
||
| 289 | */ |
||
| 290 | protected $uniqid; |
||
| 291 | |||
| 292 | /** |
||
| 293 | * The Entity or Document manager. |
||
| 294 | * |
||
| 295 | * @var ModelManagerInterface |
||
| 296 | */ |
||
| 297 | protected $modelManager; |
||
| 298 | |||
| 299 | /** |
||
| 300 | * The current request object. |
||
| 301 | * |
||
| 302 | * @var Request|null |
||
| 303 | */ |
||
| 304 | protected $request; |
||
| 305 | |||
| 306 | /** |
||
| 307 | * The translator component. |
||
| 308 | * |
||
| 309 | * NEXT_MAJOR: remove this property |
||
| 310 | * |
||
| 311 | * @var \Symfony\Component\Translation\TranslatorInterface |
||
| 312 | * |
||
| 313 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 314 | */ |
||
| 315 | protected $translator; |
||
| 316 | |||
| 317 | /** |
||
| 318 | * The related form contractor. |
||
| 319 | * |
||
| 320 | * @var FormContractorInterface |
||
| 321 | */ |
||
| 322 | protected $formContractor; |
||
| 323 | |||
| 324 | /** |
||
| 325 | * The related list builder. |
||
| 326 | * |
||
| 327 | * @var ListBuilderInterface |
||
| 328 | */ |
||
| 329 | protected $listBuilder; |
||
| 330 | |||
| 331 | /** |
||
| 332 | * The related view builder. |
||
| 333 | * |
||
| 334 | * @var ShowBuilderInterface |
||
| 335 | */ |
||
| 336 | protected $showBuilder; |
||
| 337 | |||
| 338 | /** |
||
| 339 | * The related datagrid builder. |
||
| 340 | * |
||
| 341 | * @var DatagridBuilderInterface |
||
| 342 | */ |
||
| 343 | protected $datagridBuilder; |
||
| 344 | |||
| 345 | /** |
||
| 346 | * @var RouteBuilderInterface |
||
| 347 | */ |
||
| 348 | protected $routeBuilder; |
||
| 349 | |||
| 350 | /** |
||
| 351 | * The datagrid instance. |
||
| 352 | * |
||
| 353 | * @var DatagridInterface|null |
||
| 354 | */ |
||
| 355 | protected $datagrid; |
||
| 356 | |||
| 357 | /** |
||
| 358 | * The router instance. |
||
| 359 | * |
||
| 360 | * @var RouteGeneratorInterface|null |
||
| 361 | */ |
||
| 362 | protected $routeGenerator; |
||
| 363 | |||
| 364 | /** |
||
| 365 | * The generated breadcrumbs. |
||
| 366 | * |
||
| 367 | * NEXT_MAJOR : remove this property |
||
| 368 | * |
||
| 369 | * @var array |
||
| 370 | */ |
||
| 371 | protected $breadcrumbs = []; |
||
| 372 | |||
| 373 | /** |
||
| 374 | * @var SecurityHandlerInterface |
||
| 375 | */ |
||
| 376 | protected $securityHandler; |
||
| 377 | |||
| 378 | /** |
||
| 379 | * @var ValidatorInterface |
||
| 380 | */ |
||
| 381 | protected $validator; |
||
| 382 | |||
| 383 | /** |
||
| 384 | * The configuration pool. |
||
| 385 | * |
||
| 386 | * @var Pool |
||
| 387 | */ |
||
| 388 | protected $configurationPool; |
||
| 389 | |||
| 390 | /** |
||
| 391 | * @var ItemInterface |
||
| 392 | */ |
||
| 393 | protected $menu; |
||
| 394 | |||
| 395 | /** |
||
| 396 | * @var FactoryInterface |
||
| 397 | */ |
||
| 398 | protected $menuFactory; |
||
| 399 | |||
| 400 | /** |
||
| 401 | * @var array<string, bool> |
||
| 402 | */ |
||
| 403 | protected $loaded = [ |
||
| 404 | 'view_fields' => false, // NEXT_MAJOR: Remove this unused value. |
||
| 405 | 'view_groups' => false, // NEXT_MAJOR: Remove this unused value. |
||
| 406 | 'routes' => false, |
||
| 407 | 'tab_menu' => false, |
||
| 408 | 'show' => false, |
||
| 409 | 'list' => false, |
||
| 410 | 'form' => false, |
||
| 411 | 'datagrid' => false, |
||
| 412 | ]; |
||
| 413 | |||
| 414 | /** |
||
| 415 | * @var string[] |
||
| 416 | */ |
||
| 417 | protected $formTheme = []; |
||
| 418 | |||
| 419 | /** |
||
| 420 | * @var string[] |
||
| 421 | */ |
||
| 422 | protected $filterTheme = []; |
||
| 423 | |||
| 424 | /** |
||
| 425 | * @var array<string, string> |
||
| 426 | * |
||
| 427 | * @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry services instead |
||
| 428 | */ |
||
| 429 | protected $templates = []; |
||
| 430 | |||
| 431 | /** |
||
| 432 | * @var AdminExtensionInterface[] |
||
| 433 | */ |
||
| 434 | protected $extensions = []; |
||
| 435 | |||
| 436 | /** |
||
| 437 | * @var LabelTranslatorStrategyInterface |
||
| 438 | */ |
||
| 439 | protected $labelTranslatorStrategy; |
||
| 440 | |||
| 441 | /** |
||
| 442 | * Setting to true will enable preview mode for |
||
| 443 | * the entity and show a preview button in the |
||
| 444 | * edit/create forms. |
||
| 445 | * |
||
| 446 | * @var bool |
||
| 447 | */ |
||
| 448 | protected $supportsPreviewMode = false; |
||
| 449 | |||
| 450 | /** |
||
| 451 | * Roles and permissions per role. |
||
| 452 | * |
||
| 453 | * @var array 'role' => ['permission', 'permission'] |
||
| 454 | */ |
||
| 455 | protected $securityInformation = []; |
||
| 456 | |||
| 457 | protected $cacheIsGranted = []; |
||
| 458 | |||
| 459 | /** |
||
| 460 | * Action list for the search result. |
||
| 461 | * |
||
| 462 | * @var string[] |
||
| 463 | */ |
||
| 464 | protected $searchResultActions = ['edit', 'show']; |
||
| 465 | |||
| 466 | protected $listModes = [ |
||
| 467 | 'list' => [ |
||
| 468 | 'class' => 'fa fa-list fa-fw', |
||
| 469 | ], |
||
| 470 | 'mosaic' => [ |
||
| 471 | 'class' => self::MOSAIC_ICON_CLASS, |
||
| 472 | ], |
||
| 473 | ]; |
||
| 474 | |||
| 475 | /** |
||
| 476 | * The Access mapping. |
||
| 477 | * |
||
| 478 | * @var array [action1 => requiredRole1, action2 => [requiredRole2, requiredRole3]] |
||
| 479 | */ |
||
| 480 | protected $accessMapping = []; |
||
| 481 | |||
| 482 | /** |
||
| 483 | * @var MutableTemplateRegistryInterface |
||
| 484 | */ |
||
| 485 | private $templateRegistry; |
||
| 486 | |||
| 487 | /** |
||
| 488 | * The class name managed by the admin class. |
||
| 489 | * |
||
| 490 | * @var string |
||
| 491 | */ |
||
| 492 | private $class; |
||
| 493 | |||
| 494 | /** |
||
| 495 | * The subclasses supported by the admin class. |
||
| 496 | * |
||
| 497 | * @var array<string, string> |
||
| 498 | */ |
||
| 499 | private $subClasses = []; |
||
| 500 | |||
| 501 | /** |
||
| 502 | * The list collection. |
||
| 503 | * |
||
| 504 | * @var FieldDescriptionCollection|null |
||
| 505 | */ |
||
| 506 | private $list; |
||
| 507 | |||
| 508 | /** |
||
| 509 | * @var FieldDescriptionCollection|null |
||
| 510 | */ |
||
| 511 | private $show; |
||
| 512 | |||
| 513 | /** |
||
| 514 | * @var Form|null |
||
| 515 | */ |
||
| 516 | private $form; |
||
| 517 | |||
| 518 | /** |
||
| 519 | * The cached base route name. |
||
| 520 | * |
||
| 521 | * @var string |
||
| 522 | */ |
||
| 523 | private $cachedBaseRouteName; |
||
| 524 | |||
| 525 | /** |
||
| 526 | * The cached base route pattern. |
||
| 527 | * |
||
| 528 | * @var string |
||
| 529 | */ |
||
| 530 | private $cachedBaseRoutePattern; |
||
| 531 | |||
| 532 | /** |
||
| 533 | * The form group disposition. |
||
| 534 | * |
||
| 535 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 536 | * hold boolean values. |
||
| 537 | * |
||
| 538 | * @var array|bool |
||
| 539 | */ |
||
| 540 | private $formGroups = false; |
||
| 541 | |||
| 542 | /** |
||
| 543 | * The form tabs disposition. |
||
| 544 | * |
||
| 545 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 546 | * hold boolean values. |
||
| 547 | * |
||
| 548 | * @var array|bool |
||
| 549 | */ |
||
| 550 | private $formTabs = false; |
||
| 551 | |||
| 552 | /** |
||
| 553 | * The view group disposition. |
||
| 554 | * |
||
| 555 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 556 | * hold boolean values. |
||
| 557 | * |
||
| 558 | * @var array|bool |
||
| 559 | */ |
||
| 560 | private $showGroups = false; |
||
| 561 | |||
| 562 | /** |
||
| 563 | * The view tab disposition. |
||
| 564 | * |
||
| 565 | * NEXT_MAJOR: must have `[]` as default value and remove the possibility to |
||
| 566 | * hold boolean values. |
||
| 567 | * |
||
| 568 | * @var array|bool |
||
| 569 | */ |
||
| 570 | private $showTabs = false; |
||
| 571 | |||
| 572 | /** |
||
| 573 | * The manager type to use for the admin. |
||
| 574 | * |
||
| 575 | * @var string |
||
| 576 | */ |
||
| 577 | private $managerType; |
||
| 578 | |||
| 579 | /** |
||
| 580 | * The breadcrumbsBuilder component. |
||
| 581 | * |
||
| 582 | * @var BreadcrumbsBuilderInterface |
||
| 583 | */ |
||
| 584 | private $breadcrumbsBuilder; |
||
| 585 | |||
| 586 | /** |
||
| 587 | * Component responsible for persisting filters. |
||
| 588 | * |
||
| 589 | * @var FilterPersisterInterface|null |
||
| 590 | */ |
||
| 591 | private $filterPersister; |
||
| 592 | |||
| 593 | /** |
||
| 594 | * @param string $code |
||
| 595 | * @param string $class |
||
| 596 | * @param string|null $baseControllerName |
||
| 597 | */ |
||
| 598 | public function __construct($code, $class, $baseControllerName = null) |
||
| 631 | |||
| 632 | /** |
||
| 633 | * {@inheritdoc} |
||
| 634 | */ |
||
| 635 | public function getExportFormats() |
||
| 641 | |||
| 642 | /** |
||
| 643 | * @return array |
||
| 644 | */ |
||
| 645 | public function getExportFields() |
||
| 657 | |||
| 658 | public function getDataSourceIterator() |
||
| 680 | |||
| 681 | public function validate(ErrorElement $errorElement, $object) |
||
| 684 | |||
| 685 | /** |
||
| 686 | * define custom variable. |
||
| 687 | */ |
||
| 688 | public function initialize() |
||
| 704 | |||
| 705 | public function configure() |
||
| 708 | |||
| 709 | public function update($object) |
||
| 729 | |||
| 730 | public function create($object) |
||
| 752 | |||
| 753 | public function delete($object) |
||
| 768 | |||
| 769 | /** |
||
| 770 | * @param object $object |
||
| 771 | */ |
||
| 772 | public function preValidate($object) |
||
| 775 | |||
| 776 | public function preUpdate($object) |
||
| 779 | |||
| 780 | public function postUpdate($object) |
||
| 783 | |||
| 784 | public function prePersist($object) |
||
| 787 | |||
| 788 | public function postPersist($object) |
||
| 791 | |||
| 792 | public function preRemove($object) |
||
| 795 | |||
| 796 | public function postRemove($object) |
||
| 799 | |||
| 800 | public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements) |
||
| 803 | |||
| 804 | public function getFilterParameters() |
||
| 856 | |||
| 857 | /** |
||
| 858 | * NEXT_MAJOR: Change the visibility to protected (similar to buildShow, buildForm, ...). |
||
| 859 | */ |
||
| 860 | public function buildDatagrid() |
||
| 914 | |||
| 915 | /** |
||
| 916 | * Returns the name of the parent related field, so the field can be use to set the default |
||
| 917 | * value (ie the parent object) or to filter the object. |
||
| 918 | * |
||
| 919 | * @throws \InvalidArgumentException |
||
| 920 | * |
||
| 921 | * @return string|null |
||
| 922 | */ |
||
| 923 | public function getParentAssociationMapping() |
||
| 943 | |||
| 944 | /** |
||
| 945 | * @param string $code |
||
| 946 | * @param string $value |
||
| 947 | */ |
||
| 948 | final public function addParentAssociationMapping($code, $value) |
||
| 952 | |||
| 953 | /** |
||
| 954 | * Returns the baseRoutePattern used to generate the routing information. |
||
| 955 | * |
||
| 956 | * @throws \RuntimeException |
||
| 957 | * |
||
| 958 | * @return string the baseRoutePattern used to generate the routing information |
||
| 959 | */ |
||
| 960 | public function getBaseRoutePattern() |
||
| 1008 | |||
| 1009 | /** |
||
| 1010 | * Returns the baseRouteName used to generate the routing information. |
||
| 1011 | * |
||
| 1012 | * @throws \RuntimeException |
||
| 1013 | * |
||
| 1014 | * @return string the baseRouteName used to generate the routing information |
||
| 1015 | */ |
||
| 1016 | public function getBaseRouteName() |
||
| 1065 | |||
| 1066 | /** |
||
| 1067 | * urlize the given word. |
||
| 1068 | * |
||
| 1069 | * @param string $word |
||
| 1070 | * @param string $sep the separator |
||
| 1071 | * |
||
| 1072 | * @return string |
||
| 1073 | */ |
||
| 1074 | public function urlize($word, $sep = '_') |
||
| 1078 | |||
| 1079 | public function getClass() |
||
| 1102 | |||
| 1103 | public function getSubClasses() |
||
| 1107 | |||
| 1108 | /** |
||
| 1109 | * NEXT_MAJOR: remove this method. |
||
| 1110 | */ |
||
| 1111 | public function addSubClass($subClass) |
||
| 1122 | |||
| 1123 | public function setSubClasses(array $subClasses) |
||
| 1127 | |||
| 1128 | public function hasSubClass($name) |
||
| 1132 | |||
| 1133 | public function hasActiveSubClass() |
||
| 1141 | |||
| 1142 | public function getActiveSubClass() |
||
| 1163 | |||
| 1164 | public function getActiveSubclassCode() |
||
| 1204 | |||
| 1205 | public function getBatchActions() |
||
| 1238 | |||
| 1239 | public function getRoutes() |
||
| 1245 | |||
| 1246 | public function getRouterIdParameter() |
||
| 1250 | |||
| 1251 | public function getIdParameter() |
||
| 1261 | |||
| 1262 | public function hasRoute($name) |
||
| 1270 | |||
| 1271 | /** |
||
| 1272 | * @param string $name |
||
| 1273 | * @param string|null $adminCode |
||
| 1274 | * |
||
| 1275 | * @return bool |
||
| 1276 | */ |
||
| 1277 | public function isCurrentRoute($name, $adminCode = null) |
||
| 1298 | |||
| 1299 | public function generateObjectUrl($name, $object, array $parameters = [], $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1305 | |||
| 1306 | public function generateUrl($name, array $parameters = [], $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1310 | |||
| 1311 | public function generateMenuUrl($name, array $parameters = [], $referenceType = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1315 | |||
| 1316 | final public function setTemplateRegistry(MutableTemplateRegistryInterface $templateRegistry) |
||
| 1320 | |||
| 1321 | /** |
||
| 1322 | * @param array<string, string> $templates |
||
| 1323 | */ |
||
| 1324 | public function setTemplates(array $templates) |
||
| 1331 | |||
| 1332 | /** |
||
| 1333 | * @param string $name |
||
| 1334 | * @param string $template |
||
| 1335 | */ |
||
| 1336 | public function setTemplate($name, $template) |
||
| 1343 | |||
| 1344 | /** |
||
| 1345 | * @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry services instead |
||
| 1346 | * |
||
| 1347 | * @return array<string, string> |
||
| 1348 | */ |
||
| 1349 | public function getTemplates() |
||
| 1353 | |||
| 1354 | /** |
||
| 1355 | * @deprecated since sonata-project/admin-bundle 3.34, will be dropped in 4.0. Use TemplateRegistry services instead |
||
| 1356 | * |
||
| 1357 | * @param string $name |
||
| 1358 | * |
||
| 1359 | * @return string|null |
||
| 1360 | */ |
||
| 1361 | public function getTemplate($name) |
||
| 1365 | |||
| 1366 | public function getNewInstance() |
||
| 1378 | |||
| 1379 | public function getFormBuilder() |
||
| 1392 | |||
| 1393 | /** |
||
| 1394 | * This method is being called by the main admin class and the child class, |
||
| 1395 | * the getFormBuilder is only call by the main admin class. |
||
| 1396 | */ |
||
| 1397 | public function defineFormBuilder(FormBuilderInterface $formBuilder) |
||
| 1423 | |||
| 1424 | public function attachAdminClass(FieldDescriptionInterface $fieldDescription) |
||
| 1457 | |||
| 1458 | public function getObject($id) |
||
| 1467 | |||
| 1468 | public function getForm() |
||
| 1474 | |||
| 1475 | public function getList() |
||
| 1481 | |||
| 1482 | /** |
||
| 1483 | * @final since sonata-project/admin-bundle 3.63.0 |
||
| 1484 | */ |
||
| 1485 | public function createQuery($context = 'list') |
||
| 1503 | |||
| 1504 | public function getDatagrid() |
||
| 1510 | |||
| 1511 | public function buildTabMenu($action, ?AdminInterface $childAdmin = null) |
||
| 1538 | |||
| 1539 | public function buildSideMenu($action, ?AdminInterface $childAdmin = null) |
||
| 1543 | |||
| 1544 | /** |
||
| 1545 | * @param string $action |
||
| 1546 | * |
||
| 1547 | * @return ItemInterface |
||
| 1548 | */ |
||
| 1549 | public function getSideMenu($action, ?AdminInterface $childAdmin = null) |
||
| 1559 | |||
| 1560 | /** |
||
| 1561 | * Returns the root code. |
||
| 1562 | * |
||
| 1563 | * @return string the root code |
||
| 1564 | */ |
||
| 1565 | public function getRootCode() |
||
| 1569 | |||
| 1570 | /** |
||
| 1571 | * Returns the master admin. |
||
| 1572 | * |
||
| 1573 | * @return AbstractAdmin the root admin class |
||
| 1574 | */ |
||
| 1575 | public function getRoot() |
||
| 1583 | |||
| 1584 | public function setBaseControllerName($baseControllerName) |
||
| 1588 | |||
| 1589 | public function getBaseControllerName() |
||
| 1593 | |||
| 1594 | /** |
||
| 1595 | * @param string $label |
||
| 1596 | */ |
||
| 1597 | public function setLabel($label) |
||
| 1601 | |||
| 1602 | public function getLabel() |
||
| 1606 | |||
| 1607 | /** |
||
| 1608 | * @param bool $persist |
||
| 1609 | * |
||
| 1610 | * NEXT_MAJOR: remove this method |
||
| 1611 | * |
||
| 1612 | * @deprecated since sonata-project/admin-bundle 3.34, to be removed in 4.0. |
||
| 1613 | */ |
||
| 1614 | public function setPersistFilters($persist) |
||
| 1623 | |||
| 1624 | public function setFilterPersister(?FilterPersisterInterface $filterPersister = null) |
||
| 1630 | |||
| 1631 | /** |
||
| 1632 | * NEXT_MAJOR: Remove this method. |
||
| 1633 | * |
||
| 1634 | * @deprecated since sonata-project/admin-bundle 3.67, to be removed in 4.0. |
||
| 1635 | * |
||
| 1636 | * @param int $maxPerPage |
||
| 1637 | */ |
||
| 1638 | public function setMaxPerPage($maxPerPage) |
||
| 1647 | |||
| 1648 | /** |
||
| 1649 | * @return int |
||
| 1650 | */ |
||
| 1651 | public function getMaxPerPage() |
||
| 1659 | |||
| 1660 | /** |
||
| 1661 | * @param int $maxPageLinks |
||
| 1662 | */ |
||
| 1663 | public function setMaxPageLinks($maxPageLinks) |
||
| 1667 | |||
| 1668 | /** |
||
| 1669 | * @return int |
||
| 1670 | */ |
||
| 1671 | public function getMaxPageLinks() |
||
| 1675 | |||
| 1676 | public function getFormGroups() |
||
| 1688 | |||
| 1689 | public function setFormGroups(array $formGroups) |
||
| 1693 | |||
| 1694 | public function removeFieldFromFormGroup($key) |
||
| 1704 | |||
| 1705 | /** |
||
| 1706 | * @param string $group |
||
| 1707 | */ |
||
| 1708 | public function reorderFormGroup($group, array $keys) |
||
| 1715 | |||
| 1716 | public function getFormTabs() |
||
| 1728 | |||
| 1729 | public function setFormTabs(array $formTabs) |
||
| 1733 | |||
| 1734 | public function getShowTabs() |
||
| 1746 | |||
| 1747 | public function setShowTabs(array $showTabs) |
||
| 1751 | |||
| 1752 | public function getShowGroups() |
||
| 1764 | |||
| 1765 | public function setShowGroups(array $showGroups) |
||
| 1769 | |||
| 1770 | public function reorderShowGroup($group, array $keys) |
||
| 1777 | |||
| 1778 | public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription) |
||
| 1782 | |||
| 1783 | public function getParentFieldDescription() |
||
| 1804 | |||
| 1805 | public function hasParentFieldDescription() |
||
| 1809 | |||
| 1810 | public function setSubject($subject) |
||
| 1825 | |||
| 1826 | public function getSubject() |
||
| 1846 | |||
| 1847 | public function hasSubject() |
||
| 1859 | |||
| 1860 | public function getFormFieldDescriptions() |
||
| 1866 | |||
| 1867 | public function getFormFieldDescription($name) |
||
| 1891 | |||
| 1892 | /** |
||
| 1893 | * Returns true if the admin has a FieldDescription with the given $name. |
||
| 1894 | * |
||
| 1895 | * @param string $name |
||
| 1896 | * |
||
| 1897 | * @return bool |
||
| 1898 | */ |
||
| 1899 | public function hasFormFieldDescription($name) |
||
| 1905 | |||
| 1906 | public function addFormFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1910 | |||
| 1911 | /** |
||
| 1912 | * remove a FieldDescription. |
||
| 1913 | * |
||
| 1914 | * @param string $name |
||
| 1915 | */ |
||
| 1916 | public function removeFormFieldDescription($name) |
||
| 1920 | |||
| 1921 | /** |
||
| 1922 | * build and return the collection of form FieldDescription. |
||
| 1923 | * |
||
| 1924 | * @return FieldDescriptionInterface[] collection of form FieldDescription |
||
| 1925 | */ |
||
| 1926 | public function getShowFieldDescriptions() |
||
| 1932 | |||
| 1933 | /** |
||
| 1934 | * Returns the form FieldDescription with the given $name. |
||
| 1935 | * |
||
| 1936 | * @param string $name |
||
| 1937 | * |
||
| 1938 | * @return FieldDescriptionInterface |
||
| 1939 | */ |
||
| 1940 | public function getShowFieldDescription($name) |
||
| 1964 | |||
| 1965 | public function hasShowFieldDescription($name) |
||
| 1971 | |||
| 1972 | public function addShowFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1976 | |||
| 1977 | public function removeShowFieldDescription($name) |
||
| 1981 | |||
| 1982 | public function getListFieldDescriptions() |
||
| 1988 | |||
| 1989 | public function getListFieldDescription($name) |
||
| 2014 | |||
| 2015 | public function hasListFieldDescription($name) |
||
| 2021 | |||
| 2022 | public function addListFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 2026 | |||
| 2027 | public function removeListFieldDescription($name) |
||
| 2031 | |||
| 2032 | public function getFilterFieldDescription($name) |
||
| 2056 | |||
| 2057 | public function hasFilterFieldDescription($name) |
||
| 2063 | |||
| 2064 | public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 2068 | |||
| 2069 | public function removeFilterFieldDescription($name) |
||
| 2073 | |||
| 2074 | public function getFilterFieldDescriptions() |
||
| 2080 | |||
| 2081 | public function addChild(AdminInterface $child) |
||
| 2113 | |||
| 2114 | public function hasChild($code) |
||
| 2118 | |||
| 2119 | public function getChildren() |
||
| 2123 | |||
| 2124 | public function getChild($code) |
||
| 2145 | |||
| 2146 | public function setParent(AdminInterface $parent) |
||
| 2150 | |||
| 2151 | public function getParent() |
||
| 2171 | |||
| 2172 | final public function getRootAncestor() |
||
| 2182 | |||
| 2183 | final public function getChildDepth() |
||
| 2195 | |||
| 2196 | final public function getCurrentLeafChildAdmin() |
||
| 2210 | |||
| 2211 | public function isChild() |
||
| 2215 | |||
| 2216 | /** |
||
| 2217 | * Returns true if the admin has children, false otherwise. |
||
| 2218 | * |
||
| 2219 | * @return bool if the admin has children |
||
| 2220 | */ |
||
| 2221 | public function hasChildren() |
||
| 2225 | |||
| 2226 | public function setUniqid($uniqid) |
||
| 2230 | |||
| 2231 | public function getUniqid() |
||
| 2239 | |||
| 2240 | /** |
||
| 2241 | * Returns the classname label. |
||
| 2242 | * |
||
| 2243 | * @return string the classname label |
||
| 2244 | */ |
||
| 2245 | public function getClassnameLabel() |
||
| 2249 | |||
| 2250 | public function getPersistentParameters() |
||
| 2269 | |||
| 2270 | /** |
||
| 2271 | * @param string $name |
||
| 2272 | * |
||
| 2273 | * @return mixed|null |
||
| 2274 | */ |
||
| 2275 | public function getPersistentParameter($name) |
||
| 2281 | |||
| 2282 | public function getBreadcrumbs($action) |
||
| 2293 | |||
| 2294 | /** |
||
| 2295 | * Generates the breadcrumbs array. |
||
| 2296 | * |
||
| 2297 | * Note: the method will be called by the top admin instance (parent => child) |
||
| 2298 | * |
||
| 2299 | * @param string $action |
||
| 2300 | * |
||
| 2301 | * @return array |
||
| 2302 | */ |
||
| 2303 | public function buildBreadcrumbs($action, ?ItemInterface $menu = null) |
||
| 2317 | |||
| 2318 | /** |
||
| 2319 | * NEXT_MAJOR : remove this method. |
||
| 2320 | * |
||
| 2321 | * @return BreadcrumbsBuilderInterface |
||
| 2322 | */ |
||
| 2323 | final public function getBreadcrumbsBuilder() |
||
| 2338 | |||
| 2339 | /** |
||
| 2340 | * NEXT_MAJOR : remove this method. |
||
| 2341 | * |
||
| 2342 | * @return AbstractAdmin |
||
| 2343 | */ |
||
| 2344 | final public function setBreadcrumbsBuilder(BreadcrumbsBuilderInterface $value) |
||
| 2355 | |||
| 2356 | public function setCurrentChild($currentChild) |
||
| 2360 | |||
| 2361 | /** |
||
| 2362 | * NEXT_MAJOR: Remove this method. |
||
| 2363 | * |
||
| 2364 | * @deprecated since sonata-project/admin-bundle 3.65, to be removed in 4.0 |
||
| 2365 | */ |
||
| 2366 | public function getCurrentChild() |
||
| 2377 | |||
| 2378 | public function isCurrentChild(): bool |
||
| 2382 | |||
| 2383 | /** |
||
| 2384 | * Returns the current child admin instance. |
||
| 2385 | * |
||
| 2386 | * @return AdminInterface|null the current child admin instance |
||
| 2387 | */ |
||
| 2388 | public function getCurrentChildAdmin() |
||
| 2398 | |||
| 2399 | public function trans($id, array $parameters = [], $domain = null, $locale = null) |
||
| 2410 | |||
| 2411 | /** |
||
| 2412 | * Translate a message id. |
||
| 2413 | * |
||
| 2414 | * NEXT_MAJOR: remove this method |
||
| 2415 | * |
||
| 2416 | * @param string $id |
||
| 2417 | * @param int $count |
||
| 2418 | * @param string|null $domain |
||
| 2419 | * @param string|null $locale |
||
| 2420 | * |
||
| 2421 | * @return string the translated string |
||
| 2422 | * |
||
| 2423 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 2424 | */ |
||
| 2425 | public function transChoice($id, $count, array $parameters = [], $domain = null, $locale = null) |
||
| 2436 | |||
| 2437 | public function setTranslationDomain($translationDomain) |
||
| 2441 | |||
| 2442 | public function getTranslationDomain() |
||
| 2446 | |||
| 2447 | /** |
||
| 2448 | * {@inheritdoc} |
||
| 2449 | * |
||
| 2450 | * NEXT_MAJOR: remove this method |
||
| 2451 | * |
||
| 2452 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 2453 | */ |
||
| 2454 | public function setTranslator(TranslatorInterface $translator) |
||
| 2466 | |||
| 2467 | /** |
||
| 2468 | * {@inheritdoc} |
||
| 2469 | * |
||
| 2470 | * NEXT_MAJOR: remove this method |
||
| 2471 | * |
||
| 2472 | * @deprecated since sonata-project/admin-bundle 3.9, to be removed with 4.0 |
||
| 2473 | */ |
||
| 2474 | public function getTranslator() |
||
| 2483 | |||
| 2484 | public function getTranslationLabel($label, $context = '', $type = '') |
||
| 2488 | |||
| 2489 | public function setRequest(Request $request) |
||
| 2497 | |||
| 2498 | public function getRequest() |
||
| 2507 | |||
| 2508 | public function hasRequest() |
||
| 2512 | |||
| 2513 | public function setFormContractor(FormContractorInterface $formBuilder) |
||
| 2517 | |||
| 2518 | /** |
||
| 2519 | * @return FormContractorInterface |
||
| 2520 | */ |
||
| 2521 | public function getFormContractor() |
||
| 2525 | |||
| 2526 | public function setDatagridBuilder(DatagridBuilderInterface $datagridBuilder) |
||
| 2530 | |||
| 2531 | public function getDatagridBuilder() |
||
| 2535 | |||
| 2536 | public function setListBuilder(ListBuilderInterface $listBuilder) |
||
| 2540 | |||
| 2541 | public function getListBuilder() |
||
| 2545 | |||
| 2546 | public function setShowBuilder(ShowBuilderInterface $showBuilder) |
||
| 2550 | |||
| 2551 | /** |
||
| 2552 | * @return ShowBuilderInterface |
||
| 2553 | */ |
||
| 2554 | public function getShowBuilder() |
||
| 2558 | |||
| 2559 | public function setConfigurationPool(Pool $configurationPool) |
||
| 2563 | |||
| 2564 | /** |
||
| 2565 | * @return Pool |
||
| 2566 | */ |
||
| 2567 | public function getConfigurationPool() |
||
| 2571 | |||
| 2572 | public function setRouteGenerator(RouteGeneratorInterface $routeGenerator) |
||
| 2576 | |||
| 2577 | /** |
||
| 2578 | * @return RouteGeneratorInterface |
||
| 2579 | */ |
||
| 2580 | public function getRouteGenerator() |
||
| 2584 | |||
| 2585 | public function getCode() |
||
| 2589 | |||
| 2590 | /** |
||
| 2591 | * NEXT_MAJOR: Remove this function. |
||
| 2592 | * |
||
| 2593 | * @deprecated This method is deprecated since sonata-project/admin-bundle 3.24 and will be removed in 4.0 |
||
| 2594 | * |
||
| 2595 | * @param string $baseCodeRoute |
||
| 2596 | */ |
||
| 2597 | public function setBaseCodeRoute($baseCodeRoute) |
||
| 2606 | |||
| 2607 | public function getBaseCodeRoute() |
||
| 2629 | |||
| 2630 | public function getModelManager() |
||
| 2634 | |||
| 2635 | public function setModelManager(ModelManagerInterface $modelManager) |
||
| 2639 | |||
| 2640 | public function getManagerType() |
||
| 2644 | |||
| 2645 | /** |
||
| 2646 | * @param string $type |
||
| 2647 | */ |
||
| 2648 | public function setManagerType($type) |
||
| 2652 | |||
| 2653 | public function getObjectIdentifier() |
||
| 2657 | |||
| 2658 | /** |
||
| 2659 | * Set the roles and permissions per role. |
||
| 2660 | */ |
||
| 2661 | public function setSecurityInformation(array $information) |
||
| 2665 | |||
| 2666 | public function getSecurityInformation() |
||
| 2670 | |||
| 2671 | /** |
||
| 2672 | * Return the list of permissions the user should have in order to display the admin. |
||
| 2673 | * |
||
| 2674 | * @param string $context |
||
| 2675 | * |
||
| 2676 | * @return array |
||
| 2677 | */ |
||
| 2678 | public function getPermissionsShow($context) |
||
| 2687 | |||
| 2688 | public function showIn($context) |
||
| 2697 | |||
| 2698 | public function createObjectSecurity($object) |
||
| 2702 | |||
| 2703 | public function setSecurityHandler(SecurityHandlerInterface $securityHandler) |
||
| 2707 | |||
| 2708 | public function getSecurityHandler() |
||
| 2712 | |||
| 2713 | public function isGranted($name, $object = null) |
||
| 2724 | |||
| 2725 | public function getUrlSafeIdentifier($model) |
||
| 2729 | |||
| 2730 | public function getNormalizedIdentifier($model) |
||
| 2734 | |||
| 2735 | public function id($model) |
||
| 2739 | |||
| 2740 | public function setValidator($validator) |
||
| 2752 | |||
| 2753 | public function getValidator() |
||
| 2757 | |||
| 2758 | public function getShow() |
||
| 2764 | |||
| 2765 | public function setFormTheme(array $formTheme) |
||
| 2769 | |||
| 2770 | public function getFormTheme() |
||
| 2774 | |||
| 2775 | public function setFilterTheme(array $filterTheme) |
||
| 2779 | |||
| 2780 | public function getFilterTheme() |
||
| 2784 | |||
| 2785 | public function addExtension(AdminExtensionInterface $extension) |
||
| 2789 | |||
| 2790 | public function getExtensions() |
||
| 2794 | |||
| 2795 | public function setMenuFactory(FactoryInterface $menuFactory) |
||
| 2799 | |||
| 2800 | public function getMenuFactory() |
||
| 2804 | |||
| 2805 | public function setRouteBuilder(RouteBuilderInterface $routeBuilder) |
||
| 2809 | |||
| 2810 | public function getRouteBuilder() |
||
| 2814 | |||
| 2815 | public function toString($object) |
||
| 2827 | |||
| 2828 | public function setLabelTranslatorStrategy(LabelTranslatorStrategyInterface $labelTranslatorStrategy) |
||
| 2832 | |||
| 2833 | public function getLabelTranslatorStrategy() |
||
| 2837 | |||
| 2838 | public function supportsPreviewMode() |
||
| 2842 | |||
| 2843 | /** |
||
| 2844 | * NEXT_MAJOR: Remove this. |
||
| 2845 | * |
||
| 2846 | * @deprecated since sonata-project/admin-bundle 3.67, to be removed in 4.0. |
||
| 2847 | * |
||
| 2848 | * Set custom per page options. |
||
| 2849 | */ |
||
| 2850 | public function setPerPageOptions(array $options) |
||
| 2859 | |||
| 2860 | /** |
||
| 2861 | * Returns predefined per page options. |
||
| 2862 | * |
||
| 2863 | * @return array |
||
| 2864 | */ |
||
| 2865 | public function getPerPageOptions() |
||
| 2877 | |||
| 2878 | /** |
||
| 2879 | * Set pager type. |
||
| 2880 | * |
||
| 2881 | * @param string $pagerType |
||
| 2882 | */ |
||
| 2883 | public function setPagerType($pagerType) |
||
| 2887 | |||
| 2888 | /** |
||
| 2889 | * Get pager type. |
||
| 2890 | * |
||
| 2891 | * @return string |
||
| 2892 | */ |
||
| 2893 | public function getPagerType() |
||
| 2897 | |||
| 2898 | /** |
||
| 2899 | * Returns true if the per page value is allowed, false otherwise. |
||
| 2900 | * |
||
| 2901 | * @param int $perPage |
||
| 2902 | * |
||
| 2903 | * @return bool |
||
| 2904 | */ |
||
| 2905 | public function determinedPerPageValue($perPage) |
||
| 2909 | |||
| 2910 | public function isAclEnabled() |
||
| 2914 | |||
| 2915 | public function getObjectMetadata($object) |
||
| 2919 | |||
| 2920 | public function getListModes() |
||
| 2924 | |||
| 2925 | public function setListMode($mode) |
||
| 2933 | |||
| 2934 | public function getListMode() |
||
| 2942 | |||
| 2943 | public function getAccessMapping() |
||
| 2947 | |||
| 2948 | public function checkAccess($action, $object = null) |
||
| 2970 | |||
| 2971 | /** |
||
| 2972 | * Hook to handle access authorization, without throw Exception. |
||
| 2973 | * |
||
| 2974 | * @param string $action |
||
| 2975 | * @param object $object |
||
| 2976 | * |
||
| 2977 | * @return bool |
||
| 2978 | */ |
||
| 2979 | public function hasAccess($action, $object = null) |
||
| 2999 | |||
| 3000 | /** |
||
| 3001 | * @param string $action |
||
| 3002 | * @param object|null $object |
||
| 3003 | * |
||
| 3004 | * @return array |
||
| 3005 | */ |
||
| 3006 | public function configureActionButtons($action, $object = null) |
||
| 3080 | |||
| 3081 | /** |
||
| 3082 | * @param string $action |
||
| 3083 | * @param object $object |
||
| 3084 | * |
||
| 3085 | * @return array |
||
| 3086 | */ |
||
| 3087 | public function getActionButtons($action, $object = null) |
||
| 3100 | |||
| 3101 | /** |
||
| 3102 | * Get the list of actions that can be accessed directly from the dashboard. |
||
| 3103 | * |
||
| 3104 | * @return array |
||
| 3105 | */ |
||
| 3106 | public function getDashboardActions() |
||
| 3133 | |||
| 3134 | /** |
||
| 3135 | * Setting to true will enable mosaic button for the admin screen. |
||
| 3136 | * Setting to false will hide mosaic button for the admin screen. |
||
| 3137 | * |
||
| 3138 | * @param bool $isShown |
||
| 3139 | */ |
||
| 3140 | final public function showMosaicButton($isShown) |
||
| 3148 | |||
| 3149 | /** |
||
| 3150 | * @param object $object |
||
| 3151 | */ |
||
| 3152 | final public function getSearchResultLink($object) |
||
| 3162 | |||
| 3163 | /** |
||
| 3164 | * Checks if a filter type is set to a default value. |
||
| 3165 | * |
||
| 3166 | * @param string $name |
||
| 3167 | * |
||
| 3168 | * @return bool |
||
| 3169 | */ |
||
| 3170 | final public function isDefaultFilter($name) |
||
| 3181 | |||
| 3182 | /** |
||
| 3183 | * Check object existence and access, without throw Exception. |
||
| 3184 | * |
||
| 3185 | * @param string $action |
||
| 3186 | * @param object $object |
||
| 3187 | * |
||
| 3188 | * @return bool |
||
| 3189 | */ |
||
| 3190 | public function canAccessObject($action, $object) |
||
| 3194 | |||
| 3195 | protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterface |
||
| 3199 | |||
| 3200 | /** |
||
| 3201 | * @return MutableTemplateRegistryInterface |
||
| 3202 | */ |
||
| 3203 | final protected function getTemplateRegistry() |
||
| 3207 | |||
| 3208 | /** |
||
| 3209 | * Returns a list of default sort values. |
||
| 3210 | * |
||
| 3211 | * @return array{_page?: int, _per_page?: int, _sort_by?: string, _sort_order?: string} |
||
| 3212 | */ |
||
| 3213 | final protected function getDefaultSortValues(): array |
||
| 3228 | |||
| 3229 | /** |
||
| 3230 | * Returns a list of default filters. |
||
| 3231 | * |
||
| 3232 | * @return array |
||
| 3233 | */ |
||
| 3234 | final protected function getDefaultFilterValues() |
||
| 3249 | |||
| 3250 | protected function configureFormFields(FormMapper $form) |
||
| 3253 | |||
| 3254 | protected function configureListFields(ListMapper $list) |
||
| 3257 | |||
| 3258 | protected function configureDatagridFilters(DatagridMapper $filter) |
||
| 3261 | |||
| 3262 | protected function configureShowFields(ShowMapper $show) |
||
| 3265 | |||
| 3266 | protected function configureRoutes(RouteCollection $collection) |
||
| 3269 | |||
| 3270 | /** |
||
| 3271 | * Allows you to customize batch actions. |
||
| 3272 | * |
||
| 3273 | * @param array $actions List of actions |
||
| 3274 | * |
||
| 3275 | * @return array |
||
| 3276 | */ |
||
| 3277 | protected function configureBatchActions($actions) |
||
| 3281 | |||
| 3282 | /** |
||
| 3283 | * NEXT_MAJOR: remove this method. |
||
| 3284 | * |
||
| 3285 | * @deprecated Use configureTabMenu instead |
||
| 3286 | */ |
||
| 3287 | protected function configureSideMenu(ItemInterface $menu, $action, ?AdminInterface $childAdmin = null) |
||
| 3290 | |||
| 3291 | /** |
||
| 3292 | * Configures the tab menu in your admin. |
||
| 3293 | * |
||
| 3294 | * @param string $action |
||
| 3295 | */ |
||
| 3296 | protected function configureTabMenu(ItemInterface $menu, $action, ?AdminInterface $childAdmin = null) |
||
| 3302 | |||
| 3303 | /** |
||
| 3304 | * build the view FieldDescription array. |
||
| 3305 | */ |
||
| 3306 | protected function buildShow() |
||
| 3323 | |||
| 3324 | /** |
||
| 3325 | * build the list FieldDescription array. |
||
| 3326 | */ |
||
| 3327 | protected function buildList() |
||
| 3384 | |||
| 3385 | /** |
||
| 3386 | * Build the form FieldDescription collection. |
||
| 3387 | */ |
||
| 3388 | protected function buildForm() |
||
| 3403 | |||
| 3404 | /** |
||
| 3405 | * Gets the subclass corresponding to the given name. |
||
| 3406 | * |
||
| 3407 | * @param string $name The name of the sub class |
||
| 3408 | * |
||
| 3409 | * @return string the subclass |
||
| 3410 | */ |
||
| 3411 | protected function getSubClass($name) |
||
| 3420 | |||
| 3421 | /** |
||
| 3422 | * Attach the inline validator to the model metadata, this must be done once per admin. |
||
| 3423 | */ |
||
| 3424 | protected function attachInlineValidator() |
||
| 3461 | |||
| 3462 | /** |
||
| 3463 | * NEXT_MAJOR: Remove this function. |
||
| 3464 | * |
||
| 3465 | * @deprecated since sonata-project/admin-bundle 3.67, to be removed in 4.0. |
||
| 3466 | * |
||
| 3467 | * Predefine per page options. |
||
| 3468 | */ |
||
| 3469 | protected function predefinePerPageOptions() |
||
| 3475 | |||
| 3476 | /** |
||
| 3477 | * Return list routes with permissions name. |
||
| 3478 | * |
||
| 3479 | * @return array<string, string> |
||
| 3480 | */ |
||
| 3481 | protected function getAccess() |
||
| 3506 | |||
| 3507 | /** |
||
| 3508 | * Configures a list of default filters. |
||
| 3509 | */ |
||
| 3510 | protected function configureDefaultFilterValues(array &$filterValues) |
||
| 3513 | |||
| 3514 | /** |
||
| 3515 | * Configures a list of default sort values. |
||
| 3516 | * |
||
| 3517 | * Example: |
||
| 3518 | * $sortValues['_sort_by'] = 'foo' |
||
| 3519 | * $sortValues['_sort_order'] = 'DESC' |
||
| 3520 | */ |
||
| 3521 | protected function configureDefaultSortValues(array &$sortValues) |
||
| 3524 | |||
| 3525 | /** |
||
| 3526 | * Set the parent object, if any, to the provided object. |
||
| 3527 | */ |
||
| 3528 | final protected function appendParentObject(object $object): void |
||
| 3556 | |||
| 3557 | /** |
||
| 3558 | * Build all the related urls to the current admin. |
||
| 3559 | */ |
||
| 3560 | private function buildRoutes(): void |
||
| 3583 | } |
||
| 3584 | |||
| 3586 |
If you suppress an error, we recommend checking for the error condition explicitly: