class UnpublishFileMutationCreator extends PublicationMutationCreator implements i18nEntityProvider (View source)

deprecated 1.8.0 Use the latest version of graphql instead

Properties

protected string $name
protected string $description
protected array $warningMessages from  PublicationMutationCreator

Methods

public
array
__construct(Manager $manager = null)

No description

public
attributes()

No description

public
Type
type()

No description

public
array
args()

No description

public
array
resolve(mixed $object, array $args, mixed $context, ResolveInfo $info)

No description

protected
addWarningMessage($msg)

No description

protected
string
sourceStage()

The stage that the file should be fetched from before mutation

protected
mutateFile(File $file, bool $force = false)

No description

protected
bool
hasPermission(File $file, Member $member)

No description

public
array
provideI18nEntities()

Returns the list of provided translations for this object.

protected
int
countLiveOwners(File $file)

Count number of live owners this file uses

Details

array __construct(Manager $manager = null)

No description

Parameters

Manager $manager

Return Value

array

attributes()

No description

Type type()

No description

Return Value

Type

array args()

No description

Return Value

array

array resolve(mixed $object, array $args, mixed $context, ResolveInfo $info)

No description

Parameters

mixed $object
array $args
mixed $context
ResolveInfo $info

Return Value

array

protected addWarningMessage($msg)

No description

Parameters

$msg

protected string sourceStage()

The stage that the file should be fetched from before mutation

Return Value

string

protected File|Notice mutateFile(File $file, bool $force = false)

No description

Parameters

File $file
bool $force

Return Value

File|Notice

protected bool hasPermission(File $file, Member $member)

No description

Parameters

File $file
Member $member

Return Value

bool

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_static_array_{$key}"] = $value;
    }
    $entities["MyTestClass.PLURALS"] = [
      'one' => 'A test class',
      'other' => '{count} test classes',
    ]
    return $entities;
  }
}

Example usage in 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;
}

Return Value

array

Map of keys to default values, which are strings in the default case, and array-form for pluralisations.

protected int countLiveOwners(File $file)

Count number of live owners this file uses

Parameters

File $file

Return Value

int

Number of live owners