AdminInterface.php 24 KB

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