FieldDescriptionRegistryInterface.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. /**
  12. * Implementations should provide arrays of FieldDescriptionInterface instances.
  13. *
  14. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  15. */
  16. interface FieldDescriptionRegistryInterface
  17. {
  18. /**
  19. * Return FormFieldDescription.
  20. *
  21. * @param string $name
  22. *
  23. * @return FieldDescriptionInterface
  24. */
  25. public function getFormFieldDescription($name);
  26. /**
  27. * Build and return the collection of form FieldDescription.
  28. *
  29. * @return FieldDescriptionInterface[] collection of form FieldDescription
  30. */
  31. public function getFormFieldDescriptions();
  32. /**
  33. * Returns true if the admin has a FieldDescription with the given $name.
  34. *
  35. * @param string $name
  36. *
  37. * @return bool
  38. */
  39. public function hasShowFieldDescription($name);
  40. /**
  41. * Adds a FieldDescription.
  42. *
  43. * @param string $name
  44. * @param FieldDescriptionInterface $fieldDescription
  45. */
  46. public function addShowFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  47. /**
  48. * Removes a ShowFieldDescription.
  49. *
  50. * @param string $name
  51. */
  52. public function removeShowFieldDescription($name);
  53. /**
  54. * Adds a list FieldDescription.
  55. *
  56. * @param string $name
  57. * @param FieldDescriptionInterface $fieldDescription
  58. */
  59. public function addListFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  60. /**
  61. * Removes a list FieldDescription.
  62. *
  63. * @param string $name
  64. */
  65. public function removeListFieldDescription($name);
  66. /**
  67. * Returns a list depend on the given $object.
  68. *
  69. * @return FieldDescriptionCollection
  70. */
  71. public function getList();
  72. /**
  73. * Returns true if the filter FieldDescription exists.
  74. *
  75. * @param string $name
  76. *
  77. * @return bool
  78. */
  79. public function hasFilterFieldDescription($name);
  80. /**
  81. * Adds a filter FieldDescription.
  82. *
  83. * @param string $name
  84. * @param FieldDescriptionInterface $fieldDescription
  85. */
  86. public function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription);
  87. /**
  88. * Removes a filter FieldDescription.
  89. *
  90. * @param string $name
  91. */
  92. public function removeFilterFieldDescription($name);
  93. /**
  94. * Returns the filter FieldDescription collection.
  95. *
  96. * @return FieldDescriptionInterface[]
  97. */
  98. public function getFilterFieldDescriptions();
  99. /**
  100. * Returns a filter FieldDescription.
  101. *
  102. * @param string $name
  103. *
  104. * @return FieldDescriptionInterface|null
  105. */
  106. public function getFilterFieldDescription($name);
  107. }