AdminInterface.php 23 KB

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