AdminInterface.php 22 KB

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