AdminInterface.php 23 KB

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