AdminInterface.php 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\AdminBundle\Admin;
  11. use Knp\Menu\FactoryInterface as MenuFactoryInterface;
  12. use Knp\Menu\ItemInterface;
  13. use Sonata\AdminBundle\Builder\DatagridBuilderInterface;
  14. use Sonata\AdminBundle\Builder\FormContractorInterface;
  15. use Sonata\AdminBundle\Builder\ListBuilderInterface;
  16. use Sonata\AdminBundle\Builder\RouteBuilderInterface;
  17. use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
  18. use Sonata\AdminBundle\Route\RouteCollection;
  19. use Sonata\AdminBundle\Route\RouteGeneratorInterface;
  20. use Sonata\AdminBundle\Security\Handler\SecurityHandlerInterface;
  21. use Sonata\AdminBundle\Translator\LabelTranslatorStrategyInterface;
  22. use Sonata\CoreBundle\Model\Metadata;
  23. use Sonata\CoreBundle\Validator\ErrorElement;
  24. use Symfony\Component\Form\Form;
  25. use Symfony\Component\Form\FormBuilderInterface;
  26. use Symfony\Component\HttpFoundation\Request;
  27. use Symfony\Component\Translation\TranslatorInterface;
  28. use Symfony\Component\Validator\Validator\ValidatorInterface;
  29. use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface;
  30. /**
  31. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  32. */
  33. interface AdminInterface
  34. {
  35. /**
  36. * @param FormContractorInterface $formContractor
  37. */
  38. public function setFormContractor(FormContractorInterface $formContractor);
  39. /**
  40. * Set ListBuilder.
  41. *
  42. * @param ListBuilderInterface $listBuilder
  43. */
  44. public function setListBuilder(ListBuilderInterface $listBuilder);
  45. /**
  46. * Get ListBuilder.
  47. *
  48. * @return ListBuilderInterface
  49. */
  50. public function getListBuilder();
  51. /**
  52. * Set DatagridBuilder.
  53. *
  54. * @param DatagridBuilderInterface $datagridBuilder
  55. */
  56. public function setDatagridBuilder(DatagridBuilderInterface $datagridBuilder);
  57. /**
  58. * Get DatagridBuilder.
  59. *
  60. * @return DatagridBuilderInterface
  61. */
  62. public function getDatagridBuilder();
  63. /**
  64. * Set translator.
  65. *
  66. * @param TranslatorInterface $translator
  67. */
  68. public function setTranslator(TranslatorInterface $translator);
  69. /**
  70. * Get translator.
  71. *
  72. * @return TranslatorInterface
  73. */
  74. public function getTranslator();
  75. /**
  76. * @param Request $request
  77. */
  78. public function setRequest(Request $request);
  79. /**
  80. * @param Pool $pool
  81. */
  82. public function setConfigurationPool(Pool $pool);
  83. /**
  84. * @param RouteGeneratorInterface $routeGenerator
  85. */
  86. public function setRouteGenerator(RouteGeneratorInterface $routeGenerator);
  87. /**
  88. * Returns subjectClass/class/subclass name managed
  89. * - subclass name if subclass parameter is defined
  90. * - subject class name if subject is defined
  91. * - class name if not.
  92. *
  93. * @return string
  94. */
  95. public function getClass();
  96. /**
  97. * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
  98. */
  99. public function attachAdminClass(FieldDescriptionInterface $fieldDescription);
  100. /**
  101. * @return \Sonata\AdminBundle\Datagrid\DatagridInterface
  102. */
  103. public function getDatagrid();
  104. /**
  105. * Set base controller name.
  106. *
  107. * @param string $baseControllerName
  108. */
  109. public function setBaseControllerName($baseControllerName);
  110. /**
  111. * Get base controller name.
  112. *
  113. * @return string
  114. */
  115. public function getBaseControllerName();
  116. /**
  117. * Generates the object url with the given $name.
  118. *
  119. * @param string $name
  120. * @param mixed $object
  121. * @param array $parameters
  122. * @param bool $absolute
  123. *
  124. * @return string return a complete url
  125. */
  126. public function generateObjectUrl($name, $object, array $parameters = array(), $absolute = false);
  127. /**
  128. * Generates an url for the given parameters.
  129. *
  130. * @param string $name
  131. * @param array $parameters
  132. * @param bool $absolute
  133. *
  134. * @return string return a complete url
  135. */
  136. public function generateUrl($name, array $parameters = array(), $absolute = false);
  137. /**
  138. * Generates an url for the given parameters.
  139. *
  140. * @param string $name
  141. * @param array $parameters
  142. * @param bool $absolute
  143. *
  144. * @return array return url parts: 'route', 'routeParameters', 'routeAbsolute'
  145. */
  146. public function generateMenuUrl($name, array $parameters = array(), $absolute = false);
  147. /**
  148. * @return \Sonata\AdminBundle\Model\ModelManagerInterface
  149. */
  150. public function getModelManager();
  151. /**
  152. * @return string the manager type of the admin
  153. */
  154. public function getManagerType();
  155. /**
  156. * @param string $context NEXT_MAJOR: remove this argument
  157. *
  158. * @return ProxyQueryInterface
  159. */
  160. public function createQuery($context = 'list');
  161. /**
  162. * @return FormBuilderInterface the form builder
  163. */
  164. public function getFormBuilder();
  165. /**
  166. * Return FormFieldDescription.
  167. *
  168. * @param string $name
  169. *
  170. * @return FieldDescriptionInterface
  171. */
  172. public function getFormFieldDescription($name);
  173. /**
  174. * Build and return the collection of form FieldDescription.
  175. *
  176. * @return array collection of form FieldDescription
  177. */
  178. public function getFormFieldDescriptions();
  179. /**
  180. * Returns a form depend on the given $object.
  181. *
  182. * @return Form
  183. */
  184. public function getForm();
  185. /**
  186. * @return Request
  187. *
  188. * @throws \RuntimeException if no request is set
  189. */
  190. public function getRequest();
  191. /**
  192. * @return bool true if a request object is linked to this Admin, false
  193. * otherwise
  194. */
  195. public function hasRequest();
  196. /**
  197. * @return string
  198. */
  199. public function getCode();
  200. /**
  201. * @return string
  202. */
  203. public function getBaseCodeRoute();
  204. /**
  205. * Return the roles and permissions per role
  206. * - different permissions per role for the acl handler
  207. * - one permission that has the same name as the role for the role handler
  208. * This should be used by experimented users.
  209. *
  210. * @return array [role] => array([permission], [permission])
  211. */
  212. public function getSecurityInformation();
  213. /**
  214. * @param FieldDescriptionInterface $parentFieldDescription
  215. */
  216. public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription);
  217. /**
  218. * Get parent field description.
  219. *
  220. * @return FieldDescriptionInterface The parent field description
  221. */
  222. public function getParentFieldDescription();
  223. /**
  224. * Returns true if the Admin is linked to a parent FieldDescription.
  225. *
  226. * @return bool
  227. */
  228. public function hasParentFieldDescription();
  229. /**
  230. * translate a message id.
  231. *
  232. * NEXT_MAJOR: remove this method
  233. *
  234. * @param string $id
  235. * @param array $parameters
  236. * @param null $domain
  237. * @param null $locale
  238. *
  239. * @return string the translated string
  240. *
  241. * @deprecated since 3.9, to be removed in 4.0
  242. */
  243. public function trans($id, array $parameters = array(), $domain = null, $locale = null);
  244. /**
  245. * Returns the list of available urls.
  246. *
  247. * @return RouteCollection the list of available urls
  248. */
  249. public function getRoutes();
  250. /**
  251. * Return the parameter name used to represent the id in the url.
  252. *
  253. * @return string
  254. */
  255. public function getRouterIdParameter();
  256. /**
  257. * Returns the parameter representing request id, ie: id or childId.
  258. *
  259. * @return string
  260. */
  261. public function getIdParameter();
  262. /**
  263. * Returns true if the route $name is available.
  264. *
  265. * @param string $name
  266. *
  267. * @return bool
  268. */
  269. public function hasRoute($name);
  270. /**
  271. * Check the current request is given route or not.
  272. *
  273. * TODO: uncomment this method before releasing 4.0
  274. *
  275. * ```
  276. * $this->isCurrentRoute('create'); // is create page?
  277. * $this->isCurrentRoute('edit', 'some.admin.code'); // is some.admin.code admin's edit page?
  278. * ```
  279. *
  280. * @param string $name
  281. * @param string $adminCode
  282. *
  283. * @return bool
  284. */
  285. // public function isCurrentRoute($name, $adminCode = null);
  286. /**
  287. * Returns true if the admin has a FieldDescription with the given $name.
  288. *
  289. * @param string $name
  290. *
  291. * @return bool
  292. */
  293. public function hasShowFieldDescription($name);
  294. /**
  295. * add a FieldDescription.
  296. *
  297. * @param string $name
  298. * @param FieldDescriptionInterface $fieldDescription
  299. */
  300. public function addShowFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  301. /**
  302. * Remove a ShowFieldDescription.
  303. *
  304. * @param string $name
  305. */
  306. public function removeShowFieldDescription($name);
  307. /**
  308. * add a list FieldDescription.
  309. *
  310. * @param string $name
  311. * @param FieldDescriptionInterface $fieldDescription
  312. */
  313. public function addListFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  314. /**
  315. * Remove a list FieldDescription.
  316. *
  317. * @param string $name
  318. */
  319. public function removeListFieldDescription($name);
  320. /**
  321. * Returns true if the filter FieldDescription exists.
  322. *
  323. * @param string $name
  324. *
  325. * @return bool
  326. */
  327. public function hasFilterFieldDescription($name);
  328. /**
  329. * add a filter FieldDescription.
  330. *
  331. * @param string $name
  332. * @param FieldDescriptionInterface $fieldDescription
  333. */
  334. public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  335. /**
  336. * Remove a filter FieldDescription.
  337. *
  338. * @param string $name
  339. */
  340. public function removeFilterFieldDescription($name);
  341. /**
  342. * Returns the filter FieldDescription collection.
  343. *
  344. * @return FieldDescriptionInterface[]
  345. */
  346. public function getFilterFieldDescriptions();
  347. /**
  348. * Returns a filter FieldDescription.
  349. *
  350. * @param string $name
  351. *
  352. * @return FieldDescriptionInterface|null
  353. */
  354. public function getFilterFieldDescription($name);
  355. /**
  356. * Returns a list depend on the given $object.
  357. *
  358. * @return FieldDescriptionCollection
  359. */
  360. public function getList();
  361. /**
  362. * @param SecurityHandlerInterface $securityHandler
  363. */
  364. public function setSecurityHandler(SecurityHandlerInterface $securityHandler);
  365. /**
  366. * @return SecurityHandlerInterface|null
  367. */
  368. public function getSecurityHandler();
  369. /**
  370. * @param string $name
  371. * @param object|null $object
  372. *
  373. * @return bool
  374. */
  375. public function isGranted($name, $object = null);
  376. /**
  377. * @param mixed $entity
  378. *
  379. * @return string a string representation of the id that is save to use in an url
  380. */
  381. public function getUrlsafeIdentifier($entity);
  382. /**
  383. * @param mixed $entity
  384. *
  385. * @return string a string representation of the identifiers for this instance
  386. */
  387. public function getNormalizedIdentifier($entity);
  388. /**
  389. * Shorthand method for templating.
  390. *
  391. * @param object $entity
  392. *
  393. * @return mixed
  394. */
  395. public function id($entity);
  396. /**
  397. * @param ValidatorInterface|LegacyValidatorInterface $validator
  398. */
  399. public function setValidator($validator);
  400. /**
  401. * @return ValidatorInterface|LegacyValidatorInterface
  402. */
  403. public function getValidator();
  404. /**
  405. * @return array
  406. */
  407. public function getShow();
  408. /**
  409. * @param array $formTheme
  410. */
  411. public function setFormTheme(array $formTheme);
  412. /**
  413. * @return array
  414. */
  415. public function getFormTheme();
  416. /**
  417. * @param array $filterTheme
  418. */
  419. public function setFilterTheme(array $filterTheme);
  420. /**
  421. * @return array
  422. */
  423. public function getFilterTheme();
  424. /**
  425. * @param AdminExtensionInterface $extension
  426. */
  427. public function addExtension(AdminExtensionInterface $extension);
  428. /**
  429. * Returns an array of extension related to the current Admin.
  430. *
  431. * @return AdminExtensionInterface[]
  432. */
  433. public function getExtensions();
  434. /**
  435. * @param \Knp\Menu\FactoryInterface $menuFactory
  436. */
  437. public function setMenuFactory(MenuFactoryInterface $menuFactory);
  438. /**
  439. * @return \Knp\Menu\FactoryInterface
  440. */
  441. public function getMenuFactory();
  442. /**
  443. * @param RouteBuilderInterface $routeBuilder
  444. */
  445. public function setRouteBuilder(RouteBuilderInterface $routeBuilder);
  446. /**
  447. * @return RouteBuilderInterface
  448. */
  449. public function getRouteBuilder();
  450. /**
  451. * @param mixed $object
  452. *
  453. * @return string
  454. */
  455. public function toString($object);
  456. /**
  457. * @param LabelTranslatorStrategyInterface $labelTranslatorStrategy
  458. */
  459. public function setLabelTranslatorStrategy(LabelTranslatorStrategyInterface $labelTranslatorStrategy);
  460. /**
  461. * @return LabelTranslatorStrategyInterface
  462. */
  463. public function getLabelTranslatorStrategy();
  464. /**
  465. * Returning true will enable preview mode for
  466. * the target entity and show a preview button
  467. * when editing/creating an entity.
  468. *
  469. * @return bool
  470. */
  471. public function supportsPreviewMode();
  472. /**
  473. * add an Admin child to the current one.
  474. *
  475. * @param AdminInterface $child
  476. */
  477. public function addChild(AdminInterface $child);
  478. /**
  479. * Returns true or false if an Admin child exists for the given $code.
  480. *
  481. * @param string $code Admin code
  482. *
  483. * @return bool True if child exist, false otherwise
  484. */
  485. public function hasChild($code);
  486. /**
  487. * Returns an collection of admin children.
  488. *
  489. * @return array list of Admin children
  490. */
  491. public function getChildren();
  492. /**
  493. * Returns an admin child with the given $code.
  494. *
  495. * @param string $code
  496. *
  497. * @return AdminInterface|null
  498. */
  499. public function getChild($code);
  500. /**
  501. * @return mixed a new object instance
  502. */
  503. public function getNewInstance();
  504. /**
  505. * @param string $uniqId
  506. */
  507. public function setUniqid($uniqId);
  508. /**
  509. * Returns the uniqid.
  510. *
  511. * @return int
  512. */
  513. public function getUniqid();
  514. /**
  515. * @param mixed $id
  516. *
  517. * @return mixed
  518. */
  519. public function getObject($id);
  520. /**
  521. * @param object $subject
  522. */
  523. public function setSubject($subject);
  524. /**
  525. * @return mixed
  526. */
  527. public function getSubject();
  528. /**
  529. * Returns a list FieldDescription.
  530. *
  531. * @param string $name
  532. *
  533. * @return FieldDescriptionInterface
  534. */
  535. public function getListFieldDescription($name);
  536. /**
  537. * Returns true if the list FieldDescription exists.
  538. *
  539. * @param string $name
  540. *
  541. * @return bool
  542. */
  543. public function hasListFieldDescription($name);
  544. /**
  545. * Returns the collection of list FieldDescriptions.
  546. *
  547. * @return array
  548. */
  549. public function getListFieldDescriptions();
  550. /**
  551. * Returns the array of allowed export formats.
  552. *
  553. * @return array
  554. */
  555. public function getExportFormats();
  556. /**
  557. * Returns SourceIterator.
  558. *
  559. * @return \Exporter\Source\SourceIteratorInterface
  560. */
  561. public function getDataSourceIterator();
  562. public function configure();
  563. /**
  564. * @param mixed $object
  565. *
  566. * @return mixed
  567. */
  568. public function update($object);
  569. /**
  570. * @param mixed $object
  571. *
  572. * @return mixed
  573. */
  574. public function create($object);
  575. /**
  576. * @param mixed $object
  577. */
  578. public function delete($object);
  579. //TODO: uncomment this method for 4.0
  580. // /**
  581. // * @param mixed $object
  582. // */
  583. // public function preValidate($object);
  584. /**
  585. * @param mixed $object
  586. */
  587. public function preUpdate($object);
  588. /**
  589. * @param mixed $object
  590. */
  591. public function postUpdate($object);
  592. /**
  593. * @param mixed $object
  594. */
  595. public function prePersist($object);
  596. /**
  597. * @param mixed $object
  598. */
  599. public function postPersist($object);
  600. /**
  601. * @param mixed $object
  602. */
  603. public function preRemove($object);
  604. /**
  605. * @param mixed $object
  606. */
  607. public function postRemove($object);
  608. /**
  609. * Call before the batch action, allow you to alter the query and the idx.
  610. *
  611. * @param string $actionName
  612. * @param ProxyQueryInterface $query
  613. * @param array $idx
  614. * @param bool $allElements
  615. */
  616. public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements);
  617. /**
  618. * Return array of filter parameters.
  619. *
  620. * @return array
  621. */
  622. public function getFilterParameters();
  623. /**
  624. * Return true if the Admin is related to a subject.
  625. *
  626. * @return bool
  627. */
  628. public function hasSubject();
  629. /**
  630. * NEXT_MAJOR: remove this method.
  631. *
  632. * @param ErrorElement $errorElement
  633. * @param mixed $object
  634. *
  635. * @deprecated this feature cannot be stable, use a custom validator,
  636. * the feature will be removed with Symfony 2.2
  637. */
  638. public function validate(ErrorElement $errorElement, $object);
  639. /**
  640. * @param string $context
  641. *
  642. * @return bool
  643. */
  644. public function showIn($context);
  645. /**
  646. * Add object security, fe. make the current user owner of the object.
  647. *
  648. * @param mixed $object
  649. */
  650. public function createObjectSecurity($object);
  651. /**
  652. * @return AdminInterface
  653. */
  654. public function getParent();
  655. /**
  656. * @param AdminInterface $admin
  657. */
  658. public function setParent(AdminInterface $admin);
  659. /**
  660. * Returns true if the Admin class has an Parent Admin defined.
  661. *
  662. * @return bool
  663. */
  664. public function isChild();
  665. /**
  666. * Returns template.
  667. *
  668. * @param string $name
  669. *
  670. * @return null|string
  671. */
  672. public function getTemplate($name);
  673. /**
  674. * Set the translation domain.
  675. *
  676. * @param string $translationDomain the translation domain
  677. */
  678. public function setTranslationDomain($translationDomain);
  679. /**
  680. * Returns the translation domain.
  681. *
  682. * @return string the translation domain
  683. */
  684. public function getTranslationDomain();
  685. /**
  686. * Return the form groups.
  687. *
  688. * @return array
  689. */
  690. public function getFormGroups();
  691. /**
  692. * Set the form groups.
  693. *
  694. * @param array $formGroups
  695. */
  696. public function setFormGroups(array $formGroups);
  697. public function getFormTabs();
  698. public function setFormTabs(array $formTabs);
  699. public function getShowTabs();
  700. public function setShowTabs(array $showTabs);
  701. /**
  702. * Remove a form group field.
  703. *
  704. * @param string $key
  705. */
  706. public function removeFieldFromFormGroup($key);
  707. /**
  708. * Returns the show groups.
  709. *
  710. * @return array
  711. */
  712. public function getShowGroups();
  713. /**
  714. * Set the show groups.
  715. *
  716. * @param array $showGroups
  717. */
  718. public function setShowGroups(array $showGroups);
  719. /**
  720. * Reorder items in showGroup.
  721. *
  722. * @param string $group
  723. * @param array $keys
  724. */
  725. public function reorderShowGroup($group, array $keys);
  726. /**
  727. * add a FieldDescription.
  728. *
  729. * @param string $name
  730. * @param FieldDescriptionInterface $fieldDescription
  731. */
  732. public function addFormFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  733. /**
  734. * Remove a FieldDescription.
  735. *
  736. * @param string $name
  737. */
  738. public function removeFormFieldDescription($name);
  739. /**
  740. * Returns true if this admin uses ACL.
  741. *
  742. * @return bool
  743. */
  744. public function isAclEnabled();
  745. /**
  746. * Sets the list of supported sub classes.
  747. *
  748. * @param array $subClasses the list of sub classes
  749. */
  750. public function setSubClasses(array $subClasses);
  751. /**
  752. * Returns true if the admin has the sub classes.
  753. *
  754. * @param string $name The name of the sub class
  755. *
  756. * @return bool
  757. */
  758. public function hasSubClass($name);
  759. /**
  760. * Returns true if a subclass is currently active.
  761. *
  762. * @return bool
  763. */
  764. public function hasActiveSubClass();
  765. /**
  766. * Returns the currently active sub class.
  767. *
  768. * @return string the active sub class
  769. */
  770. public function getActiveSubClass();
  771. /**
  772. * Returns the currently active sub class code.
  773. *
  774. * @return string the code for active sub class
  775. */
  776. public function getActiveSubclassCode();
  777. /**
  778. * Returns the list of batchs actions.
  779. *
  780. * @return array the list of batchs actions
  781. */
  782. public function getBatchActions();
  783. /**
  784. * Returns Admin`s label.
  785. *
  786. * @return string
  787. */
  788. public function getLabel();
  789. /**
  790. * Returns an array of persistent parameters.
  791. *
  792. * @return array
  793. */
  794. public function getPersistentParameters();
  795. /**
  796. * NEXT_MAJOR: remove this signature
  797. * Get breadcrumbs for $action.
  798. *
  799. * @param string $action
  800. *
  801. * @return mixed array|Traversable
  802. */
  803. public function getBreadcrumbs($action);
  804. /**
  805. * Set the current child status.
  806. *
  807. * @param bool $currentChild
  808. */
  809. public function setCurrentChild($currentChild);
  810. /**
  811. * Returns the current child status.
  812. *
  813. * @return bool
  814. */
  815. public function getCurrentChild();
  816. /**
  817. * Get translation label using the current TranslationStrategy.
  818. *
  819. * @param string $label
  820. * @param string $context
  821. * @param string $type
  822. *
  823. * @return string
  824. */
  825. public function getTranslationLabel($label, $context = '', $type = '');
  826. /**
  827. * NEXT_MAJOR: remove this method.
  828. *
  829. * @param string $action
  830. * @param AdminInterface $childAdmin
  831. *
  832. * @return ItemInterface|bool
  833. *
  834. * @deprecated Use buildTabMenu instead
  835. */
  836. public function buildSideMenu($action, AdminInterface $childAdmin = null);
  837. /**
  838. * Build the tab menu related to the current action.
  839. *
  840. * @param string $action
  841. * @param AdminInterface $childAdmin
  842. *
  843. * @return ItemInterface|bool
  844. */
  845. public function buildTabMenu($action, AdminInterface $childAdmin = null);
  846. /**
  847. * @param $object
  848. *
  849. * @return Metadata
  850. */
  851. public function getObjectMetadata($object);
  852. /**
  853. * @return array
  854. */
  855. public function getListModes();
  856. /**
  857. * @param string $mode
  858. */
  859. public function setListMode($mode);
  860. /**
  861. * return the list mode.
  862. *
  863. * @return string
  864. */
  865. public function getListMode();
  866. /**
  867. * Return the controller access mapping.
  868. *
  869. * @return array
  870. */
  871. public function getAccessMapping();
  872. /**
  873. * Hook to handle access authorization.
  874. *
  875. * @param string $action
  876. * @param object $object
  877. */
  878. public function checkAccess($action, $object = null);
  879. /*
  880. * Configure buttons for an action
  881. *
  882. * @param string $action
  883. * @param object $object
  884. *
  885. */
  886. // public function configureActionButtons($action, $object = null);
  887. // TODO: uncomment this method for next major release
  888. // /**
  889. // * Hook to handle access authorization, without throw Exception
  890. // *
  891. // * @param string $action
  892. // * @param object $object
  893. // *
  894. // * @return bool
  895. // */
  896. // public function hasAccess($action, $object = null);
  897. //TODO: uncomment this method for 4.0
  898. /*
  899. * Returns the result link for an object.
  900. *
  901. * @param mixed $object
  902. *
  903. * @return string|null
  904. */
  905. //public function getSearchResultLink($object)
  906. // TODO: uncomment this method in 4.0
  907. // /**
  908. // * Setting to true will enable mosaic button for the admin screen.
  909. // * Setting to false will hide mosaic button for the admin screen.
  910. // *
  911. // * @param bool $isShown
  912. // */
  913. // public function showMosaicButton($isShown);
  914. /*
  915. * Checks if a filter type is set to a default value
  916. *
  917. * @param string $name
  918. *
  919. * @return bool
  920. */
  921. // NEXT_MAJOR: uncomment this method in 4.0
  922. // public function isDefaultFilter($name);
  923. }