AdminInterface.php 23 KB

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