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 |
||
| 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 | * @var string |
||
| 231 | */ |
||
| 232 | protected $baseCodeRoute = ''; |
||
| 233 | |||
| 234 | /** |
||
| 235 | * The related parent association, ie if OrderElement has a parent property named order, |
||
| 236 | * then the $parentAssociationMapping must be a string named `order`. |
||
| 237 | * |
||
| 238 | * @var string |
||
| 239 | */ |
||
| 240 | protected $parentAssociationMapping = null; |
||
| 241 | |||
| 242 | /** |
||
| 243 | * Reference the parent FieldDescription related to this admin |
||
| 244 | * only set for FieldDescription which is associated to an Sub Admin instance. |
||
| 245 | * |
||
| 246 | * @var FieldDescriptionInterface |
||
| 247 | */ |
||
| 248 | protected $parentFieldDescription; |
||
| 249 | |||
| 250 | /** |
||
| 251 | * If true then the current admin is part of the nested admin set (from the url). |
||
| 252 | * |
||
| 253 | * @var bool |
||
| 254 | */ |
||
| 255 | protected $currentChild = false; |
||
| 256 | |||
| 257 | /** |
||
| 258 | * The uniqid is used to avoid clashing with 2 admin related to the code |
||
| 259 | * ie: a Block linked to a Block. |
||
| 260 | * |
||
| 261 | * @var string |
||
| 262 | */ |
||
| 263 | protected $uniqid; |
||
| 264 | |||
| 265 | /** |
||
| 266 | * The Entity or Document manager. |
||
| 267 | * |
||
| 268 | * @var ModelManagerInterface |
||
| 269 | */ |
||
| 270 | protected $modelManager; |
||
| 271 | |||
| 272 | /** |
||
| 273 | * The current request object. |
||
| 274 | * |
||
| 275 | * @var \Symfony\Component\HttpFoundation\Request |
||
| 276 | */ |
||
| 277 | protected $request; |
||
| 278 | |||
| 279 | /** |
||
| 280 | * The translator component. |
||
| 281 | * |
||
| 282 | * NEXT_MAJOR: remove this property |
||
| 283 | * |
||
| 284 | * @var \Symfony\Component\Translation\TranslatorInterface |
||
| 285 | * |
||
| 286 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 287 | */ |
||
| 288 | protected $translator; |
||
| 289 | |||
| 290 | /** |
||
| 291 | * The related form contractor. |
||
| 292 | * |
||
| 293 | * @var FormContractorInterface |
||
| 294 | */ |
||
| 295 | protected $formContractor; |
||
| 296 | |||
| 297 | /** |
||
| 298 | * The related list builder. |
||
| 299 | * |
||
| 300 | * @var ListBuilderInterface |
||
| 301 | */ |
||
| 302 | protected $listBuilder; |
||
| 303 | |||
| 304 | /** |
||
| 305 | * The related view builder. |
||
| 306 | * |
||
| 307 | * @var ShowBuilderInterface |
||
| 308 | */ |
||
| 309 | protected $showBuilder; |
||
| 310 | |||
| 311 | /** |
||
| 312 | * The related datagrid builder. |
||
| 313 | * |
||
| 314 | * @var DatagridBuilderInterface |
||
| 315 | */ |
||
| 316 | protected $datagridBuilder; |
||
| 317 | |||
| 318 | /** |
||
| 319 | * @var RouteBuilderInterface |
||
| 320 | */ |
||
| 321 | protected $routeBuilder; |
||
| 322 | |||
| 323 | /** |
||
| 324 | * The datagrid instance. |
||
| 325 | * |
||
| 326 | * @var \Sonata\AdminBundle\Datagrid\DatagridInterface |
||
| 327 | */ |
||
| 328 | protected $datagrid; |
||
| 329 | |||
| 330 | /** |
||
| 331 | * The router instance. |
||
| 332 | * |
||
| 333 | * @var RouteGeneratorInterface |
||
| 334 | */ |
||
| 335 | protected $routeGenerator; |
||
| 336 | |||
| 337 | /** |
||
| 338 | * The generated breadcrumbs. |
||
| 339 | * |
||
| 340 | * NEXT_MAJOR : remove this property |
||
| 341 | * |
||
| 342 | * @var array |
||
| 343 | */ |
||
| 344 | protected $breadcrumbs = array(); |
||
| 345 | |||
| 346 | /** |
||
| 347 | * @var SecurityHandlerInterface |
||
| 348 | */ |
||
| 349 | protected $securityHandler = null; |
||
| 350 | |||
| 351 | /** |
||
| 352 | * @var ValidatorInterface|LegacyValidatorInterface |
||
| 353 | */ |
||
| 354 | protected $validator = null; |
||
| 355 | |||
| 356 | /** |
||
| 357 | * The configuration pool. |
||
| 358 | * |
||
| 359 | * @var Pool |
||
| 360 | */ |
||
| 361 | protected $configurationPool; |
||
| 362 | |||
| 363 | /** |
||
| 364 | * @var MenuItemInterface |
||
| 365 | */ |
||
| 366 | protected $menu; |
||
| 367 | |||
| 368 | /** |
||
| 369 | * @var MenuFactoryInterface |
||
| 370 | */ |
||
| 371 | protected $menuFactory; |
||
| 372 | |||
| 373 | /** |
||
| 374 | * @var array |
||
| 375 | */ |
||
| 376 | protected $loaded = array( |
||
| 377 | 'view_fields' => false, |
||
| 378 | 'view_groups' => false, |
||
| 379 | 'routes' => false, |
||
| 380 | 'tab_menu' => false, |
||
| 381 | ); |
||
| 382 | |||
| 383 | /** |
||
| 384 | * @var array |
||
| 385 | */ |
||
| 386 | protected $formTheme = array(); |
||
| 387 | |||
| 388 | /** |
||
| 389 | * @var array |
||
| 390 | */ |
||
| 391 | protected $filterTheme = array(); |
||
| 392 | |||
| 393 | /** |
||
| 394 | * @var array |
||
| 395 | */ |
||
| 396 | protected $templates = array(); |
||
| 397 | |||
| 398 | /** |
||
| 399 | * @var AdminExtensionInterface[] |
||
| 400 | */ |
||
| 401 | protected $extensions = array(); |
||
| 402 | |||
| 403 | /** |
||
| 404 | * @var LabelTranslatorStrategyInterface |
||
| 405 | */ |
||
| 406 | protected $labelTranslatorStrategy; |
||
| 407 | |||
| 408 | /** |
||
| 409 | * Setting to true will enable preview mode for |
||
| 410 | * the entity and show a preview button in the |
||
| 411 | * edit/create forms. |
||
| 412 | * |
||
| 413 | * @var bool |
||
| 414 | */ |
||
| 415 | protected $supportsPreviewMode = false; |
||
| 416 | |||
| 417 | /** |
||
| 418 | * Roles and permissions per role. |
||
| 419 | * |
||
| 420 | * @var array [role] => array([permission], [permission]) |
||
| 421 | */ |
||
| 422 | protected $securityInformation = array(); |
||
| 423 | |||
| 424 | protected $cacheIsGranted = array(); |
||
| 425 | |||
| 426 | /** |
||
| 427 | * Action list for the search result. |
||
| 428 | * |
||
| 429 | * @var string[] |
||
| 430 | */ |
||
| 431 | protected $searchResultActions = array('edit', 'show'); |
||
| 432 | |||
| 433 | protected $listModes = array( |
||
| 434 | 'list' => array( |
||
| 435 | 'class' => 'fa fa-list fa-fw', |
||
| 436 | ), |
||
| 437 | 'mosaic' => array( |
||
| 438 | 'class' => self::MOSAIC_ICON_CLASS, |
||
| 439 | ), |
||
| 440 | ); |
||
| 441 | |||
| 442 | /** |
||
| 443 | * The Access mapping. |
||
| 444 | * |
||
| 445 | * @var array [action1 => requiredRole1, action2 => [requiredRole2, requiredRole3]] |
||
| 446 | */ |
||
| 447 | protected $accessMapping = array(); |
||
| 448 | |||
| 449 | /** |
||
| 450 | * The class name managed by the admin class. |
||
| 451 | * |
||
| 452 | * @var string |
||
| 453 | */ |
||
| 454 | private $class; |
||
| 455 | |||
| 456 | /** |
||
| 457 | * The subclasses supported by the admin class. |
||
| 458 | * |
||
| 459 | * @var array |
||
| 460 | */ |
||
| 461 | private $subClasses = array(); |
||
| 462 | |||
| 463 | /** |
||
| 464 | * The list collection. |
||
| 465 | * |
||
| 466 | * @var array |
||
| 467 | */ |
||
| 468 | private $list; |
||
| 469 | |||
| 470 | /** |
||
| 471 | * @var FieldDescriptionCollection |
||
| 472 | */ |
||
| 473 | private $show; |
||
| 474 | |||
| 475 | /** |
||
| 476 | * @var Form |
||
| 477 | */ |
||
| 478 | private $form; |
||
| 479 | |||
| 480 | /** |
||
| 481 | * @var DatagridInterface |
||
| 482 | */ |
||
| 483 | private $filter; |
||
|
|
|||
| 484 | |||
| 485 | /** |
||
| 486 | * The cached base route name. |
||
| 487 | * |
||
| 488 | * @var string |
||
| 489 | */ |
||
| 490 | private $cachedBaseRouteName; |
||
| 491 | |||
| 492 | /** |
||
| 493 | * The cached base route pattern. |
||
| 494 | * |
||
| 495 | * @var string |
||
| 496 | */ |
||
| 497 | private $cachedBaseRoutePattern; |
||
| 498 | |||
| 499 | /** |
||
| 500 | * The form group disposition. |
||
| 501 | * |
||
| 502 | * @var array|bool |
||
| 503 | */ |
||
| 504 | private $formGroups = false; |
||
| 505 | |||
| 506 | /** |
||
| 507 | * The form tabs disposition. |
||
| 508 | * |
||
| 509 | * @var array|bool |
||
| 510 | */ |
||
| 511 | private $formTabs = false; |
||
| 512 | |||
| 513 | /** |
||
| 514 | * The view group disposition. |
||
| 515 | * |
||
| 516 | * @var array|bool |
||
| 517 | */ |
||
| 518 | private $showGroups = false; |
||
| 519 | |||
| 520 | /** |
||
| 521 | * The view tab disposition. |
||
| 522 | * |
||
| 523 | * @var array|bool |
||
| 524 | */ |
||
| 525 | private $showTabs = false; |
||
| 526 | |||
| 527 | /** |
||
| 528 | * The manager type to use for the admin. |
||
| 529 | * |
||
| 530 | * @var string |
||
| 531 | */ |
||
| 532 | private $managerType; |
||
| 533 | |||
| 534 | /** |
||
| 535 | * The breadcrumbsBuilder component. |
||
| 536 | * |
||
| 537 | * @var BreadcrumbsBuilderInterface |
||
| 538 | */ |
||
| 539 | private $breadcrumbsBuilder; |
||
| 540 | |||
| 541 | /** |
||
| 542 | * @param string $code |
||
| 543 | * @param string $class |
||
| 544 | * @param string $baseControllerName |
||
| 545 | */ |
||
| 546 | public function __construct($code, $class, $baseControllerName) |
||
| 555 | |||
| 556 | /** |
||
| 557 | * {@inheritdoc} |
||
| 558 | * |
||
| 559 | * NEXT_MAJOR: return null to indicate no override |
||
| 560 | */ |
||
| 561 | public function getExportFormats() |
||
| 567 | |||
| 568 | /** |
||
| 569 | * @return array |
||
| 570 | */ |
||
| 571 | public function getExportFields() |
||
| 583 | |||
| 584 | /** |
||
| 585 | * {@inheritdoc} |
||
| 586 | */ |
||
| 587 | public function getDataSourceIterator() |
||
| 609 | |||
| 610 | /** |
||
| 611 | * {@inheritdoc} |
||
| 612 | */ |
||
| 613 | public function validate(ErrorElement $errorElement, $object) |
||
| 616 | |||
| 617 | /** |
||
| 618 | * define custom variable. |
||
| 619 | */ |
||
| 620 | public function initialize() |
||
| 630 | |||
| 631 | /** |
||
| 632 | * {@inheritdoc} |
||
| 633 | */ |
||
| 634 | public function configure() |
||
| 637 | |||
| 638 | /** |
||
| 639 | * {@inheritdoc} |
||
| 640 | */ |
||
| 641 | public function update($object) |
||
| 661 | |||
| 662 | /** |
||
| 663 | * {@inheritdoc} |
||
| 664 | */ |
||
| 665 | public function create($object) |
||
| 687 | |||
| 688 | /** |
||
| 689 | * {@inheritdoc} |
||
| 690 | */ |
||
| 691 | public function delete($object) |
||
| 706 | |||
| 707 | /** |
||
| 708 | * {@inheritdoc} |
||
| 709 | */ |
||
| 710 | public function preValidate($object) |
||
| 713 | |||
| 714 | /** |
||
| 715 | * {@inheritdoc} |
||
| 716 | */ |
||
| 717 | public function preUpdate($object) |
||
| 720 | |||
| 721 | /** |
||
| 722 | * {@inheritdoc} |
||
| 723 | */ |
||
| 724 | public function postUpdate($object) |
||
| 727 | |||
| 728 | /** |
||
| 729 | * {@inheritdoc} |
||
| 730 | */ |
||
| 731 | public function prePersist($object) |
||
| 734 | |||
| 735 | /** |
||
| 736 | * {@inheritdoc} |
||
| 737 | */ |
||
| 738 | public function postPersist($object) |
||
| 741 | |||
| 742 | /** |
||
| 743 | * {@inheritdoc} |
||
| 744 | */ |
||
| 745 | public function preRemove($object) |
||
| 748 | |||
| 749 | /** |
||
| 750 | * {@inheritdoc} |
||
| 751 | */ |
||
| 752 | public function postRemove($object) |
||
| 755 | |||
| 756 | /** |
||
| 757 | * {@inheritdoc} |
||
| 758 | */ |
||
| 759 | public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements) |
||
| 762 | |||
| 763 | /** |
||
| 764 | * {@inheritdoc} |
||
| 765 | */ |
||
| 766 | public function getFilterParameters() |
||
| 803 | |||
| 804 | /** |
||
| 805 | * {@inheritdoc} |
||
| 806 | */ |
||
| 807 | public function buildDatagrid() |
||
| 869 | |||
| 870 | /** |
||
| 871 | * Returns the name of the parent related field, so the field can be use to set the default |
||
| 872 | * value (ie the parent object) or to filter the object. |
||
| 873 | * |
||
| 874 | * @return string the name of the parent related field |
||
| 875 | */ |
||
| 876 | public function getParentAssociationMapping() |
||
| 880 | |||
| 881 | /** |
||
| 882 | * Returns the baseRoutePattern used to generate the routing information. |
||
| 883 | * |
||
| 884 | * @throws \RuntimeException |
||
| 885 | * |
||
| 886 | * @return string the baseRoutePattern used to generate the routing information |
||
| 887 | */ |
||
| 888 | public function getBaseRoutePattern() |
||
| 925 | |||
| 926 | /** |
||
| 927 | * Returns the baseRouteName used to generate the routing information. |
||
| 928 | * |
||
| 929 | * @throws \RuntimeException |
||
| 930 | * |
||
| 931 | * @return string the baseRouteName used to generate the routing information |
||
| 932 | */ |
||
| 933 | public function getBaseRouteName() |
||
| 970 | |||
| 971 | /** |
||
| 972 | * urlize the given word. |
||
| 973 | * |
||
| 974 | * @param string $word |
||
| 975 | * @param string $sep the separator |
||
| 976 | * |
||
| 977 | * @return string |
||
| 978 | */ |
||
| 979 | public function urlize($word, $sep = '_') |
||
| 983 | |||
| 984 | /** |
||
| 985 | * {@inheritdoc} |
||
| 986 | */ |
||
| 987 | public function getClass() |
||
| 1014 | |||
| 1015 | /** |
||
| 1016 | * {@inheritdoc} |
||
| 1017 | */ |
||
| 1018 | public function getSubClasses() |
||
| 1022 | |||
| 1023 | /** |
||
| 1024 | * {@inheritdoc} |
||
| 1025 | */ |
||
| 1026 | public function addSubClass($subClass) |
||
| 1032 | |||
| 1033 | /** |
||
| 1034 | * {@inheritdoc} |
||
| 1035 | */ |
||
| 1036 | public function setSubClasses(array $subClasses) |
||
| 1040 | |||
| 1041 | /** |
||
| 1042 | * {@inheritdoc} |
||
| 1043 | */ |
||
| 1044 | public function hasSubClass($name) |
||
| 1048 | |||
| 1049 | /** |
||
| 1050 | * {@inheritdoc} |
||
| 1051 | */ |
||
| 1052 | public function hasActiveSubClass() |
||
| 1060 | |||
| 1061 | /** |
||
| 1062 | * {@inheritdoc} |
||
| 1063 | */ |
||
| 1064 | public function getActiveSubClass() |
||
| 1072 | |||
| 1073 | /** |
||
| 1074 | * {@inheritdoc} |
||
| 1075 | */ |
||
| 1076 | public function getActiveSubclassCode() |
||
| 1090 | |||
| 1091 | /** |
||
| 1092 | * {@inheritdoc} |
||
| 1093 | */ |
||
| 1094 | public function getBatchActions() |
||
| 1127 | |||
| 1128 | /** |
||
| 1129 | * {@inheritdoc} |
||
| 1130 | */ |
||
| 1131 | public function getRoutes() |
||
| 1137 | |||
| 1138 | /** |
||
| 1139 | * {@inheritdoc} |
||
| 1140 | */ |
||
| 1141 | public function getRouterIdParameter() |
||
| 1145 | |||
| 1146 | /** |
||
| 1147 | * {@inheritdoc} |
||
| 1148 | */ |
||
| 1149 | public function getIdParameter() |
||
| 1153 | |||
| 1154 | /** |
||
| 1155 | * {@inheritdoc} |
||
| 1156 | */ |
||
| 1157 | public function hasRoute($name) |
||
| 1165 | |||
| 1166 | /** |
||
| 1167 | * {@inheritdoc} |
||
| 1168 | */ |
||
| 1169 | public function isCurrentRoute($name, $adminCode = null) |
||
| 1190 | |||
| 1191 | /** |
||
| 1192 | * {@inheritdoc} |
||
| 1193 | */ |
||
| 1194 | public function generateObjectUrl($name, $object, array $parameters = array(), $absolute = UrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1200 | |||
| 1201 | /** |
||
| 1202 | * {@inheritdoc} |
||
| 1203 | */ |
||
| 1204 | public function generateUrl($name, array $parameters = array(), $absolute = UrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1208 | |||
| 1209 | /** |
||
| 1210 | * {@inheritdoc} |
||
| 1211 | */ |
||
| 1212 | public function generateMenuUrl($name, array $parameters = array(), $absolute = UrlGeneratorInterface::ABSOLUTE_PATH) |
||
| 1216 | |||
| 1217 | /** |
||
| 1218 | * @param array $templates |
||
| 1219 | */ |
||
| 1220 | public function setTemplates(array $templates) |
||
| 1224 | |||
| 1225 | /** |
||
| 1226 | * @param string $name |
||
| 1227 | * @param string $template |
||
| 1228 | */ |
||
| 1229 | public function setTemplate($name, $template) |
||
| 1233 | |||
| 1234 | /** |
||
| 1235 | * @return array |
||
| 1236 | */ |
||
| 1237 | public function getTemplates() |
||
| 1241 | |||
| 1242 | /** |
||
| 1243 | * {@inheritdoc} |
||
| 1244 | */ |
||
| 1245 | public function getTemplate($name) |
||
| 1251 | |||
| 1252 | /** |
||
| 1253 | * {@inheritdoc} |
||
| 1254 | */ |
||
| 1255 | public function getNewInstance() |
||
| 1264 | |||
| 1265 | /** |
||
| 1266 | * {@inheritdoc} |
||
| 1267 | */ |
||
| 1268 | public function getFormBuilder() |
||
| 1281 | |||
| 1282 | /** |
||
| 1283 | * This method is being called by the main admin class and the child class, |
||
| 1284 | * the getFormBuilder is only call by the main admin class. |
||
| 1285 | * |
||
| 1286 | * @param FormBuilderInterface $formBuilder |
||
| 1287 | */ |
||
| 1288 | public function defineFormBuilder(FormBuilderInterface $formBuilder) |
||
| 1300 | |||
| 1301 | /** |
||
| 1302 | * {@inheritdoc} |
||
| 1303 | */ |
||
| 1304 | public function attachAdminClass(FieldDescriptionInterface $fieldDescription) |
||
| 1326 | |||
| 1327 | /** |
||
| 1328 | * {@inheritdoc} |
||
| 1329 | */ |
||
| 1330 | public function getObject($id) |
||
| 1339 | |||
| 1340 | /** |
||
| 1341 | * {@inheritdoc} |
||
| 1342 | */ |
||
| 1343 | public function getForm() |
||
| 1349 | |||
| 1350 | /** |
||
| 1351 | * {@inheritdoc} |
||
| 1352 | */ |
||
| 1353 | public function getList() |
||
| 1359 | |||
| 1360 | /** |
||
| 1361 | * {@inheritdoc} |
||
| 1362 | */ |
||
| 1363 | public function createQuery($context = 'list') |
||
| 1379 | |||
| 1380 | /** |
||
| 1381 | * {@inheritdoc} |
||
| 1382 | */ |
||
| 1383 | public function getDatagrid() |
||
| 1389 | |||
| 1390 | /** |
||
| 1391 | * {@inheritdoc} |
||
| 1392 | */ |
||
| 1393 | public function buildTabMenu($action, AdminInterface $childAdmin = null) |
||
| 1418 | |||
| 1419 | /** |
||
| 1420 | * {@inheritdoc} |
||
| 1421 | */ |
||
| 1422 | public function buildSideMenu($action, AdminInterface $childAdmin = null) |
||
| 1426 | |||
| 1427 | /** |
||
| 1428 | * @param string $action |
||
| 1429 | * @param AdminInterface $childAdmin |
||
| 1430 | * |
||
| 1431 | * @return ItemInterface |
||
| 1432 | */ |
||
| 1433 | public function getSideMenu($action, AdminInterface $childAdmin = null) |
||
| 1443 | |||
| 1444 | /** |
||
| 1445 | * Returns the root code. |
||
| 1446 | * |
||
| 1447 | * @return string the root code |
||
| 1448 | */ |
||
| 1449 | public function getRootCode() |
||
| 1453 | |||
| 1454 | /** |
||
| 1455 | * Returns the master admin. |
||
| 1456 | * |
||
| 1457 | * @return AbstractAdmin the root admin class |
||
| 1458 | */ |
||
| 1459 | public function getRoot() |
||
| 1469 | |||
| 1470 | /** |
||
| 1471 | * {@inheritdoc} |
||
| 1472 | */ |
||
| 1473 | public function setBaseControllerName($baseControllerName) |
||
| 1477 | |||
| 1478 | /** |
||
| 1479 | * {@inheritdoc} |
||
| 1480 | */ |
||
| 1481 | public function getBaseControllerName() |
||
| 1485 | |||
| 1486 | /** |
||
| 1487 | * @param string $label |
||
| 1488 | */ |
||
| 1489 | public function setLabel($label) |
||
| 1493 | |||
| 1494 | /** |
||
| 1495 | * {@inheritdoc} |
||
| 1496 | */ |
||
| 1497 | public function getLabel() |
||
| 1501 | |||
| 1502 | /** |
||
| 1503 | * @param bool $persist |
||
| 1504 | */ |
||
| 1505 | public function setPersistFilters($persist) |
||
| 1509 | |||
| 1510 | /** |
||
| 1511 | * @param int $maxPerPage |
||
| 1512 | */ |
||
| 1513 | public function setMaxPerPage($maxPerPage) |
||
| 1517 | |||
| 1518 | /** |
||
| 1519 | * @return int |
||
| 1520 | */ |
||
| 1521 | public function getMaxPerPage() |
||
| 1525 | |||
| 1526 | /** |
||
| 1527 | * @param int $maxPageLinks |
||
| 1528 | */ |
||
| 1529 | public function setMaxPageLinks($maxPageLinks) |
||
| 1533 | |||
| 1534 | /** |
||
| 1535 | * @return int |
||
| 1536 | */ |
||
| 1537 | public function getMaxPageLinks() |
||
| 1541 | |||
| 1542 | /** |
||
| 1543 | * {@inheritdoc} |
||
| 1544 | */ |
||
| 1545 | public function getFormGroups() |
||
| 1549 | |||
| 1550 | /** |
||
| 1551 | * {@inheritdoc} |
||
| 1552 | */ |
||
| 1553 | public function setFormGroups(array $formGroups) |
||
| 1557 | |||
| 1558 | /** |
||
| 1559 | * {@inheritdoc} |
||
| 1560 | */ |
||
| 1561 | public function removeFieldFromFormGroup($key) |
||
| 1571 | |||
| 1572 | /** |
||
| 1573 | * @param array $group |
||
| 1574 | * @param array $keys |
||
| 1575 | */ |
||
| 1576 | public function reorderFormGroup($group, array $keys) |
||
| 1582 | |||
| 1583 | /** |
||
| 1584 | * {@inheritdoc} |
||
| 1585 | */ |
||
| 1586 | public function getFormTabs() |
||
| 1590 | |||
| 1591 | /** |
||
| 1592 | * {@inheritdoc} |
||
| 1593 | */ |
||
| 1594 | public function setFormTabs(array $formTabs) |
||
| 1598 | |||
| 1599 | /** |
||
| 1600 | * {@inheritdoc} |
||
| 1601 | */ |
||
| 1602 | public function getShowTabs() |
||
| 1606 | |||
| 1607 | /** |
||
| 1608 | * {@inheritdoc} |
||
| 1609 | */ |
||
| 1610 | public function setShowTabs(array $showTabs) |
||
| 1614 | |||
| 1615 | /** |
||
| 1616 | * {@inheritdoc} |
||
| 1617 | */ |
||
| 1618 | public function getShowGroups() |
||
| 1622 | |||
| 1623 | /** |
||
| 1624 | * {@inheritdoc} |
||
| 1625 | */ |
||
| 1626 | public function setShowGroups(array $showGroups) |
||
| 1630 | |||
| 1631 | /** |
||
| 1632 | * {@inheritdoc} |
||
| 1633 | */ |
||
| 1634 | public function reorderShowGroup($group, array $keys) |
||
| 1640 | |||
| 1641 | /** |
||
| 1642 | * {@inheritdoc} |
||
| 1643 | */ |
||
| 1644 | public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription) |
||
| 1648 | |||
| 1649 | /** |
||
| 1650 | * {@inheritdoc} |
||
| 1651 | */ |
||
| 1652 | public function getParentFieldDescription() |
||
| 1656 | |||
| 1657 | /** |
||
| 1658 | * {@inheritdoc} |
||
| 1659 | */ |
||
| 1660 | public function hasParentFieldDescription() |
||
| 1664 | |||
| 1665 | /** |
||
| 1666 | * {@inheritdoc} |
||
| 1667 | */ |
||
| 1668 | public function setSubject($subject) |
||
| 1685 | |||
| 1686 | /** |
||
| 1687 | * {@inheritdoc} |
||
| 1688 | */ |
||
| 1689 | public function getSubject() |
||
| 1690 | { |
||
| 1691 | if ($this->subject === null && $this->request && !$this->hasParentFieldDescription()) { |
||
| 1692 | $id = $this->request->get($this->getIdParameter()); |
||
| 1693 | $this->subject = $this->getModelManager()->find($this->class, $id); |
||
| 1694 | } |
||
| 1695 | |||
| 1696 | return $this->subject; |
||
| 1697 | } |
||
| 1698 | |||
| 1699 | /** |
||
| 1700 | * {@inheritdoc} |
||
| 1701 | */ |
||
| 1702 | public function hasSubject() |
||
| 1706 | |||
| 1707 | /** |
||
| 1708 | * {@inheritdoc} |
||
| 1709 | */ |
||
| 1710 | public function getFormFieldDescriptions() |
||
| 1716 | |||
| 1717 | /** |
||
| 1718 | * {@inheritdoc} |
||
| 1719 | */ |
||
| 1720 | public function getFormFieldDescription($name) |
||
| 1724 | |||
| 1725 | /** |
||
| 1726 | * Returns true if the admin has a FieldDescription with the given $name. |
||
| 1727 | * |
||
| 1728 | * @param string $name |
||
| 1729 | * |
||
| 1730 | * @return bool |
||
| 1731 | */ |
||
| 1732 | public function hasFormFieldDescription($name) |
||
| 1736 | |||
| 1737 | /** |
||
| 1738 | * {@inheritdoc} |
||
| 1739 | */ |
||
| 1740 | public function addFormFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1744 | |||
| 1745 | /** |
||
| 1746 | * remove a FieldDescription. |
||
| 1747 | * |
||
| 1748 | * @param string $name |
||
| 1749 | */ |
||
| 1750 | public function removeFormFieldDescription($name) |
||
| 1754 | |||
| 1755 | /** |
||
| 1756 | * build and return the collection of form FieldDescription. |
||
| 1757 | * |
||
| 1758 | * @return array collection of form FieldDescription |
||
| 1759 | */ |
||
| 1760 | public function getShowFieldDescriptions() |
||
| 1766 | |||
| 1767 | /** |
||
| 1768 | * Returns the form FieldDescription with the given $name. |
||
| 1769 | * |
||
| 1770 | * @param string $name |
||
| 1771 | * |
||
| 1772 | * @return FieldDescriptionInterface |
||
| 1773 | */ |
||
| 1774 | public function getShowFieldDescription($name) |
||
| 1780 | |||
| 1781 | /** |
||
| 1782 | * {@inheritdoc} |
||
| 1783 | */ |
||
| 1784 | public function hasShowFieldDescription($name) |
||
| 1788 | |||
| 1789 | /** |
||
| 1790 | * {@inheritdoc} |
||
| 1791 | */ |
||
| 1792 | public function addShowFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1796 | |||
| 1797 | /** |
||
| 1798 | * {@inheritdoc} |
||
| 1799 | */ |
||
| 1800 | public function removeShowFieldDescription($name) |
||
| 1804 | |||
| 1805 | /** |
||
| 1806 | * {@inheritdoc} |
||
| 1807 | */ |
||
| 1808 | public function getListFieldDescriptions() |
||
| 1814 | |||
| 1815 | /** |
||
| 1816 | * {@inheritdoc} |
||
| 1817 | */ |
||
| 1818 | public function getListFieldDescription($name) |
||
| 1822 | |||
| 1823 | /** |
||
| 1824 | * {@inheritdoc} |
||
| 1825 | */ |
||
| 1826 | public function hasListFieldDescription($name) |
||
| 1832 | |||
| 1833 | /** |
||
| 1834 | * {@inheritdoc} |
||
| 1835 | */ |
||
| 1836 | public function addListFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1840 | |||
| 1841 | /** |
||
| 1842 | * {@inheritdoc} |
||
| 1843 | */ |
||
| 1844 | public function removeListFieldDescription($name) |
||
| 1848 | |||
| 1849 | /** |
||
| 1850 | * {@inheritdoc} |
||
| 1851 | */ |
||
| 1852 | public function getFilterFieldDescription($name) |
||
| 1856 | |||
| 1857 | /** |
||
| 1858 | * {@inheritdoc} |
||
| 1859 | */ |
||
| 1860 | public function hasFilterFieldDescription($name) |
||
| 1864 | |||
| 1865 | /** |
||
| 1866 | * {@inheritdoc} |
||
| 1867 | */ |
||
| 1868 | public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription) |
||
| 1872 | |||
| 1873 | /** |
||
| 1874 | * {@inheritdoc} |
||
| 1875 | */ |
||
| 1876 | public function removeFilterFieldDescription($name) |
||
| 1880 | |||
| 1881 | /** |
||
| 1882 | * {@inheritdoc} |
||
| 1883 | */ |
||
| 1884 | public function getFilterFieldDescriptions() |
||
| 1890 | |||
| 1891 | /** |
||
| 1892 | * {@inheritdoc} |
||
| 1893 | */ |
||
| 1894 | public function addChild(AdminInterface $child) |
||
| 1901 | |||
| 1902 | /** |
||
| 1903 | * {@inheritdoc} |
||
| 1904 | */ |
||
| 1905 | public function hasChild($code) |
||
| 1909 | |||
| 1910 | /** |
||
| 1911 | * {@inheritdoc} |
||
| 1912 | */ |
||
| 1913 | public function getChildren() |
||
| 1917 | |||
| 1918 | /** |
||
| 1919 | * {@inheritdoc} |
||
| 1920 | */ |
||
| 1921 | public function getChild($code) |
||
| 1925 | |||
| 1926 | /** |
||
| 1927 | * {@inheritdoc} |
||
| 1928 | */ |
||
| 1929 | public function setParent(AdminInterface $parent) |
||
| 1933 | |||
| 1934 | /** |
||
| 1935 | * {@inheritdoc} |
||
| 1936 | */ |
||
| 1937 | public function getParent() |
||
| 1941 | |||
| 1942 | /** |
||
| 1943 | * {@inheritdoc} |
||
| 1944 | */ |
||
| 1945 | public function isChild() |
||
| 1949 | |||
| 1950 | /** |
||
| 1951 | * Returns true if the admin has children, false otherwise. |
||
| 1952 | * |
||
| 1953 | * @return bool if the admin has children |
||
| 1954 | */ |
||
| 1955 | public function hasChildren() |
||
| 1959 | |||
| 1960 | /** |
||
| 1961 | * {@inheritdoc} |
||
| 1962 | */ |
||
| 1963 | public function setUniqid($uniqid) |
||
| 1967 | |||
| 1968 | /** |
||
| 1969 | * {@inheritdoc} |
||
| 1970 | */ |
||
| 1971 | public function getUniqid() |
||
| 1979 | |||
| 1980 | /** |
||
| 1981 | * Returns the classname label. |
||
| 1982 | * |
||
| 1983 | * @return string the classname label |
||
| 1984 | */ |
||
| 1985 | public function getClassnameLabel() |
||
| 1989 | |||
| 1990 | /** |
||
| 1991 | * {@inheritdoc} |
||
| 1992 | */ |
||
| 1993 | public function getPersistentParameters() |
||
| 2009 | |||
| 2010 | /** |
||
| 2011 | * @param string $name |
||
| 2012 | * |
||
| 2013 | * @return null|mixed |
||
| 2014 | */ |
||
| 2015 | public function getPersistentParameter($name) |
||
| 2021 | |||
| 2022 | /** |
||
| 2023 | * {@inheritdoc} |
||
| 2024 | */ |
||
| 2025 | public function getBreadcrumbs($action) |
||
| 2035 | |||
| 2036 | /** |
||
| 2037 | * Generates the breadcrumbs array. |
||
| 2038 | * |
||
| 2039 | * Note: the method will be called by the top admin instance (parent => child) |
||
| 2040 | * |
||
| 2041 | * @param string $action |
||
| 2042 | * @param ItemInterface|null $menu |
||
| 2043 | * |
||
| 2044 | * @return array |
||
| 2045 | */ |
||
| 2046 | public function buildBreadcrumbs($action, MenuItemInterface $menu = null) |
||
| 2060 | |||
| 2061 | /** |
||
| 2062 | * NEXT_MAJOR : remove this method. |
||
| 2063 | * |
||
| 2064 | * @return BreadcrumbsBuilderInterface |
||
| 2065 | */ |
||
| 2066 | final public function getBreadcrumbsBuilder() |
||
| 2081 | |||
| 2082 | /** |
||
| 2083 | * NEXT_MAJOR : remove this method. |
||
| 2084 | * |
||
| 2085 | * @param BreadcrumbsBuilderInterface |
||
| 2086 | * |
||
| 2087 | * @return AbstractAdmin |
||
| 2088 | */ |
||
| 2089 | final public function setBreadcrumbsBuilder(BreadcrumbsBuilderInterface $value) |
||
| 2100 | |||
| 2101 | /** |
||
| 2102 | * {@inheritdoc} |
||
| 2103 | */ |
||
| 2104 | public function setCurrentChild($currentChild) |
||
| 2108 | |||
| 2109 | /** |
||
| 2110 | * {@inheritdoc} |
||
| 2111 | */ |
||
| 2112 | public function getCurrentChild() |
||
| 2116 | |||
| 2117 | /** |
||
| 2118 | * Returns the current child admin instance. |
||
| 2119 | * |
||
| 2120 | * @return AdminInterface|null the current child admin instance |
||
| 2121 | */ |
||
| 2122 | public function getCurrentChildAdmin() |
||
| 2132 | |||
| 2133 | /** |
||
| 2134 | * {@inheritdoc} |
||
| 2135 | */ |
||
| 2136 | public function trans($id, array $parameters = array(), $domain = null, $locale = null) |
||
| 2147 | |||
| 2148 | /** |
||
| 2149 | * Translate a message id. |
||
| 2150 | * |
||
| 2151 | * NEXT_MAJOR: remove this method |
||
| 2152 | * |
||
| 2153 | * @param string $id |
||
| 2154 | * @param int $count |
||
| 2155 | * @param array $parameters |
||
| 2156 | * @param string|null $domain |
||
| 2157 | * @param string|null $locale |
||
| 2158 | * |
||
| 2159 | * @return string the translated string |
||
| 2160 | * |
||
| 2161 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 2162 | */ |
||
| 2163 | public function transChoice($id, $count, array $parameters = array(), $domain = null, $locale = null) |
||
| 2174 | |||
| 2175 | /** |
||
| 2176 | * {@inheritdoc} |
||
| 2177 | */ |
||
| 2178 | public function setTranslationDomain($translationDomain) |
||
| 2182 | |||
| 2183 | /** |
||
| 2184 | * {@inheritdoc} |
||
| 2185 | */ |
||
| 2186 | public function getTranslationDomain() |
||
| 2190 | |||
| 2191 | /** |
||
| 2192 | * {@inheritdoc} |
||
| 2193 | * |
||
| 2194 | * NEXT_MAJOR: remove this method |
||
| 2195 | * |
||
| 2196 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 2197 | */ |
||
| 2198 | public function setTranslator(TranslatorInterface $translator) |
||
| 2210 | |||
| 2211 | /** |
||
| 2212 | * {@inheritdoc} |
||
| 2213 | * |
||
| 2214 | * NEXT_MAJOR: remove this method |
||
| 2215 | * |
||
| 2216 | * @deprecated since 3.9, to be removed with 4.0 |
||
| 2217 | */ |
||
| 2218 | public function getTranslator() |
||
| 2227 | |||
| 2228 | /** |
||
| 2229 | * {@inheritdoc} |
||
| 2230 | */ |
||
| 2231 | public function getTranslationLabel($label, $context = '', $type = '') |
||
| 2235 | |||
| 2236 | /** |
||
| 2237 | * {@inheritdoc} |
||
| 2238 | */ |
||
| 2239 | public function setRequest(Request $request) |
||
| 2247 | |||
| 2248 | /** |
||
| 2249 | * {@inheritdoc} |
||
| 2250 | */ |
||
| 2251 | public function getRequest() |
||
| 2259 | |||
| 2260 | /** |
||
| 2261 | * {@inheritdoc} |
||
| 2262 | */ |
||
| 2263 | public function hasRequest() |
||
| 2267 | |||
| 2268 | /** |
||
| 2269 | * {@inheritdoc} |
||
| 2270 | */ |
||
| 2271 | public function setFormContractor(FormContractorInterface $formBuilder) |
||
| 2275 | |||
| 2276 | /** |
||
| 2277 | * @return FormContractorInterface |
||
| 2278 | */ |
||
| 2279 | public function getFormContractor() |
||
| 2283 | |||
| 2284 | /** |
||
| 2285 | * {@inheritdoc} |
||
| 2286 | */ |
||
| 2287 | public function setDatagridBuilder(DatagridBuilderInterface $datagridBuilder) |
||
| 2291 | |||
| 2292 | /** |
||
| 2293 | * {@inheritdoc} |
||
| 2294 | */ |
||
| 2295 | public function getDatagridBuilder() |
||
| 2299 | |||
| 2300 | /** |
||
| 2301 | * {@inheritdoc} |
||
| 2302 | */ |
||
| 2303 | public function setListBuilder(ListBuilderInterface $listBuilder) |
||
| 2307 | |||
| 2308 | /** |
||
| 2309 | * {@inheritdoc} |
||
| 2310 | */ |
||
| 2311 | public function getListBuilder() |
||
| 2315 | |||
| 2316 | /** |
||
| 2317 | * @param ShowBuilderInterface $showBuilder |
||
| 2318 | */ |
||
| 2319 | public function setShowBuilder(ShowBuilderInterface $showBuilder) |
||
| 2323 | |||
| 2324 | /** |
||
| 2325 | * @return ShowBuilderInterface |
||
| 2326 | */ |
||
| 2327 | public function getShowBuilder() |
||
| 2331 | |||
| 2332 | /** |
||
| 2333 | * {@inheritdoc} |
||
| 2334 | */ |
||
| 2335 | public function setConfigurationPool(Pool $configurationPool) |
||
| 2339 | |||
| 2340 | /** |
||
| 2341 | * @return Pool |
||
| 2342 | */ |
||
| 2343 | public function getConfigurationPool() |
||
| 2347 | |||
| 2348 | /** |
||
| 2349 | * {@inheritdoc} |
||
| 2350 | */ |
||
| 2351 | public function setRouteGenerator(RouteGeneratorInterface $routeGenerator) |
||
| 2355 | |||
| 2356 | /** |
||
| 2357 | * @return RouteGeneratorInterface |
||
| 2358 | */ |
||
| 2359 | public function getRouteGenerator() |
||
| 2363 | |||
| 2364 | /** |
||
| 2365 | * {@inheritdoc} |
||
| 2366 | */ |
||
| 2367 | public function getCode() |
||
| 2371 | |||
| 2372 | /** |
||
| 2373 | * @param string $baseCodeRoute |
||
| 2374 | */ |
||
| 2375 | public function setBaseCodeRoute($baseCodeRoute) |
||
| 2379 | |||
| 2380 | /** |
||
| 2381 | * {@inheritdoc} |
||
| 2382 | */ |
||
| 2383 | public function getBaseCodeRoute() |
||
| 2387 | |||
| 2388 | /** |
||
| 2389 | * {@inheritdoc} |
||
| 2390 | */ |
||
| 2391 | public function getModelManager() |
||
| 2395 | |||
| 2396 | /** |
||
| 2397 | * @param ModelManagerInterface $modelManager |
||
| 2398 | */ |
||
| 2399 | public function setModelManager(ModelManagerInterface $modelManager) |
||
| 2403 | |||
| 2404 | /** |
||
| 2405 | * {@inheritdoc} |
||
| 2406 | */ |
||
| 2407 | public function getManagerType() |
||
| 2411 | |||
| 2412 | /** |
||
| 2413 | * @param string $type |
||
| 2414 | */ |
||
| 2415 | public function setManagerType($type) |
||
| 2419 | |||
| 2420 | /** |
||
| 2421 | * {@inheritdoc} |
||
| 2422 | */ |
||
| 2423 | public function getObjectIdentifier() |
||
| 2427 | |||
| 2428 | /** |
||
| 2429 | * Set the roles and permissions per role. |
||
| 2430 | * |
||
| 2431 | * @param array $information |
||
| 2432 | */ |
||
| 2433 | public function setSecurityInformation(array $information) |
||
| 2437 | |||
| 2438 | /** |
||
| 2439 | * {@inheritdoc} |
||
| 2440 | */ |
||
| 2441 | public function getSecurityInformation() |
||
| 2445 | |||
| 2446 | /** |
||
| 2447 | * Return the list of permissions the user should have in order to display the admin. |
||
| 2448 | * |
||
| 2449 | * @param string $context |
||
| 2450 | * |
||
| 2451 | * @return array |
||
| 2452 | */ |
||
| 2453 | public function getPermissionsShow($context) |
||
| 2462 | |||
| 2463 | /** |
||
| 2464 | * {@inheritdoc} |
||
| 2465 | */ |
||
| 2466 | public function showIn($context) |
||
| 2475 | |||
| 2476 | /** |
||
| 2477 | * {@inheritdoc} |
||
| 2478 | */ |
||
| 2479 | public function createObjectSecurity($object) |
||
| 2483 | |||
| 2484 | /** |
||
| 2485 | * {@inheritdoc} |
||
| 2486 | */ |
||
| 2487 | public function setSecurityHandler(SecurityHandlerInterface $securityHandler) |
||
| 2491 | |||
| 2492 | /** |
||
| 2493 | * {@inheritdoc} |
||
| 2494 | */ |
||
| 2495 | public function getSecurityHandler() |
||
| 2499 | |||
| 2500 | /** |
||
| 2501 | * {@inheritdoc} |
||
| 2502 | */ |
||
| 2503 | public function isGranted($name, $object = null) |
||
| 2513 | |||
| 2514 | /** |
||
| 2515 | * {@inheritdoc} |
||
| 2516 | */ |
||
| 2517 | public function getUrlsafeIdentifier($entity) |
||
| 2521 | |||
| 2522 | /** |
||
| 2523 | * {@inheritdoc} |
||
| 2524 | */ |
||
| 2525 | public function getNormalizedIdentifier($entity) |
||
| 2529 | |||
| 2530 | /** |
||
| 2531 | * {@inheritdoc} |
||
| 2532 | */ |
||
| 2533 | public function id($entity) |
||
| 2537 | |||
| 2538 | /** |
||
| 2539 | * {@inheritdoc} |
||
| 2540 | */ |
||
| 2541 | public function setValidator($validator) |
||
| 2553 | |||
| 2554 | /** |
||
| 2555 | * {@inheritdoc} |
||
| 2556 | */ |
||
| 2557 | public function getValidator() |
||
| 2561 | |||
| 2562 | /** |
||
| 2563 | * {@inheritdoc} |
||
| 2564 | */ |
||
| 2565 | public function getShow() |
||
| 2571 | |||
| 2572 | /** |
||
| 2573 | * {@inheritdoc} |
||
| 2574 | */ |
||
| 2575 | public function setFormTheme(array $formTheme) |
||
| 2579 | |||
| 2580 | /** |
||
| 2581 | * {@inheritdoc} |
||
| 2582 | */ |
||
| 2583 | public function getFormTheme() |
||
| 2587 | |||
| 2588 | /** |
||
| 2589 | * {@inheritdoc} |
||
| 2590 | */ |
||
| 2591 | public function setFilterTheme(array $filterTheme) |
||
| 2595 | |||
| 2596 | /** |
||
| 2597 | * {@inheritdoc} |
||
| 2598 | */ |
||
| 2599 | public function getFilterTheme() |
||
| 2603 | |||
| 2604 | /** |
||
| 2605 | * {@inheritdoc} |
||
| 2606 | */ |
||
| 2607 | public function addExtension(AdminExtensionInterface $extension) |
||
| 2611 | |||
| 2612 | /** |
||
| 2613 | * {@inheritdoc} |
||
| 2614 | */ |
||
| 2615 | public function getExtensions() |
||
| 2619 | |||
| 2620 | /** |
||
| 2621 | * {@inheritdoc} |
||
| 2622 | */ |
||
| 2623 | public function setMenuFactory(MenuFactoryInterface $menuFactory) |
||
| 2627 | |||
| 2628 | /** |
||
| 2629 | * {@inheritdoc} |
||
| 2630 | */ |
||
| 2631 | public function getMenuFactory() |
||
| 2635 | |||
| 2636 | /** |
||
| 2637 | * {@inheritdoc} |
||
| 2638 | */ |
||
| 2639 | public function setRouteBuilder(RouteBuilderInterface $routeBuilder) |
||
| 2643 | |||
| 2644 | /** |
||
| 2645 | * {@inheritdoc} |
||
| 2646 | */ |
||
| 2647 | public function getRouteBuilder() |
||
| 2651 | |||
| 2652 | /** |
||
| 2653 | * {@inheritdoc} |
||
| 2654 | */ |
||
| 2655 | public function toString($object) |
||
| 2667 | |||
| 2668 | /** |
||
| 2669 | * {@inheritdoc} |
||
| 2670 | */ |
||
| 2671 | public function setLabelTranslatorStrategy(LabelTranslatorStrategyInterface $labelTranslatorStrategy) |
||
| 2675 | |||
| 2676 | /** |
||
| 2677 | * {@inheritdoc} |
||
| 2678 | */ |
||
| 2679 | public function getLabelTranslatorStrategy() |
||
| 2683 | |||
| 2684 | /** |
||
| 2685 | * {@inheritdoc} |
||
| 2686 | */ |
||
| 2687 | public function supportsPreviewMode() |
||
| 2691 | |||
| 2692 | /** |
||
| 2693 | * Set custom per page options. |
||
| 2694 | * |
||
| 2695 | * @param array $options |
||
| 2696 | */ |
||
| 2697 | public function setPerPageOptions(array $options) |
||
| 2701 | |||
| 2702 | /** |
||
| 2703 | * Returns predefined per page options. |
||
| 2704 | * |
||
| 2705 | * @return array |
||
| 2706 | */ |
||
| 2707 | public function getPerPageOptions() |
||
| 2711 | |||
| 2712 | /** |
||
| 2713 | * Set pager type. |
||
| 2714 | * |
||
| 2715 | * @param string $pagerType |
||
| 2716 | */ |
||
| 2717 | public function setPagerType($pagerType) |
||
| 2721 | |||
| 2722 | /** |
||
| 2723 | * Get pager type. |
||
| 2724 | * |
||
| 2725 | * @return string |
||
| 2726 | */ |
||
| 2727 | public function getPagerType() |
||
| 2731 | |||
| 2732 | /** |
||
| 2733 | * Returns true if the per page value is allowed, false otherwise. |
||
| 2734 | * |
||
| 2735 | * @param int $perPage |
||
| 2736 | * |
||
| 2737 | * @return bool |
||
| 2738 | */ |
||
| 2739 | public function determinedPerPageValue($perPage) |
||
| 2743 | |||
| 2744 | /** |
||
| 2745 | * {@inheritdoc} |
||
| 2746 | */ |
||
| 2747 | public function isAclEnabled() |
||
| 2751 | |||
| 2752 | /** |
||
| 2753 | * {@inheritdoc} |
||
| 2754 | */ |
||
| 2755 | public function getObjectMetadata($object) |
||
| 2759 | |||
| 2760 | /** |
||
| 2761 | * {@inheritdoc} |
||
| 2762 | */ |
||
| 2763 | public function getListModes() |
||
| 2767 | |||
| 2768 | /** |
||
| 2769 | * {@inheritdoc} |
||
| 2770 | */ |
||
| 2771 | public function setListMode($mode) |
||
| 2779 | |||
| 2780 | /** |
||
| 2781 | * {@inheritdoc} |
||
| 2782 | */ |
||
| 2783 | public function getListMode() |
||
| 2791 | |||
| 2792 | /** |
||
| 2793 | * {@inheritdoc} |
||
| 2794 | */ |
||
| 2795 | public function getAccessMapping() |
||
| 2799 | |||
| 2800 | /** |
||
| 2801 | * {@inheritdoc} |
||
| 2802 | */ |
||
| 2803 | public function checkAccess($action, $object = null) |
||
| 2825 | |||
| 2826 | /** |
||
| 2827 | * Hook to handle access authorization, without throw Exception. |
||
| 2828 | * |
||
| 2829 | * @param string $action |
||
| 2830 | * @param object $object |
||
| 2831 | * |
||
| 2832 | * @return bool |
||
| 2833 | */ |
||
| 2834 | public function hasAccess($action, $object = null) |
||
| 2854 | |||
| 2855 | /** |
||
| 2856 | * {@inheritdoc} |
||
| 2857 | */ |
||
| 2858 | public function configureActionButtons($action, $object = null) |
||
| 2920 | |||
| 2921 | /** |
||
| 2922 | * @param string $action |
||
| 2923 | * @param mixed $object |
||
| 2924 | * |
||
| 2925 | * @return array |
||
| 2926 | */ |
||
| 2927 | public function getActionButtons($action, $object = null) |
||
| 2940 | |||
| 2941 | /** |
||
| 2942 | * Get the list of actions that can be accessed directly from the dashboard. |
||
| 2943 | * |
||
| 2944 | * @return array |
||
| 2945 | */ |
||
| 2946 | public function getDashboardActions() |
||
| 2971 | |||
| 2972 | /** |
||
| 2973 | * Setting to true will enable mosaic button for the admin screen. |
||
| 2974 | * Setting to false will hide mosaic button for the admin screen. |
||
| 2975 | * |
||
| 2976 | * @param bool $isShown |
||
| 2977 | */ |
||
| 2978 | final public function showMosaicButton($isShown) |
||
| 2986 | |||
| 2987 | /** |
||
| 2988 | * @param FormMapper $form |
||
| 2989 | */ |
||
| 2990 | final public function getSearchResultLink($object) |
||
| 3000 | |||
| 3001 | /** |
||
| 3002 | * Checks if a filter type is set to a default value. |
||
| 3003 | * |
||
| 3004 | * @param string $name |
||
| 3005 | * |
||
| 3006 | * @return bool |
||
| 3007 | */ |
||
| 3008 | final public function isDefaultFilter($name) |
||
| 3019 | |||
| 3020 | /** |
||
| 3021 | * Check object existence and access, without throw Exception. |
||
| 3022 | * |
||
| 3023 | * @param string $action |
||
| 3024 | * @param object $object |
||
| 3025 | * |
||
| 3026 | * @return bool |
||
| 3027 | */ |
||
| 3028 | public function canAccessObject($action, $object) |
||
| 3032 | |||
| 3033 | public function iDoNothing() |
||
| 3037 | |||
| 3038 | /** |
||
| 3039 | * Returns a list of default filters. |
||
| 3040 | * |
||
| 3041 | * @return array |
||
| 3042 | */ |
||
| 3043 | final protected function getDefaultFilterValues() |
||
| 3058 | |||
| 3059 | /** |
||
| 3060 | * {@inheritdoc} |
||
| 3061 | */ |
||
| 3062 | protected function configureFormFields(FormMapper $form) |
||
| 3065 | |||
| 3066 | /** |
||
| 3067 | * @param ListMapper $list |
||
| 3068 | */ |
||
| 3069 | protected function configureListFields(ListMapper $list) |
||
| 3072 | |||
| 3073 | /** |
||
| 3074 | * @param DatagridMapper $filter |
||
| 3075 | */ |
||
| 3076 | protected function configureDatagridFilters(DatagridMapper $filter) |
||
| 3079 | |||
| 3080 | /** |
||
| 3081 | * @param ShowMapper $show |
||
| 3082 | */ |
||
| 3083 | protected function configureShowFields(ShowMapper $show) |
||
| 3086 | |||
| 3087 | /** |
||
| 3088 | * @param RouteCollection $collection |
||
| 3089 | */ |
||
| 3090 | protected function configureRoutes(RouteCollection $collection) |
||
| 3093 | |||
| 3094 | /** |
||
| 3095 | * Allows you to customize batch actions. |
||
| 3096 | * |
||
| 3097 | * @param array $actions List of actions |
||
| 3098 | * |
||
| 3099 | * @return array |
||
| 3100 | */ |
||
| 3101 | protected function configureBatchActions($actions) |
||
| 3105 | |||
| 3106 | /** |
||
| 3107 | * NEXT_MAJOR: remove this method. |
||
| 3108 | * |
||
| 3109 | * @param MenuItemInterface $menu |
||
| 3110 | * @param $action |
||
| 3111 | * @param AdminInterface $childAdmin |
||
| 3112 | * |
||
| 3113 | * @return mixed |
||
| 3114 | * |
||
| 3115 | * @deprecated Use configureTabMenu instead |
||
| 3116 | */ |
||
| 3117 | protected function configureSideMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null) |
||
| 3120 | |||
| 3121 | /** |
||
| 3122 | * Configures the tab menu in your admin. |
||
| 3123 | * |
||
| 3124 | * @param MenuItemInterface $menu |
||
| 3125 | * @param string $action |
||
| 3126 | * @param AdminInterface $childAdmin |
||
| 3127 | * |
||
| 3128 | * @return mixed |
||
| 3129 | */ |
||
| 3130 | protected function configureTabMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null) |
||
| 3136 | |||
| 3137 | /** |
||
| 3138 | * build the view FieldDescription array. |
||
| 3139 | */ |
||
| 3140 | protected function buildShow() |
||
| 3155 | |||
| 3156 | /** |
||
| 3157 | * build the list FieldDescription array. |
||
| 3158 | */ |
||
| 3159 | protected function buildList() |
||
| 3211 | |||
| 3212 | /** |
||
| 3213 | * Build the form FieldDescription collection. |
||
| 3214 | */ |
||
| 3215 | protected function buildForm() |
||
| 3243 | |||
| 3244 | /** |
||
| 3245 | * Gets the subclass corresponding to the given name. |
||
| 3246 | * |
||
| 3247 | * @param string $name The name of the sub class |
||
| 3248 | * |
||
| 3249 | * @return string the subclass |
||
| 3250 | */ |
||
| 3251 | protected function getSubClass($name) |
||
| 3263 | |||
| 3264 | /** |
||
| 3265 | * Attach the inline validator to the model metadata, this must be done once per admin. |
||
| 3266 | */ |
||
| 3267 | protected function attachInlineValidator() |
||
| 3299 | |||
| 3300 | /** |
||
| 3301 | * Predefine per page options. |
||
| 3302 | */ |
||
| 3303 | protected function predefinePerPageOptions() |
||
| 3309 | |||
| 3310 | /** |
||
| 3311 | * Return list routes with permissions name. |
||
| 3312 | * |
||
| 3313 | * @return array |
||
| 3314 | */ |
||
| 3315 | protected function getAccess() |
||
| 3340 | |||
| 3341 | /** |
||
| 3342 | * Returns a list of default filters. |
||
| 3343 | * |
||
| 3344 | * @param array $filterValues |
||
| 3345 | */ |
||
| 3346 | protected function configureDefaultFilterValues(array &$filterValues) |
||
| 3349 | |||
| 3350 | /** |
||
| 3351 | * Build all the related urls to the current admin. |
||
| 3352 | */ |
||
| 3353 | private function buildRoutes() |
||
| 3376 | } |
||
| 3377 |
This check marks private properties in classes that are never used. Those properties can be removed.