AdminInterface.php 23 KB

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