AdminInterface.php 24 KB

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