#133365 README пакета, описание в composer.json и описания полей GraphQL-схемы
This commit is contained in:
1 parent
f3c0f9d890
commit
7b8add6e24
7 files changed
+298
-16
No files matched your search
@@ -2,6 +2,14 @@
|
||||
|
||||
namespace dominion\settings\schema;
|
||||
|
||||
/**
|
||||
* Точка подключения схемы пакета к схеме приложения.
|
||||
*
|
||||
* Приложение (`catalog-app`, `exchange-app`) делает `use SettingsTypes;` в своём
|
||||
* `modules/v2/schema/Types.php`, после чего `Types::settings*()` дают синглтоны типов:
|
||||
* `settings()` — элемент выборки, `settingsPagination()` — корневое поле `settings`
|
||||
* в QueryType, `settingsMutation()` — поле `settings` в MutationType.
|
||||
*/
|
||||
trait Types
|
||||
{
|
||||
private static $settings;
|
||||
@@ -9,16 +17,19 @@ trait Types
|
||||
//
|
||||
private static $settingsMutation;
|
||||
|
||||
/** @return SettingsType тип одной настройки */
|
||||
public static function settings()
|
||||
{
|
||||
return self::$settings ?: (self::$settings = new SettingsType());
|
||||
}
|
||||
/** @return SettingsPaginationType блок пагинации настроек */
|
||||
public static function settingsPagination()
|
||||
{
|
||||
return self::$settingsPagination ?: (self::$settingsPagination = new SettingsPaginationType());
|
||||
}
|
||||
|
||||
//
|
||||
/** @return SettingsMutationType мутация настроек */
|
||||
public static function settingsMutation()
|
||||
{
|
||||
return self::$settingsMutation ?: (self::$settingsMutation = new SettingsMutationType());
|
||||
|
||||
Reference in new issue
Block a user