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 |
||
| 53 | abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface, AdminTreeInterface |
||
| 54 | { |
||
| 55 | const CONTEXT_MENU = 'menu'; |
||
| 56 | const CONTEXT_DASHBOARD = 'dashboard'; |
||
| 57 | |||
| 58 | const CLASS_REGEX = |
||
| 59 | '@ |
||
| 60 | (?:([A-Za-z0-9]*)\\\)? # vendor name / app name |
||
| 61 | (Bundle\\\)? # optional bundle directory |
||
| 62 | ([A-Za-z0-9]+?)(?:Bundle)?\\\ # bundle name, with optional suffix |
||
| 63 | ( |
||
| 64 | Entity|Document|Model|PHPCR|CouchDocument|Phpcr| |
||
| 65 | Doctrine\\\Orm|Doctrine\\\Phpcr|Doctrine\\\MongoDB|Doctrine\\\CouchDB |
||
| 66 | )\\\(.*)@x'; |
||
| 67 | |||
| 68 | const MOSAIC_ICON_CLASS = 'fa fa-th-large fa-fw'; |
||
| 69 | |||
| 70 | /** |
||
| 71 | * The list FieldDescription constructed from the configureListField method. |
||
| 72 | * |
||
| 73 | * @var array |
||
| 74 | */ |
||
| 75 | protected $listFieldDescriptions = array(); |
||
| 76 | |||
| 77 | /** |
||
| 78 | * The show FieldDescription constructed from the configureShowFields method. |
||
| 79 | * |
||
| 80 | * @var array |
||
| 81 | */ |
||
| 82 | protected $showFieldDescriptions = array(); |
||
| 83 | |||
| 84 | /** |
||
| 85 | * The list FieldDescription constructed from the configureFormField method. |
||
| 86 | * |
||
| 87 | * @var array |
||
| 88 | */ |
||
| 89 | protected $formFieldDescriptions = array(); |
||
| 90 | |||
| 91 | /** |
||
| 92 | * The filter FieldDescription constructed from the configureFilterField method. |
||
| 93 | * |
||
| 94 | * @var array |
||
| 95 | */ |
||
| 96 | protected $filterFieldDescriptions = array(); |
||
| 97 | |||
| 98 | /** |
||
| 99 | * The number of result to display in the list. |
||
| 100 | * |
||
| 101 | * @var int |
||
| 102 | */ |
||
| 103 | protected $maxPerPage = 32; |
||
| 104 | |||
| 105 | /** |
||
| 106 | * The maximum number of page numbers to display in the list. |
||
| 107 | * |
||
| 108 | * @var int |
||
| 109 | */ |
||
| 110 | protected $maxPageLinks = 25; |
||
| 111 | |||
| 112 | /** |
||
| 113 | * The base route name used to generate the routing information. |
||
| 114 | * |
||
| 115 | * @var string |
||
| 116 | */ |
||
| 117 | protected $baseRouteName; |
||
| 118 | |||
| 119 | /** |
||
| 120 | * The base route pattern used to generate the routing information. |
||
| 121 | * |
||
| 122 | * @var string |
||
| 123 | */ |
||
| 124 | protected $baseRoutePattern; |
||
| 125 | |||
| 126 | /** |
||
| 127 | * The base name controller used to generate the routing information. |
||
| 128 | * |
||
| 129 | * @var string |
||
| 130 | */ |
||
| 131 | protected $baseControllerName; |
||
| 132 | |||
| 133 | /** |
||
| 134 | * The label class name (used in the title/breadcrumb ...). |
||
| 135 | * |
||
| 136 | * @var string |
||
| 137 | */ |
||
| 138 | protected $classnameLabel; |
||
| 139 | |||
| 140 | /** |
||
| 141 | * The translation domain to be used to translate messages. |
||
| 142 | * |
||
| 143 | * @var string |
||
| 144 | */ |
||
| 145 | protected $translationDomain = 'messages'; |
||
| 146 | |||
| 147 | /** |
||
| 148 | * Options to set to the form (ie, validation_groups). |
||
| 149 | * |
||
| 150 | * @var array |
||
| 151 | */ |
||
| 152 | protected $formOptions = array(); |
||
| 153 | |||
| 154 | /** |
||
| 155 | * Default values to the datagrid. |
||
| 156 | * |
||
| 157 | * @var array |
||
| 158 | */ |
||
| 159 | protected $datagridValues = array( |
||
| 160 | '_page' => 1, |
||
| 161 | '_per_page' => 32, |
||
| 162 | ); |
||
| 163 | |||
| 164 | /** |
||
| 165 | * Predefined per page options. |
||
| 166 | * |
||
| 167 | * @var array |
||
| 168 | */ |
||
| 169 | protected $perPageOptions = array(16, 32, 64, 128, 192); |
||
| 170 | |||
| 171 | /** |
||
| 172 | * Pager type. |
||
| 173 | * |
||
| 174 | * @var string |
||
| 175 | */ |
||
| 176 | protected $pagerType = Pager::TYPE_DEFAULT; |
||
| 177 | |||
| 178 | /** |
||
| 179 | * The code related to the admin. |
||
| 180 | * |
||
| 181 | * @var string |
||
| 182 | */ |
||
| 183 | protected $code; |
||
| 184 | |||
| 185 | /** |
||
| 186 | * The label. |
||
| 187 | * |
||
| 188 | * @var string |
||
| 189 | */ |
||
| 190 | protected $label; |
||
| 191 | |||
| 192 | /** |
||
| 193 | * Whether or not to persist the filters in the session. |
||
| 194 | * |
||
| 195 | * @var bool |
||
| 196 | */ |
||
| 197 | protected $persistFilters = false; |
||
| 198 | |||
| 199 | /** |
||
| 200 | * Array of routes related to this admin. |
||
| 201 | * |
||
| 202 | * @var RouteCollection |
||
| 203 | */ |
||
| 204 | protected $routes; |
||
| 205 | |||
| 206 | /** |
||
| 207 | * The subject only set in edit/update/create mode. |
||
| 208 | * |
||
| 209 | * @var object |
||
| 210 | */ |
||
| 211 | protected $subject; |
||
| 212 | |||
| 213 | /** |
||
| 214 | * Define a Collection of child admin, ie /admin/order/{id}/order-element/{childId}. |
||
| 215 | * |
||
| 216 | * @var array |
||
| 217 | */ |
||
| 218 | protected $children = array(); |
||
| 219 | |||
| 220 | /** |
||
| 221 | * Reference the parent collection. |
||
| 222 | * |
||
| 223 | * @var AdminInterface|null |
||
| 224 | */ |
||
| 225 | protected $parent = null; |
||
| 226 | |||
| 227 | /** |
||
| 228 | * The base code route refer to the prefix used to generate the route name. |
||
| 229 | * |
||
| 230 | * NEXT_MAJOR: remove this attribute. |
||
| 231 | * |
||
| 232 | * @deprecated This attribute is deprecated since 3.x and will be removed in 4.0 |
||
| 233 | * |
||
| 234 | * @var string |
||
| 235 | */ |
||
| 236 | protected $baseCodeRoute = ''; |
||
| 237 | |||
| 238 | /** |
||
| 239 | * The related parent association, ie if OrderElement has a parent property named order, |
||
| 240 | * then the $parentAssociationMapping must be a string named `order`. |
||
| 241 | * |
||
| 242 | * @var string |
||
| 243 | */ |
||
| 244 | protected $parentAssociationMapping = null; |
||
| 245 | |||
| 246 | /** |
||
| 247 | * Reference the parent FieldDescription related to this admin |
||
| 248 | * only set for FieldDescription which is associated to an Sub Admin instance. |
||
| 249 | * |
||
| 250 | * @var FieldDescriptionInterface |
||
| 251 | */ |
||
| 252 | protected $parentFieldDescription; |
||
| 253 | |||
| 254 | /** |
||
| 255 | * If true then the current admin is part of the nested admin set (from the url). |
||
| 256 | * |
||
| 257 | * @var bool |
||
| 258 | */ |
||
| 259 | protected $currentChild = false; |
||
| 260 | |||
| 261 | /** |
||
| 262 | * The uniqid is used to avoid clashing with 2 admin related to the code |
||
| 263 | * ie: a Block linked to a Block. |
||
| 264 | * |
||
| 265 | * @var string |
||
| 266 | */ |
||
| 267 | protected $uniqid; |
||
| 268 | |||
| 269 | /** |
||
| 270 | * The Entity or Document manager. |
||
| 271 | * |
||
| 272 | * @var ModelManagerInterface |
||
| 273 | */ |
||
| 274 | protected $modelManager; |
||
| 275 | |||
| 276 | /** |
||
| 277 | * The current request object. |
||
| 278 | * |
||
| 279 | * @var \Symfony\Component\HttpFoundation\Request |
||
| 280 | */ |
||
| 281 | protected $request; |
||
| 282 | |||
| 283 | /** |
||
| 284 | * The translator component. |
||
| 285 | * |
||
| 286 | * NEXT_MAJOR: remove this property |
||
| 287 | * |
||
| 288 | * @var \Symfony\Component\Translation\TranslatorInterface |
||
| 289 | * |
||
| 290 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 291 | */ |
||
| 292 | protected $translator; |
||
| 293 | |||
| 294 | /** |
||
| 295 | * The related form contractor. |
||
| 296 | * |
||
| 297 | * @var FormContractorInterface |
||
| 298 | */ |
||
| 299 | protected $formContractor; |
||
| 300 | |||
| 301 | /** |
||
| 302 | * The related list builder. |
||
| 303 | * |
||
| 304 | * @var ListBuilderInterface |
||
| 305 | */ |
||
| 306 | protected $listBuilder; |
||
| 307 | |||
| 308 | /** |
||
| 309 | * The related view builder. |
||
| 310 | * |
||
| 311 | * @var ShowBuilderInterface |
||
| 312 | */ |
||
| 313 | protected $showBuilder; |
||
| 314 | |||
| 315 | /** |
||
| 316 | * The related datagrid builder. |
||
| 317 | * |
||
| 318 | * @var DatagridBuilderInterface |
||
| 319 | */ |
||
| 320 | protected $datagridBuilder; |
||
| 321 | |||
| 322 | /** |
||
| 323 | * @var RouteBuilderInterface |
||
| 324 | */ |
||
| 325 | protected $routeBuilder; |
||
| 326 | |||
| 327 | /** |
||
| 328 | * The datagrid instance. |
||
| 329 | * |
||
| 330 | * @var \Sonata\AdminBundle\Datagrid\DatagridInterface |
||
| 331 | */ |
||
| 332 | protected $datagrid; |
||
| 333 | |||
| 334 | /** |
||
| 335 | * The router instance. |
||
| 336 | * |
||
| 337 | * @var RouteGeneratorInterface |
||
| 338 | */ |
||
| 339 | protected $routeGenerator; |
||
| 340 | |||
| 341 | /** |
||
| 342 | * The generated breadcrumbs. |
||
| 343 | * |
||
| 344 | * NEXT_MAJOR : remove this property |
||
| 345 | * |
||
| 346 | * @var array |
||
| 347 | */ |
||
| 348 | protected $breadcrumbs = array(); |
||
| 349 | |||
| 350 | /** |
||
| 351 | * @var SecurityHandlerInterface |
||
| 352 | */ |
||
| 353 | protected $securityHandler = null; |
||
| 354 | |||
| 355 | /** |
||
| 356 | * @var ValidatorInterface|LegacyValidatorInterface |
||
| 357 | */ |
||
| 358 | protected $validator = null; |
||
| 359 | |||
| 360 | /** |
||
| 361 | * The configuration pool. |
||
| 362 | * |
||
| 363 | * @var Pool |
||
| 364 | */ |
||
| 365 | protected $configurationPool; |
||
| 366 | |||
| 367 | /** |
||
| 368 | * @var MenuItemInterface |
||
| 369 | */ |
||
| 370 | protected $menu; |
||
| 371 | |||
| 372 | /** |
||
| 373 | * @var MenuFactoryInterface |
||
| 374 | */ |
||
| 375 | protected $menuFactory; |
||
| 376 | |||
| 377 | /** |
||
| 378 | * @var array |
||
| 379 | */ |
||
| 380 | protected $loaded = array( |
||
| 381 | 'view_fields' => false, |
||
| 382 | 'view_groups' => false, |
||
| 383 | 'routes' => false, |
||
| 384 | 'tab_menu' => false, |
||
| 385 | ); |
||
| 386 | |||
| 387 | /** |
||
| 388 | * @var array |
||
| 389 | */ |
||
| 390 | protected $formTheme = array(); |
||
| 391 | |||
| 392 | /** |
||
| 393 | * @var array |
||
| 394 | */ |
||
| 395 | protected $filterTheme = array(); |
||
| 396 | |||
| 397 | /** |
||
| 398 | * @var array |
||
| 399 | */ |
||
| 400 | protected $templates = array(); |
||
| 401 | |||
| 402 | /** |
||
| 403 | * @var AdminExtensionInterface[] |
||
| 404 | */ |
||
| 405 | protected $extensions = array(); |
||
| 406 | |||
| 407 | /** |
||
| 408 | * @var LabelTranslatorStrategyInterface |
||
| 409 | */ |
||
| 410 | protected $labelTranslatorStrategy; |
||
| 411 | |||
| 412 | /** |
||
| 413 | * Setting to true will enable preview mode for |
||
| 414 | * the entity and show a preview button in the |
||
| 415 | * edit/create forms. |
||
| 416 | * |
||
| 417 | * @var bool |
||
| 418 | */ |
||
| 419 | protected $supportsPreviewMode = false; |
||
| 420 | |||
| 421 | /** |
||
| 422 | * Roles and permissions per role. |
||
| 423 | * |
||
| 424 | * @var array [role] => array([permission], [permission]) |
||
| 425 | */ |
||
| 426 | protected $securityInformation = array(); |
||
| 427 | |||
| 428 | protected $cacheIsGranted = array(); |
||
| 429 | |||
| 430 | /** |
||
| 431 | * Action list for the search result. |
||
| 432 | * |
||
| 433 | * @var string[] |
||
| 434 | */ |
||
| 435 | protected $searchResultActions = array('edit', 'show'); |
||
| 436 | |||
| 437 | protected $listModes = array( |
||
| 438 | 'list' => array( |
||
| 439 | 'class' => 'fa fa-list fa-fw', |
||
| 440 | ), |
||
| 441 | 'mosaic' => array( |
||
| 442 | 'class' => self::MOSAIC_ICON_CLASS, |
||
| 443 | ), |
||
| 444 | ); |
||
| 445 | |||
| 446 | /** |
||
| 447 | * The Access mapping. |
||
| 448 | * |
||
| 449 | * @var array [action1 => requiredRole1, action2 => [requiredRole2, requiredRole3]] |
||
| 450 | */ |
||
| 451 | protected $accessMapping = array(); |
||
| 452 | |||
| 453 | /** |
||
| 454 | * The class name managed by the admin class. |
||
| 455 | * |
||
| 456 | * @var string |
||
| 457 | */ |
||
| 458 | private $class; |
||
| 459 | |||
| 460 | /** |
||
| 461 | * The subclasses supported by the admin class. |
||
| 462 | * |
||
| 463 | * @var array |
||
| 464 | */ |
||
| 465 | private $subClasses = array(); |
||
| 466 | |||
| 467 | /** |
||
| 468 | * The list collection. |
||
| 469 | * |
||
| 470 | * @var array |
||
| 471 | */ |
||
| 472 | private $list; |
||
| 473 | |||
| 474 | /** |
||
| 475 | * @var FieldDescriptionCollection |
||
| 476 | */ |
||
| 477 | private $show; |
||
| 478 | |||
| 479 | /** |
||
| 480 | * @var Form |
||
| 481 | */ |
||
| 482 | private $form; |
||
| 483 | |||
| 484 | /** |
||
| 485 | * @var DatagridInterface |
||
| 486 | */ |
||
| 487 | private $filter; |
||
|
|
|||
| 488 | |||
| 489 | /** |
||
| 490 | * The cached base route name. |
||
| 491 | * |
||
| 492 | * @var string |
||
| 493 | */ |
||
| 494 | private $cachedBaseRouteName; |
||
| 495 | |||
| 496 | /** |
||
| 497 | * The cached base route pattern. |
||
| 498 | * |
||
| 499 | * @var string |
||
| 500 | */ |
||
| 501 | private $cachedBaseRoutePattern; |
||
| 502 | |||
| 503 | /** |
||
| 504 | * The form group disposition. |
||
| 505 | * |
||
| 506 | * @var array|bool |
||
| 507 | */ |
||
| 508 | private $formGroups = false; |
||
| 509 | |||
| 510 | /** |
||
| 511 | * The form tabs disposition. |
||
| 512 | * |
||
| 513 | * @var array|bool |
||
| 514 | */ |
||
| 515 | private $formTabs = false; |
||
| 516 | |||
| 517 | /** |
||
| 518 | * The view group disposition. |
||
| 519 | * |
||
| 520 | * @var array|bool |
||
| 521 | */ |
||
| 522 | private $showGroups = false; |
||
| 523 | |||
| 524 | /** |
||
| 525 | * The view tab disposition. |
||
| 526 | * |
||
| 527 | * @var array|bool |
||
| 528 | */ |
||
| 529 | private $showTabs = false; |
||
| 530 | |||
| 531 | /** |
||
| 532 | * The manager type to use for the admin. |
||
| 533 | * |
||
| 534 | * @var string |
||
| 535 | */ |
||
| 536 | private $managerType; |
||
| 537 | |||
| 538 | /** |
||
| 539 | * The breadcrumbsBuilder component. |
||
| 540 | * |
||
| 541 | * @var BreadcrumbsBuilderInterface |
||
| 542 | */ |
||
| 543 | private $breadcrumbsBuilder; |
||
| 544 | |||
| 545 | /** |
||
| 546 | * @param string $code |
||
| 547 | * @param string $class |
||
| 548 | * @param string $baseControllerName |
||
| 549 | */ |
||
| 550 | public function __construct($code, $class, $baseControllerName) |
||
| 559 | |||
| 560 | /** |
||
| 561 | * {@inheritdoc} |
||
| 562 | * |
||
| 563 | * NEXT_MAJOR: return null to indicate no override |
||
| 564 | */ |
||
| 565 | public function getExportFormats() |
||
| 571 | |||
| 572 | /** |
||
| 573 | * @return array |
||
| 574 | */ |
||
| 575 | public function getExportFields() |
||
| 587 | |||
| 588 | /** |
||
| 589 | * {@inheritdoc} |
||
| 590 | */ |
||
| 591 | public function getDataSourceIterator() |
||
| 613 | |||
| 614 | /** |
||
| 615 | * {@inheritdoc} |
||
| 616 | */ |
||
| 617 | public function validate(ErrorElement $errorElement, $object) |
||
| 620 | |||
| 621 | /** |
||
| 622 | * define custom variable. |
||
| 623 | */ |
||
| 624 | public function initialize() |
||
| 635 | |||
| 636 | /** |
||
| 637 | * {@inheritdoc} |
||
| 638 | */ |
||
| 639 | public function configure() |
||
| 642 | |||
| 643 | /** |
||
| 644 | * {@inheritdoc} |
||
| 645 | */ |
||
| 646 | public function update($object) |
||
| 666 | |||
| 667 | /** |
||
| 668 | * {@inheritdoc} |
||
| 669 | */ |
||
| 670 | public function create($object) |
||
| 692 | |||
| 693 | /** |
||
| 694 | * {@inheritdoc} |
||
| 695 | */ |
||
| 696 | public function delete($object) |
||
| 711 | |||
| 712 | /** |
||
| 713 | * {@inheritdoc} |
||
| 714 | */ |
||
| 715 | public function preValidate($object) |
||
| 718 | |||
| 719 | /** |
||
| 720 | * {@inheritdoc} |
||
| 721 | */ |
||
| 722 | public function preUpdate($object) |
||
| 725 | |||
| 726 | /** |
||
| 727 | * {@inheritdoc} |
||
| 728 | */ |
||
| 729 | public function postUpdate($object) |
||
| 732 | |||
| 733 | /** |
||
| 734 | * {@inheritdoc} |
||
| 735 | */ |
||
| 736 | public function prePersist($object) |
||
| 739 | |||
| 740 | /** |
||
| 741 | * {@inheritdoc} |
||
| 742 | */ |
||
| 743 | public function postPersist($object) |
||
| 746 | |||
| 747 | /** |
||
| 748 | * {@inheritdoc} |
||
| 749 | */ |
||
| 750 | public function preRemove($object) |
||
| 753 | |||
| 754 | /** |
||
| 755 | * {@inheritdoc} |
||
| 756 | */ |
||
| 757 | public function postRemove($object) |
||
| 760 | |||
| 761 | /** |
||
| 762 | * {@inheritdoc} |
||
| 763 | */ |
||
| 764 | public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements) |
||
| 767 | |||
| 768 | /** |
||
| 769 | * {@inheritdoc} |
||
| 770 | */ |
||
| 771 | public function getFilterParameters() |
||
| 808 | |||
| 809 | /** |
||
| 810 | * {@inheritdoc} |
||
| 811 | */ |
||
| 812 | public function buildDatagrid() |
||
| 874 | |||
| 875 | /** |
||
| 876 | * Returns the name of the parent related field, so the field can be use to set the default |
||
| 877 | * value (ie the parent object) or to filter the object. |
||
| 878 | * |
||
| 879 | * @return string the name of the parent related field |
||
| 880 | */ |
||
| 881 | public function getParentAssociationMapping() |
||
| 885 | |||
| 886 | /** |
||
| 887 | * Returns the baseRoutePattern used to generate the routing information. |
||
| 888 | * |
||
| 889 | * @throws \RuntimeException |
||
| 890 | * |
||
| 891 | * @return string the baseRoutePattern used to generate the routing information |
||
| 892 | */ |
||
| 893 | public function getBaseRoutePattern() |
||
| 931 | |||
| 932 | /** |
||
| 933 | * Returns the baseRouteName used to generate the routing information. |
||
| 934 | * |
||
| 935 | * @throws \RuntimeException |
||
| 936 | * |
||
| 937 | * @return string the baseRouteName used to generate the routing information |
||
| 938 | */ |
||
| 939 | public function getBaseRouteName() |
||
| 976 | |||
| 977 | /** |
||
| 978 | * urlize the given word. |
||
| 979 | * |
||
| 980 | * @param string $word |
||
| 981 | * @param string $sep the separator |
||
| 982 | * |
||
| 983 | * @return string |
||
| 984 | */ |
||
| 985 | public function urlize($word, $sep = '_') |
||
| 989 | |||
| 990 | /** |
||
| 991 | * {@inheritdoc} |
||
| 992 | */ |
||
| 993 | public function getClass() |
||
| 1020 | |||
| 1021 | /** |
||
| 1022 | * {@inheritdoc} |
||
| 1023 | */ |
||
| 1024 | public function getSubClasses() |
||
| 1028 | |||
| 1029 | /** |
||
| 1030 | * {@inheritdoc} |
||
| 1031 | */ |
||
| 1032 | public function addSubClass($subClass) |
||
| 1038 | |||
| 1039 | /** |
||
| 1040 | * {@inheritdoc} |
||
| 1041 | */ |
||
| 1042 | public function setSubClasses(array $subClasses) |
||
| 1046 | |||
| 1047 | /** |
||
| 1048 | * {@inheritdoc} |
||
| 1049 | */ |
||
| 1050 | public function hasSubClass($name) |
||
| 1054 | |||
| 1055 | /** |
||
| 1056 | * {@inheritdoc} |
||
| 1057 | */ |
||
| 1058 | public function hasActiveSubClass() |
||
| 1066 | |||
| 1067 | /** |
||
| 1068 | * {@inheritdoc} |
||
| 1069 | */ |
||
| 1070 | public function getActiveSubClass() |
||
| 1078 | |||
| 1079 | /** |
||
| 1080 | * {@inheritdoc} |
||
| 1081 | */ |
||
| 1082 | public function getActiveSubclassCode() |
||
| 1096 | |||
| 1097 | /** |
||
| 1098 | * {@inheritdoc} |
||
| 1099 | */ |
||
| 1100 | public function getBatchActions() |
||
| 1133 | |||
| 1134 | /** |
||
| 1135 | * {@inheritdoc} |
||
| 1136 | */ |
||
| 1137 | public function getRoutes() |
||
| 1143 | |||
| 1144 | /** |
||
| 1145 | * {@inheritdoc} |
||
| 1146 | */ |
||
| 1147 | public function getRouterIdParameter() |
||
| 1151 | |||
| 1152 | /** |
||
| 1153 | * {@inheritdoc} |
||
| 1154 | */ |
||
| 1155 | public function getIdParameter() |
||
| 1165 | |||
| 1166 | /** |
||
| 1167 | * {@inheritdoc} |
||
| 1168 | */ |
||
| 1169 | public function hasRoute($name) |
||
| 1177 | |||
| 1178 | /** |
||
| 1179 | * {@inheritdoc} |
||
| 1180 | */ |
||
| 1181 | public function isCurrentRoute($name, $adminCode = null) |
||
| 1202 | |||
| 1203 | /** |
||
| 1204 | * {@inheritdoc} |
||
| 1205 | */ |
||
| 1206 | public function generateObjectUrl($name, $object, array $parameters = array(), $absolute = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1212 | |||
| 1213 | /** |
||
| 1214 | * {@inheritdoc} |
||
| 1215 | */ |
||
| 1216 | public function generateUrl($name, array $parameters = array(), $absolute = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1220 | |||
| 1221 | /** |
||
| 1222 | * {@inheritdoc} |
||
| 1223 | */ |
||
| 1224 | public function generateMenuUrl($name, array $parameters = array(), $absolute = RoutingUrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1228 | |||
| 1229 | /** |
||
| 1230 | * @param array $templates |
||
| 1231 | */ |
||
| 1232 | public function setTemplates(array $templates) |
||
| 1236 | |||
| 1237 | /** |
||
| 1238 | * @param string $name |
||
| 1239 | * @param string $template |
||
| 1240 | */ |
||
| 1241 | public function setTemplate($name, $template) |
||
| 1245 | |||
| 1246 | /** |
||
| 1247 | * @return array |
||
| 1248 | */ |
||
| 1249 | public function getTemplates() |
||
| 1253 | |||
| 1254 | /** |
||
| 1255 | * {@inheritdoc} |
||
| 1256 | */ |
||
| 1257 | public function getTemplate($name) |
||
| 1263 | |||
| 1264 | /** |
||
| 1265 | * {@inheritdoc} |
||
| 1266 | */ |
||
| 1267 | public function getNewInstance() |
||
| 1276 | |||
| 1277 | /** |
||
| 1278 | * {@inheritdoc} |
||
| 1279 | */ |
||
| 1280 | public function getFormBuilder() |
||
| 1293 | |||
| 1294 | /** |
||
| 1295 | * This method is being called by the main admin class and the child class, |
||
| 1296 | * the getFormBuilder is only call by the main admin class. |
||
| 1297 | * |
||
| 1298 | * @param FormBuilderInterface $formBuilder |
||
| 1299 | */ |
||
| 1300 | public function defineFormBuilder(FormBuilderInterface $formBuilder) |
||
| 1312 | |||
| 1313 | /** |
||
| 1314 | * {@inheritdoc} |
||
| 1315 | */ |
||
| 1316 | public function attachAdminClass(FieldDescriptionInterface $fieldDescription) |
||
| 1338 | |||
| 1339 | /** |
||
| 1340 | * {@inheritdoc} |
||
| 1341 | */ |
||
| 1342 | public function getObject($id) |
||
| 1351 | |||
| 1352 | /** |
||
| 1353 | * {@inheritdoc} |
||
| 1354 | */ |
||
| 1355 | public function getForm() |
||
| 1361 | |||
| 1362 | /** |
||
| 1363 | * {@inheritdoc} |
||
| 1364 | */ |
||
| 1365 | public function getList() |
||
| 1371 | |||
| 1372 | /** |
||
| 1373 | * {@inheritdoc} |
||
| 1374 | */ |
||
| 1375 | public function createQuery($context = 'list') |
||
| 1391 | |||
| 1392 | /** |
||
| 1393 | * {@inheritdoc} |
||
| 1394 | */ |
||
| 1395 | public function getDatagrid() |
||
| 1401 | |||
| 1402 | /** |
||
| 1403 | * {@inheritdoc} |
||
| 1404 | */ |
||
| 1405 | public function buildTabMenu($action, AdminInterface $childAdmin = null) |
||
| 1430 | |||
| 1431 | /** |
||
| 1432 | * {@inheritdoc} |
||
| 1433 | */ |
||
| 1434 | public function buildSideMenu($action, AdminInterface $childAdmin = null) |
||
| 1438 | |||
| 1439 | /** |
||
| 1440 | * @param string $action |
||
| 1441 | * @param AdminInterface $childAdmin |
||
| 1442 | * |
||
| 1443 | * @return ItemInterface |
||
| 1444 | */ |
||
| 1445 | public function getSideMenu($action, AdminInterface $childAdmin = null) |
||
| 1455 | |||
| 1456 | /** |
||
| 1457 | * Returns the root code. |
||
| 1458 | * |
||
| 1459 | * @return string the root code |
||
| 1460 | */ |
||
| 1461 | public function getRootCode() |
||
| 1465 | |||
| 1466 | /** |
||
| 1467 | * Returns the master admin. |
||
| 1468 | * |
||
| 1469 | * @return AbstractAdmin the root admin class |
||
| 1470 | */ |
||
| 1471 | public function getRoot() |
||
| 1481 | |||
| 1482 | /** |
||
| 1483 | * {@inheritdoc} |
||
| 1484 | */ |
||
| 1485 | public function setBaseControllerName($baseControllerName) |
||
| 1489 | |||
| 1490 | /** |
||
| 1491 | * {@inheritdoc} |
||
| 1492 | */ |
||
| 1493 | public function getBaseControllerName() |
||
| 1497 | |||
| 1498 | /** |
||
| 1499 | * @param string $label |
||
| 1500 | */ |
||
| 1501 | public function setLabel($label) |
||
| 1505 | |||
| 1506 | /** |
||
| 1507 | * {@inheritdoc} |
||
| 1508 | */ |
||
| 1509 | public function getLabel() |
||
| 1513 | |||
| 1514 | /** |
||
| 1515 | * @param bool $persist |
||
| 1516 | */ |
||
| 1517 | public function setPersistFilters($persist) |
||
| 1521 | |||
| 1522 | /** |
||
| 1523 | * @param int $maxPerPage |
||
| 1524 | */ |
||
| 1525 | public function setMaxPerPage($maxPerPage) |
||
| 1529 | |||
| 1530 | /** |
||
| 1531 | * @return int |
||
| 1532 | */ |
||
| 1533 | public function getMaxPerPage() |
||
| 1537 | |||
| 1538 | /** |
||
| 1539 | * @param int $maxPageLinks |
||
| 1540 | */ |
||
| 1541 | public function setMaxPageLinks($maxPageLinks) |
||
| 1545 | |||
| 1546 | /** |
||
| 1547 | * @return int |
||
| 1548 | */ |
||
| 1549 | public function getMaxPageLinks() |
||
| 1553 | |||
| 1554 | /** |
||
| 1555 | * {@inheritdoc} |
||
| 1556 | */ |
||
| 1557 | public function getFormGroups() |
||
| 1561 | |||
| 1562 | /** |
||
| 1563 | * {@inheritdoc} |
||
| 1564 | */ |
||
| 1565 | public function setFormGroups(array $formGroups) |
||
| 1569 | |||
| 1570 | /** |
||
| 1571 | * {@inheritdoc} |
||
| 1572 | */ |
||
| 1573 | public function removeFieldFromFormGroup($key) |
||
| 1583 | |||
| 1584 | /** |
||
| 1585 | * @param array $group |
||
| 1586 | * @param array $keys |
||
| 1587 | */ |
||
| 1588 | public function reorderFormGroup($group, array $keys) |
||
| 1594 | |||
| 1595 | /** |
||
| 1596 | * {@inheritdoc} |
||
| 1597 | */ |
||
| 1598 | public function getFormTabs() |
||
| 1602 | |||
| 1603 | /** |
||
| 1604 | * {@inheritdoc} |
||
| 1605 | */ |
||
| 1606 | public function setFormTabs(array $formTabs) |
||
| 1610 | |||
| 1611 | /** |
||
| 1612 | * {@inheritdoc} |
||
| 1613 | */ |
||
| 1614 | public function getShowTabs() |
||
| 1618 | |||
| 1619 | /** |
||
| 1620 | * {@inheritdoc} |
||
| 1621 | */ |
||
| 1622 | public function setShowTabs(array $showTabs) |
||
| 1626 | |||
| 1627 | /** |
||
| 1628 | * {@inheritdoc} |
||
| 1629 | */ |
||
| 1630 | public function getShowGroups() |
||
| 1634 | |||
| 1635 | /** |
||
| 1636 | * {@inheritdoc} |
||
| 1637 | */ |
||
| 1638 | public function setShowGroups(array $showGroups) |
||
| 1642 | |||
| 1643 | /** |
||
| 1644 | * {@inheritdoc} |
||
| 1645 | */ |
||
| 1646 | public function reorderShowGroup($group, array $keys) |
||
| 1652 | |||
| 1653 | /** |
||
| 1654 | * {@inheritdoc} |
||
| 1655 | */ |
||
| 1656 | public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription) |
||
| 1660 | |||
| 1661 | /** |
||
| 1662 | * {@inheritdoc} |
||
| 1663 | */ |
||
| 1664 | public function getParentFieldDescription() |
||
| 1668 | |||
| 1669 | /** |
||
| 1670 | * {@inheritdoc} |
||
| 1671 | */ |
||
| 1672 | public function hasParentFieldDescription() |
||
| 1676 | |||
| 1677 | /** |
||
| 1678 | * {@inheritdoc} |
||
| 1679 | */ |
||
| 1680 | public function setSubject($subject) |
||
| 1697 | |||
| 1698 | /** |
||
| 1699 | * {@inheritdoc} |
||
| 1700 | */ |
||
| 1701 | public function getSubject() |
||
| 1702 | { |
||
| 1703 | if ($this->subject === null && $this->request && !$this->hasParentFieldDescription()) { |
||
| 1704 | $id = $this->request->get($this->getIdParameter()); |
||
| 1705 | $this->subject = $this->getModelManager()->find($this->class, $id); |
||
| 1706 | } |
||
| 1707 | |||
| 1708 | return $this->subject; |
||
| 1709 | } |
||
| 1710 | |||
| 1711 | /** |
||
| 1712 | * {@inheritdoc} |
||
| 1713 | */ |
||
| 1714 | public function hasSubject() |
||
| 1718 | |||
| 1719 | /** |
||
| 1720 | * {@inheritdoc} |
||
| 1721 | */ |
||
| 1722 | public function getFormFieldDescriptions() |
||
| 1728 | |||
| 1729 | /** |
||
| 1730 | * {@inheritdoc} |
||
| 1731 | */ |
||
| 1732 | public function getFormFieldDescription($name) |
||
| 1736 | |||
| 1737 | /** |
||
| 1738 | * Returns true if the admin has a FieldDescription with the given $name. |
||
| 1739 | * |
||
| 1740 | * @param string $name |
||
| 1741 | * |
||
| 1742 | * @return bool |
||
| 1743 | */ |
||
| 1744 | public function hasFormFieldDescription($name) |
||
| 1748 | |||
| 1749 | /** |
||
| 1750 | * {@inheritdoc} |
||
| 1751 | */ |
||
| 1752 | public function addFormFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1756 | |||
| 1757 | /** |
||
| 1758 | * remove a FieldDescription. |
||
| 1759 | * |
||
| 1760 | * @param string $name |
||
| 1761 | */ |
||
| 1762 | public function removeFormFieldDescription($name) |
||
| 1766 | |||
| 1767 | /** |
||
| 1768 | * build and return the collection of form FieldDescription. |
||
| 1769 | * |
||
| 1770 | * @return array collection of form FieldDescription |
||
| 1771 | */ |
||
| 1772 | public function getShowFieldDescriptions() |
||
| 1778 | |||
| 1779 | /** |
||
| 1780 | * Returns the form FieldDescription with the given $name. |
||
| 1781 | * |
||
| 1782 | * @param string $name |
||
| 1783 | * |
||
| 1784 | * @return FieldDescriptionInterface |
||
| 1785 | */ |
||
| 1786 | public function getShowFieldDescription($name) |
||
| 1792 | |||
| 1793 | /** |
||
| 1794 | * {@inheritdoc} |
||
| 1795 | */ |
||
| 1796 | public function hasShowFieldDescription($name) |
||
| 1800 | |||
| 1801 | /** |
||
| 1802 | * {@inheritdoc} |
||
| 1803 | */ |
||
| 1804 | public function addShowFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1808 | |||
| 1809 | /** |
||
| 1810 | * {@inheritdoc} |
||
| 1811 | */ |
||
| 1812 | public function removeShowFieldDescription($name) |
||
| 1816 | |||
| 1817 | /** |
||
| 1818 | * {@inheritdoc} |
||
| 1819 | */ |
||
| 1820 | public function getListFieldDescriptions() |
||
| 1826 | |||
| 1827 | /** |
||
| 1828 | * {@inheritdoc} |
||
| 1829 | */ |
||
| 1830 | public function getListFieldDescription($name) |
||
| 1834 | |||
| 1835 | /** |
||
| 1836 | * {@inheritdoc} |
||
| 1837 | */ |
||
| 1838 | public function hasListFieldDescription($name) |
||
| 1844 | |||
| 1845 | /** |
||
| 1846 | * {@inheritdoc} |
||
| 1847 | */ |
||
| 1848 | public function addListFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1852 | |||
| 1853 | /** |
||
| 1854 | * {@inheritdoc} |
||
| 1855 | */ |
||
| 1856 | public function removeListFieldDescription($name) |
||
| 1860 | |||
| 1861 | /** |
||
| 1862 | * {@inheritdoc} |
||
| 1863 | */ |
||
| 1864 | public function getFilterFieldDescription($name) |
||
| 1868 | |||
| 1869 | /** |
||
| 1870 | * {@inheritdoc} |
||
| 1871 | */ |
||
| 1872 | public function hasFilterFieldDescription($name) |
||
| 1876 | |||
| 1877 | /** |
||
| 1878 | * {@inheritdoc} |
||
| 1879 | */ |
||
| 1880 | public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1884 | |||
| 1885 | /** |
||
| 1886 | * {@inheritdoc} |
||
| 1887 | */ |
||
| 1888 | public function removeFilterFieldDescription($name) |
||
| 1892 | |||
| 1893 | /** |
||
| 1894 | * {@inheritdoc} |
||
| 1895 | */ |
||
| 1896 | public function getFilterFieldDescriptions() |
||
| 1902 | |||
| 1903 | /** |
||
| 1904 | * {@inheritdoc} |
||
| 1905 | */ |
||
| 1906 | public function addChild(AdminInterface $child) |
||
| 1923 | |||
| 1924 | /** |
||
| 1925 | * {@inheritdoc} |
||
| 1926 | */ |
||
| 1927 | public function hasChild($code) |
||
| 1931 | |||
| 1932 | /** |
||
| 1933 | * {@inheritdoc} |
||
| 1934 | */ |
||
| 1935 | public function getChildren() |
||
| 1939 | |||
| 1940 | /** |
||
| 1941 | * {@inheritdoc} |
||
| 1942 | */ |
||
| 1943 | public function getChild($code) |
||
| 1947 | |||
| 1948 | /** |
||
| 1949 | * {@inheritdoc} |
||
| 1950 | */ |
||
| 1951 | public function setParent(AdminInterface $parent) |
||
| 1955 | |||
| 1956 | /** |
||
| 1957 | * {@inheritdoc} |
||
| 1958 | */ |
||
| 1959 | public function getParent() |
||
| 1963 | |||
| 1964 | /** |
||
| 1965 | * {@inheritdoc} |
||
| 1966 | */ |
||
| 1967 | final public function getRootAncestor() |
||
| 1977 | |||
| 1978 | /** |
||
| 1979 | * {@inheritdoc} |
||
| 1980 | */ |
||
| 1981 | final public function getChildDepth() |
||
| 1993 | |||
| 1994 | /** |
||
| 1995 | * {@inheritdoc} |
||
| 1996 | */ |
||
| 1997 | final public function getCurrentLeafChildAdmin() |
||
| 2011 | |||
| 2012 | /** |
||
| 2013 | * {@inheritdoc} |
||
| 2014 | */ |
||
| 2015 | public function isChild() |
||
| 2019 | |||
| 2020 | /** |
||
| 2021 | * Returns true if the admin has children, false otherwise. |
||
| 2022 | * |
||
| 2023 | * @return bool if the admin has children |
||
| 2024 | */ |
||
| 2025 | public function hasChildren() |
||
| 2029 | |||
| 2030 | /** |
||
| 2031 | * {@inheritdoc} |
||
| 2032 | */ |
||
| 2033 | public function setUniqid($uniqid) |
||
| 2037 | |||
| 2038 | /** |
||
| 2039 | * {@inheritdoc} |
||
| 2040 | */ |
||
| 2041 | public function getUniqid() |
||
| 2049 | |||
| 2050 | /** |
||
| 2051 | * Returns the classname label. |
||
| 2052 | * |
||
| 2053 | * @return string the classname label |
||
| 2054 | */ |
||
| 2055 | public function getClassnameLabel() |
||
| 2059 | |||
| 2060 | /** |
||
| 2061 | * {@inheritdoc} |
||
| 2062 | */ |
||
| 2063 | public function getPersistentParameters() |
||
| 2079 | |||
| 2080 | /** |
||
| 2081 | * @param string $name |
||
| 2082 | * |
||
| 2083 | * @return null|mixed |
||
| 2084 | */ |
||
| 2085 | public function getPersistentParameter($name) |
||
| 2091 | |||
| 2092 | /** |
||
| 2093 | * {@inheritdoc} |
||
| 2094 | */ |
||
| 2095 | public function getBreadcrumbs($action) |
||
| 2105 | |||
| 2106 | /** |
||
| 2107 | * Generates the breadcrumbs array. |
||
| 2108 | * |
||
| 2109 | * Note: the method will be called by the top admin instance (parent => child) |
||
| 2110 | * |
||
| 2111 | * @param string $action |
||
| 2112 | * @param ItemInterface|null $menu |
||
| 2113 | * |
||
| 2114 | * @return array |
||
| 2115 | */ |
||
| 2116 | public function buildBreadcrumbs($action, MenuItemInterface $menu = null) |
||
| 2130 | |||
| 2131 | /** |
||
| 2132 | * NEXT_MAJOR : remove this method. |
||
| 2133 | * |
||
| 2134 | * @return BreadcrumbsBuilderInterface |
||
| 2135 | */ |
||
| 2136 | final public function getBreadcrumbsBuilder() |
||
| 2151 | |||
| 2152 | /** |
||
| 2153 | * NEXT_MAJOR : remove this method. |
||
| 2154 | * |
||
| 2155 | * @param BreadcrumbsBuilderInterface |
||
| 2156 | * |
||
| 2157 | * @return AbstractAdmin |
||
| 2158 | */ |
||
| 2159 | final public function setBreadcrumbsBuilder(BreadcrumbsBuilderInterface $value) |
||
| 2170 | |||
| 2171 | /** |
||
| 2172 | * {@inheritdoc} |
||
| 2173 | */ |
||
| 2174 | public function setCurrentChild($currentChild) |
||
| 2178 | |||
| 2179 | /** |
||
| 2180 | * {@inheritdoc} |
||
| 2181 | */ |
||
| 2182 | public function getCurrentChild() |
||
| 2186 | |||
| 2187 | /** |
||
| 2188 | * Returns the current child admin instance. |
||
| 2189 | * |
||
| 2190 | * @return AdminInterface|null the current child admin instance |
||
| 2191 | */ |
||
| 2192 | public function getCurrentChildAdmin() |
||
| 2202 | |||
| 2203 | /** |
||
| 2204 | * {@inheritdoc} |
||
| 2205 | */ |
||
| 2206 | public function trans($id, array $parameters = array(), $domain = null, $locale = null) |
||
| 2217 | |||
| 2218 | /** |
||
| 2219 | * Translate a message id. |
||
| 2220 | * |
||
| 2221 | * NEXT_MAJOR: remove this method |
||
| 2222 | * |
||
| 2223 | * @param string $id |
||
| 2224 | * @param int $count |
||
| 2225 | * @param array $parameters |
||
| 2226 | * @param string|null $domain |
||
| 2227 | * @param string|null $locale |
||
| 2228 | * |
||
| 2229 | * @return string the translated string |
||
| 2230 | * |
||
| 2231 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 2232 | */ |
||
| 2233 | public function transChoice($id, $count, array $parameters = array(), $domain = null, $locale = null) |
||
| 2244 | |||
| 2245 | /** |
||
| 2246 | * {@inheritdoc} |
||
| 2247 | */ |
||
| 2248 | public function setTranslationDomain($translationDomain) |
||
| 2252 | |||
| 2253 | /** |
||
| 2254 | * {@inheritdoc} |
||
| 2255 | */ |
||
| 2256 | public function getTranslationDomain() |
||
| 2260 | |||
| 2261 | /** |
||
| 2262 | * {@inheritdoc} |
||
| 2263 | * |
||
| 2264 | * NEXT_MAJOR: remove this method |
||
| 2265 | * |
||
| 2266 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 2267 | */ |
||
| 2268 | public function setTranslator(TranslatorInterface $translator) |
||
| 2280 | |||
| 2281 | /** |
||
| 2282 | * {@inheritdoc} |
||
| 2283 | * |
||
| 2284 | * NEXT_MAJOR: remove this method |
||
| 2285 | * |
||
| 2286 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 2287 | */ |
||
| 2288 | public function getTranslator() |
||
| 2297 | |||
| 2298 | /** |
||
| 2299 | * {@inheritdoc} |
||
| 2300 | */ |
||
| 2301 | public function getTranslationLabel($label, $context = '', $type = '') |
||
| 2305 | |||
| 2306 | /** |
||
| 2307 | * {@inheritdoc} |
||
| 2308 | */ |
||
| 2309 | public function setRequest(Request $request) |
||
| 2317 | |||
| 2318 | /** |
||
| 2319 | * {@inheritdoc} |
||
| 2320 | */ |
||
| 2321 | public function getRequest() |
||
| 2329 | |||
| 2330 | /** |
||
| 2331 | * {@inheritdoc} |
||
| 2332 | */ |
||
| 2333 | public function hasRequest() |
||
| 2337 | |||
| 2338 | /** |
||
| 2339 | * {@inheritdoc} |
||
| 2340 | */ |
||
| 2341 | public function setFormContractor(FormContractorInterface $formBuilder) |
||
| 2345 | |||
| 2346 | /** |
||
| 2347 | * @return FormContractorInterface |
||
| 2348 | */ |
||
| 2349 | public function getFormContractor() |
||
| 2353 | |||
| 2354 | /** |
||
| 2355 | * {@inheritdoc} |
||
| 2356 | */ |
||
| 2357 | public function setDatagridBuilder(DatagridBuilderInterface $datagridBuilder) |
||
| 2361 | |||
| 2362 | /** |
||
| 2363 | * {@inheritdoc} |
||
| 2364 | */ |
||
| 2365 | public function getDatagridBuilder() |
||
| 2369 | |||
| 2370 | /** |
||
| 2371 | * {@inheritdoc} |
||
| 2372 | */ |
||
| 2373 | public function setListBuilder(ListBuilderInterface $listBuilder) |
||
| 2377 | |||
| 2378 | /** |
||
| 2379 | * {@inheritdoc} |
||
| 2380 | */ |
||
| 2381 | public function getListBuilder() |
||
| 2385 | |||
| 2386 | /** |
||
| 2387 | * @param ShowBuilderInterface $showBuilder |
||
| 2388 | */ |
||
| 2389 | public function setShowBuilder(ShowBuilderInterface $showBuilder) |
||
| 2393 | |||
| 2394 | /** |
||
| 2395 | * @return ShowBuilderInterface |
||
| 2396 | */ |
||
| 2397 | public function getShowBuilder() |
||
| 2401 | |||
| 2402 | /** |
||
| 2403 | * {@inheritdoc} |
||
| 2404 | */ |
||
| 2405 | public function setConfigurationPool(Pool $configurationPool) |
||
| 2409 | |||
| 2410 | /** |
||
| 2411 | * @return Pool |
||
| 2412 | */ |
||
| 2413 | public function getConfigurationPool() |
||
| 2417 | |||
| 2418 | /** |
||
| 2419 | * {@inheritdoc} |
||
| 2420 | */ |
||
| 2421 | public function setRouteGenerator(RouteGeneratorInterface $routeGenerator) |
||
| 2425 | |||
| 2426 | /** |
||
| 2427 | * @return RouteGeneratorInterface |
||
| 2428 | */ |
||
| 2429 | public function getRouteGenerator() |
||
| 2433 | |||
| 2434 | /** |
||
| 2435 | * {@inheritdoc} |
||
| 2436 | */ |
||
| 2437 | public function getCode() |
||
| 2441 | |||
| 2442 | /** |
||
| 2443 | * NEXT_MAJOR: Remove this function. |
||
| 2444 | * |
||
| 2445 | * @deprecated This method is deprecated since 3.x and will be removed in 4.0 |
||
| 2446 | * |
||
| 2447 | * @param string $baseCodeRoute |
||
| 2448 | */ |
||
| 2449 | public function setBaseCodeRoute($baseCodeRoute) |
||
| 2458 | |||
| 2459 | /** |
||
| 2460 | * {@inheritdoc} |
||
| 2461 | */ |
||
| 2462 | public function getBaseCodeRoute() |
||
| 2484 | |||
| 2485 | /** |
||
| 2486 | * {@inheritdoc} |
||
| 2487 | */ |
||
| 2488 | public function getModelManager() |
||
| 2492 | |||
| 2493 | /** |
||
| 2494 | * @param ModelManagerInterface $modelManager |
||
| 2495 | */ |
||
| 2496 | public function setModelManager(ModelManagerInterface $modelManager) |
||
| 2500 | |||
| 2501 | /** |
||
| 2502 | * {@inheritdoc} |
||
| 2503 | */ |
||
| 2504 | public function getManagerType() |
||
| 2508 | |||
| 2509 | /** |
||
| 2510 | * @param string $type |
||
| 2511 | */ |
||
| 2512 | public function setManagerType($type) |
||
| 2516 | |||
| 2517 | /** |
||
| 2518 | * {@inheritdoc} |
||
| 2519 | */ |
||
| 2520 | public function getObjectIdentifier() |
||
| 2524 | |||
| 2525 | /** |
||
| 2526 | * Set the roles and permissions per role. |
||
| 2527 | * |
||
| 2528 | * @param array $information |
||
| 2529 | */ |
||
| 2530 | public function setSecurityInformation(array $information) |
||
| 2534 | |||
| 2535 | /** |
||
| 2536 | * {@inheritdoc} |
||
| 2537 | */ |
||
| 2538 | public function getSecurityInformation() |
||
| 2542 | |||
| 2543 | /** |
||
| 2544 | * Return the list of permissions the user should have in order to display the admin. |
||
| 2545 | * |
||
| 2546 | * @param string $context |
||
| 2547 | * |
||
| 2548 | * @return array |
||
| 2549 | */ |
||
| 2550 | public function getPermissionsShow($context) |
||
| 2559 | |||
| 2560 | /** |
||
| 2561 | * {@inheritdoc} |
||
| 2562 | */ |
||
| 2563 | public function showIn($context) |
||
| 2572 | |||
| 2573 | /** |
||
| 2574 | * {@inheritdoc} |
||
| 2575 | */ |
||
| 2576 | public function createObjectSecurity($object) |
||
| 2580 | |||
| 2581 | /** |
||
| 2582 | * {@inheritdoc} |
||
| 2583 | */ |
||
| 2584 | public function setSecurityHandler(SecurityHandlerInterface $securityHandler) |
||
| 2588 | |||
| 2589 | /** |
||
| 2590 | * {@inheritdoc} |
||
| 2591 | */ |
||
| 2592 | public function getSecurityHandler() |
||
| 2596 | |||
| 2597 | /** |
||
| 2598 | * {@inheritdoc} |
||
| 2599 | */ |
||
| 2600 | public function isGranted($name, $object = null) |
||
| 2610 | |||
| 2611 | /** |
||
| 2612 | * {@inheritdoc} |
||
| 2613 | */ |
||
| 2614 | public function getUrlsafeIdentifier($entity) |
||
| 2618 | |||
| 2619 | /** |
||
| 2620 | * {@inheritdoc} |
||
| 2621 | */ |
||
| 2622 | public function getNormalizedIdentifier($entity) |
||
| 2626 | |||
| 2627 | /** |
||
| 2628 | * {@inheritdoc} |
||
| 2629 | */ |
||
| 2630 | public function id($entity) |
||
| 2634 | |||
| 2635 | /** |
||
| 2636 | * {@inheritdoc} |
||
| 2637 | */ |
||
| 2638 | public function setValidator($validator) |
||
| 2650 | |||
| 2651 | /** |
||
| 2652 | * {@inheritdoc} |
||
| 2653 | */ |
||
| 2654 | public function getValidator() |
||
| 2658 | |||
| 2659 | /** |
||
| 2660 | * {@inheritdoc} |
||
| 2661 | */ |
||
| 2662 | public function getShow() |
||
| 2668 | |||
| 2669 | /** |
||
| 2670 | * {@inheritdoc} |
||
| 2671 | */ |
||
| 2672 | public function setFormTheme(array $formTheme) |
||
| 2676 | |||
| 2677 | /** |
||
| 2678 | * {@inheritdoc} |
||
| 2679 | */ |
||
| 2680 | public function getFormTheme() |
||
| 2684 | |||
| 2685 | /** |
||
| 2686 | * {@inheritdoc} |
||
| 2687 | */ |
||
| 2688 | public function setFilterTheme(array $filterTheme) |
||
| 2692 | |||
| 2693 | /** |
||
| 2694 | * {@inheritdoc} |
||
| 2695 | */ |
||
| 2696 | public function getFilterTheme() |
||
| 2700 | |||
| 2701 | /** |
||
| 2702 | * {@inheritdoc} |
||
| 2703 | */ |
||
| 2704 | public function addExtension(AdminExtensionInterface $extension) |
||
| 2708 | |||
| 2709 | /** |
||
| 2710 | * {@inheritdoc} |
||
| 2711 | */ |
||
| 2712 | public function getExtensions() |
||
| 2716 | |||
| 2717 | /** |
||
| 2718 | * {@inheritdoc} |
||
| 2719 | */ |
||
| 2720 | public function setMenuFactory(MenuFactoryInterface $menuFactory) |
||
| 2724 | |||
| 2725 | /** |
||
| 2726 | * {@inheritdoc} |
||
| 2727 | */ |
||
| 2728 | public function getMenuFactory() |
||
| 2732 | |||
| 2733 | /** |
||
| 2734 | * {@inheritdoc} |
||
| 2735 | */ |
||
| 2736 | public function setRouteBuilder(RouteBuilderInterface $routeBuilder) |
||
| 2740 | |||
| 2741 | /** |
||
| 2742 | * {@inheritdoc} |
||
| 2743 | */ |
||
| 2744 | public function getRouteBuilder() |
||
| 2748 | |||
| 2749 | /** |
||
| 2750 | * {@inheritdoc} |
||
| 2751 | */ |
||
| 2752 | public function toString($object) |
||
| 2764 | |||
| 2765 | /** |
||
| 2766 | * {@inheritdoc} |
||
| 2767 | */ |
||
| 2768 | public function setLabelTranslatorStrategy(LabelTranslatorStrategyInterface $labelTranslatorStrategy) |
||
| 2772 | |||
| 2773 | /** |
||
| 2774 | * {@inheritdoc} |
||
| 2775 | */ |
||
| 2776 | public function getLabelTranslatorStrategy() |
||
| 2780 | |||
| 2781 | /** |
||
| 2782 | * {@inheritdoc} |
||
| 2783 | */ |
||
| 2784 | public function supportsPreviewMode() |
||
| 2788 | |||
| 2789 | /** |
||
| 2790 | * Set custom per page options. |
||
| 2791 | * |
||
| 2792 | * @param array $options |
||
| 2793 | */ |
||
| 2794 | public function setPerPageOptions(array $options) |
||
| 2798 | |||
| 2799 | /** |
||
| 2800 | * Returns predefined per page options. |
||
| 2801 | * |
||
| 2802 | * @return array |
||
| 2803 | */ |
||
| 2804 | public function getPerPageOptions() |
||
| 2808 | |||
| 2809 | /** |
||
| 2810 | * Set pager type. |
||
| 2811 | * |
||
| 2812 | * @param string $pagerType |
||
| 2813 | */ |
||
| 2814 | public function setPagerType($pagerType) |
||
| 2818 | |||
| 2819 | /** |
||
| 2820 | * Get pager type. |
||
| 2821 | * |
||
| 2822 | * @return string |
||
| 2823 | */ |
||
| 2824 | public function getPagerType() |
||
| 2828 | |||
| 2829 | /** |
||
| 2830 | * Returns true if the per page value is allowed, false otherwise. |
||
| 2831 | * |
||
| 2832 | * @param int $perPage |
||
| 2833 | * |
||
| 2834 | * @return bool |
||
| 2835 | */ |
||
| 2836 | public function determinedPerPageValue($perPage) |
||
| 2840 | |||
| 2841 | /** |
||
| 2842 | * {@inheritdoc} |
||
| 2843 | */ |
||
| 2844 | public function isAclEnabled() |
||
| 2848 | |||
| 2849 | /** |
||
| 2850 | * {@inheritdoc} |
||
| 2851 | */ |
||
| 2852 | public function getObjectMetadata($object) |
||
| 2856 | |||
| 2857 | /** |
||
| 2858 | * {@inheritdoc} |
||
| 2859 | */ |
||
| 2860 | public function getListModes() |
||
| 2864 | |||
| 2865 | /** |
||
| 2866 | * {@inheritdoc} |
||
| 2867 | */ |
||
| 2868 | public function setListMode($mode) |
||
| 2876 | |||
| 2877 | /** |
||
| 2878 | * {@inheritdoc} |
||
| 2879 | */ |
||
| 2880 | public function getListMode() |
||
| 2888 | |||
| 2889 | /** |
||
| 2890 | * {@inheritdoc} |
||
| 2891 | */ |
||
| 2892 | public function getAccessMapping() |
||
| 2896 | |||
| 2897 | /** |
||
| 2898 | * {@inheritdoc} |
||
| 2899 | */ |
||
| 2900 | public function checkAccess($action, $object = null) |
||
| 2922 | |||
| 2923 | /** |
||
| 2924 | * Hook to handle access authorization, without throw Exception. |
||
| 2925 | * |
||
| 2926 | * @param string $action |
||
| 2927 | * @param object $object |
||
| 2928 | * |
||
| 2929 | * @return bool |
||
| 2930 | */ |
||
| 2931 | public function hasAccess($action, $object = null) |
||
| 2951 | |||
| 2952 | /** |
||
| 2953 | * {@inheritdoc} |
||
| 2954 | */ |
||
| 2955 | public function configureActionButtons($action, $object = null) |
||
| 3017 | |||
| 3018 | /** |
||
| 3019 | * @param string $action |
||
| 3020 | * @param mixed $object |
||
| 3021 | * |
||
| 3022 | * @return array |
||
| 3023 | */ |
||
| 3024 | public function getActionButtons($action, $object = null) |
||
| 3037 | |||
| 3038 | /** |
||
| 3039 | * Get the list of actions that can be accessed directly from the dashboard. |
||
| 3040 | * |
||
| 3041 | * @return array |
||
| 3042 | */ |
||
| 3043 | public function getDashboardActions() |
||
| 3068 | |||
| 3069 | /** |
||
| 3070 | * Setting to true will enable mosaic button for the admin screen. |
||
| 3071 | * Setting to false will hide mosaic button for the admin screen. |
||
| 3072 | * |
||
| 3073 | * @param bool $isShown |
||
| 3074 | */ |
||
| 3075 | final public function showMosaicButton($isShown) |
||
| 3083 | |||
| 3084 | /** |
||
| 3085 | * @param FormMapper $form |
||
| 3086 | */ |
||
| 3087 | final public function getSearchResultLink($object) |
||
| 3097 | |||
| 3098 | /** |
||
| 3099 | * Checks if a filter type is set to a default value. |
||
| 3100 | * |
||
| 3101 | * @param string $name |
||
| 3102 | * |
||
| 3103 | * @return bool |
||
| 3104 | */ |
||
| 3105 | final public function isDefaultFilter($name) |
||
| 3116 | |||
| 3117 | /** |
||
| 3118 | * Check object existence and access, without throw Exception. |
||
| 3119 | * |
||
| 3120 | * @param string $action |
||
| 3121 | * @param object $object |
||
| 3122 | * |
||
| 3123 | * @return bool |
||
| 3124 | */ |
||
| 3125 | public function canAccessObject($action, $object) |
||
| 3129 | |||
| 3130 | /** |
||
| 3131 | * Returns a list of default filters. |
||
| 3132 | * |
||
| 3133 | * @return array |
||
| 3134 | */ |
||
| 3135 | final protected function getDefaultFilterValues() |
||
| 3150 | |||
| 3151 | /** |
||
| 3152 | * {@inheritdoc} |
||
| 3153 | */ |
||
| 3154 | protected function configureFormFields(FormMapper $form) |
||
| 3157 | |||
| 3158 | /** |
||
| 3159 | * @param ListMapper $list |
||
| 3160 | */ |
||
| 3161 | protected function configureListFields(ListMapper $list) |
||
| 3164 | |||
| 3165 | /** |
||
| 3166 | * @param DatagridMapper $filter |
||
| 3167 | */ |
||
| 3168 | protected function configureDatagridFilters(DatagridMapper $filter) |
||
| 3171 | |||
| 3172 | /** |
||
| 3173 | * @param ShowMapper $show |
||
| 3174 | */ |
||
| 3175 | protected function configureShowFields(ShowMapper $show) |
||
| 3178 | |||
| 3179 | /** |
||
| 3180 | * @param RouteCollection $collection |
||
| 3181 | */ |
||
| 3182 | protected function configureRoutes(RouteCollection $collection) |
||
| 3185 | |||
| 3186 | /** |
||
| 3187 | * Allows you to customize batch actions. |
||
| 3188 | * |
||
| 3189 | * @param array $actions List of actions |
||
| 3190 | * |
||
| 3191 | * @return array |
||
| 3192 | */ |
||
| 3193 | protected function configureBatchActions($actions) |
||
| 3197 | |||
| 3198 | /** |
||
| 3199 | * NEXT_MAJOR: remove this method. |
||
| 3200 | * |
||
| 3201 | * @param MenuItemInterface $menu |
||
| 3202 | * @param $action |
||
| 3203 | * @param AdminInterface $childAdmin |
||
| 3204 | * |
||
| 3205 | * @return mixed |
||
| 3206 | * |
||
| 3207 | * @deprecated Use configureTabMenu instead |
||
| 3208 | */ |
||
| 3209 | protected function configureSideMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null) |
||
| 3212 | |||
| 3213 | /** |
||
| 3214 | * Configures the tab menu in your admin. |
||
| 3215 | * |
||
| 3216 | * @param MenuItemInterface $menu |
||
| 3217 | * @param string $action |
||
| 3218 | * @param AdminInterface $childAdmin |
||
| 3219 | * |
||
| 3220 | * @return mixed |
||
| 3221 | */ |
||
| 3222 | protected function configureTabMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null) |
||
| 3228 | |||
| 3229 | /** |
||
| 3230 | * build the view FieldDescription array. |
||
| 3231 | */ |
||
| 3232 | protected function buildShow() |
||
| 3247 | |||
| 3248 | /** |
||
| 3249 | * build the list FieldDescription array. |
||
| 3250 | */ |
||
| 3251 | protected function buildList() |
||
| 3303 | |||
| 3304 | /** |
||
| 3305 | * Build the form FieldDescription collection. |
||
| 3306 | */ |
||
| 3307 | protected function buildForm() |
||
| 3335 | |||
| 3336 | /** |
||
| 3337 | * Gets the subclass corresponding to the given name. |
||
| 3338 | * |
||
| 3339 | * @param string $name The name of the sub class |
||
| 3340 | * |
||
| 3341 | * @return string the subclass |
||
| 3342 | */ |
||
| 3343 | protected function getSubClass($name) |
||
| 3355 | |||
| 3356 | /** |
||
| 3357 | * Attach the inline validator to the model metadata, this must be done once per admin. |
||
| 3358 | */ |
||
| 3359 | protected function attachInlineValidator() |
||
| 3391 | |||
| 3392 | /** |
||
| 3393 | * Predefine per page options. |
||
| 3394 | */ |
||
| 3395 | protected function predefinePerPageOptions() |
||
| 3401 | |||
| 3402 | /** |
||
| 3403 | * Return list routes with permissions name. |
||
| 3404 | * |
||
| 3405 | * @return array |
||
| 3406 | */ |
||
| 3407 | protected function getAccess() |
||
| 3432 | |||
| 3433 | /** |
||
| 3434 | * Returns a list of default filters. |
||
| 3435 | * |
||
| 3436 | * @param array $filterValues |
||
| 3437 | */ |
||
| 3438 | protected function configureDefaultFilterValues(array &$filterValues) |
||
| 3441 | |||
| 3442 | /** |
||
| 3443 | * Build all the related urls to the current admin. |
||
| 3444 | */ |
||
| 3445 | private function buildRoutes() |
||
| 3468 | } |
||
| 3469 |
This check marks private properties in classes that are never used. Those properties can be removed.