AdminInterface.php 22 KB

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