UnpublishFileMutationCreator
class UnpublishFileMutationCreator extends PublicationMutationCreator implements i18nEntityProvider (View source)
Methods
No description
Returns the list of provided translations for this object.
Details
array
attributes()
Type
type()
array
args()
array
resolve(mixed $object, array $args, mixed $context, ResolveInfo $info)
array
provideI18nEntities()
Returns the list of provided translations for this object.
Note: Pluralised forms are always returned in array format.
Example usage:
class MyTestClass implements i18nEntityProvider
{
public function provideI18nEntities()
{
$entities = [];
foreach($this->config()->get('my_static_array') as $key => $value) {
$entities["MyTestClass.my_staticarray{$key}"] = $value;
}
$entities["MyTestClass.PLURALS"] = [
'one' => 'A test class',
'other' => '{count} test classes',
]
return $entities;
}
}
Example usage in {@link DataObject->provideI18nEntities()}.
You can ask textcollector to add the provided entity to a different module. Simply wrap the returned value for any item in an array with the format: [ 'default' => $defaultValue, 'module' => $module ]
class MyTestClass implements i18nEntityProvider
{
public function provideI18nEntities()
{
$entities = [
'MyOtherModuleClass.MYENTITY' => [
'default' => $value,
'module' => 'myothermodule',
]
];
}
return $entities;
}