AdminInterface.php 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  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. public function configure();
  545. /**
  546. * @param mixed $object
  547. *
  548. * @return mixed
  549. */
  550. public function update($object);
  551. /**
  552. * @param mixed $object
  553. *
  554. * @return mixed
  555. */
  556. public function create($object);
  557. /**
  558. * @param mixed $object
  559. */
  560. public function delete($object);
  561. //TODO: uncomment this method for 4.0
  562. // /**
  563. // * @param mixed $object
  564. // */
  565. // public function preValidate($object);
  566. /**
  567. * @param mixed $object
  568. */
  569. public function preUpdate($object);
  570. /**
  571. * @param mixed $object
  572. */
  573. public function postUpdate($object);
  574. /**
  575. * @param mixed $object
  576. */
  577. public function prePersist($object);
  578. /**
  579. * @param mixed $object
  580. */
  581. public function postPersist($object);
  582. /**
  583. * @param mixed $object
  584. */
  585. public function preRemove($object);
  586. /**
  587. * @param mixed $object
  588. */
  589. public function postRemove($object);
  590. /**
  591. * Call before the batch action, allow you to alter the query and the idx.
  592. *
  593. * @param string $actionName
  594. * @param ProxyQueryInterface $query
  595. * @param array $idx
  596. * @param bool $allElements
  597. */
  598. public function preBatchAction($actionName, ProxyQueryInterface $query, array &$idx, $allElements);
  599. /**
  600. * Return array of filter parameters.
  601. *
  602. * @return array
  603. */
  604. public function getFilterParameters();
  605. /**
  606. * Return true if the Admin is related to a subject.
  607. *
  608. * @return bool
  609. */
  610. public function hasSubject();
  611. /**
  612. * @param ErrorElement $errorElement
  613. * @param mixed $object
  614. *
  615. * @deprecated this feature cannot be stable, use a custom validator,
  616. * the feature will be removed with Symfony 2.2
  617. */
  618. public function validate(ErrorElement $errorElement, $object);
  619. /**
  620. * @param string $context
  621. *
  622. * @return bool
  623. */
  624. public function showIn($context);
  625. /**
  626. * Add object security, fe. make the current user owner of the object.
  627. *
  628. * @param mixed $object
  629. */
  630. public function createObjectSecurity($object);
  631. /**
  632. * @return AdminInterface
  633. */
  634. public function getParent();
  635. /**
  636. * @param AdminInterface $admin
  637. */
  638. public function setParent(AdminInterface $admin);
  639. /**
  640. * Returns true if the Admin class has an Parent Admin defined.
  641. *
  642. * @return bool
  643. */
  644. public function isChild();
  645. /**
  646. * Returns template.
  647. *
  648. * @param string $name
  649. *
  650. * @return null|string
  651. */
  652. public function getTemplate($name);
  653. /**
  654. * Set the translation domain.
  655. *
  656. * @param string $translationDomain the translation domain
  657. */
  658. public function setTranslationDomain($translationDomain);
  659. /**
  660. * Returns the translation domain.
  661. *
  662. * @return string the translation domain
  663. */
  664. public function getTranslationDomain();
  665. /**
  666. * Return the form groups.
  667. *
  668. * @return array
  669. */
  670. public function getFormGroups();
  671. /**
  672. * Set the form groups.
  673. *
  674. * @param array $formGroups
  675. */
  676. public function setFormGroups(array $formGroups);
  677. /**
  678. * {@inheritdoc}
  679. */
  680. public function getFormTabs();
  681. /**
  682. * {@inheritdoc}
  683. */
  684. public function setFormTabs(array $formTabs);
  685. /**
  686. * {@inheritdoc}
  687. */
  688. public function getShowTabs();
  689. /**
  690. * {@inheritdoc}
  691. */
  692. public function setShowTabs(array $showTabs);
  693. /**
  694. * Remove a form group field.
  695. *
  696. * @param string $key
  697. */
  698. public function removeFieldFromFormGroup($key);
  699. /**
  700. * Returns the show groups.
  701. *
  702. * @return array
  703. */
  704. public function getShowGroups();
  705. /**
  706. * Set the show groups.
  707. *
  708. * @param array $showGroups
  709. */
  710. public function setShowGroups(array $showGroups);
  711. /**
  712. * Reorder items in showGroup.
  713. *
  714. * @param string $group
  715. * @param array $keys
  716. */
  717. public function reorderShowGroup($group, array $keys);
  718. /**
  719. * add a FieldDescription.
  720. *
  721. * @param string $name
  722. * @param FieldDescriptionInterface $fieldDescription
  723. */
  724. public function addFormFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  725. /**
  726. * Remove a FieldDescription.
  727. *
  728. * @param string $name
  729. */
  730. public function removeFormFieldDescription($name);
  731. /**
  732. * Returns true if this admin uses ACL.
  733. *
  734. * @return bool
  735. */
  736. public function isAclEnabled();
  737. /**
  738. * Sets the list of supported sub classes.
  739. *
  740. * @param array $subClasses the list of sub classes
  741. */
  742. public function setSubClasses(array $subClasses);
  743. /**
  744. * Returns true if the admin has the sub classes.
  745. *
  746. * @param string $name The name of the sub class
  747. *
  748. * @return bool
  749. */
  750. public function hasSubClass($name);
  751. /**
  752. * Returns true if a subclass is currently active.
  753. *
  754. * @return bool
  755. */
  756. public function hasActiveSubClass();
  757. /**
  758. * Returns the currently active sub class.
  759. *
  760. * @return string the active sub class
  761. */
  762. public function getActiveSubClass();
  763. /**
  764. * Returns the currently active sub class code.
  765. *
  766. * @return string the code for active sub class
  767. */
  768. public function getActiveSubclassCode();
  769. /**
  770. * Returns the list of batchs actions.
  771. *
  772. * @return array the list of batchs actions
  773. */
  774. public function getBatchActions();
  775. /**
  776. * Returns Admin`s label.
  777. *
  778. * @return string
  779. */
  780. public function getLabel();
  781. /**
  782. * Returns an array of persistent parameters.
  783. *
  784. * @return array
  785. */
  786. public function getPersistentParameters();
  787. /**
  788. * Get breadcrumbs for $action.
  789. *
  790. * @param string $action
  791. *
  792. * @return array
  793. */
  794. public function getBreadcrumbs($action);
  795. /**
  796. * Set the current child status.
  797. *
  798. * @param bool $currentChild
  799. */
  800. public function setCurrentChild($currentChild);
  801. /**
  802. * Returns the current child status.
  803. *
  804. * @return bool
  805. */
  806. public function getCurrentChild();
  807. /**
  808. * Get translation label using the current TranslationStrategy.
  809. *
  810. * @param string $label
  811. * @param string $context
  812. * @param string $type
  813. *
  814. * @return string
  815. */
  816. public function getTranslationLabel($label, $context = '', $type = '');
  817. /**
  818. * DEPRECATED: Use buildTabMenu instead.
  819. *
  820. * @param string $action
  821. * @param AdminInterface $childAdmin
  822. *
  823. * @return ItemInterface|bool
  824. *
  825. * @deprecated Use buildTabMenu instead
  826. */
  827. public function buildSideMenu($action, AdminInterface $childAdmin = null);
  828. /**
  829. * Build the tab menu related to the current action.
  830. *
  831. * @param string $action
  832. * @param AdminInterface $childAdmin
  833. *
  834. * @return ItemInterface|bool
  835. */
  836. public function buildTabMenu($action, AdminInterface $childAdmin = null);
  837. /**
  838. * @param $object
  839. *
  840. * @return Metadata
  841. */
  842. public function getObjectMetadata($object);
  843. /**
  844. * @return array
  845. */
  846. public function getListModes();
  847. /**
  848. * @param string $mode
  849. */
  850. public function setListMode($mode);
  851. /**
  852. * return the list mode.
  853. *
  854. * @return string
  855. */
  856. public function getListMode();
  857. /**
  858. * Return the controller access mapping.
  859. *
  860. * @return array
  861. */
  862. public function getAccessMapping();
  863. /**
  864. * Hook to handle access authorization.
  865. *
  866. * @param string $action
  867. * @param object $object
  868. */
  869. public function checkAccess($action, $object = null);
  870. /*
  871. * Configure buttons for an action
  872. *
  873. * @param string $action
  874. * @param object $object
  875. *
  876. */
  877. // public function configureActionButtons($action, $object = null);
  878. }