class Directory extends Package

Class Directory

Methods

__construct(string $projectId, string $apiKey, Client $httpClient)

Constructor.

from Package
string
getProjectId()

Get the project ID.

from Package
string
getApiKey()

Get the API key.

from Package
Client
getHttpClient()

Get the HTTP client object.

from Package
string
getBasePath(string $action)

Get the base path for the command including an action.

from Package
ResponseInterface
add(string $name, bool $isBranch = false, string $branch = '')

Add directory to Crowdin project.

ResponseInterface
update(string $name, string $newName = '', string $title = '', string $exportPattern = '', string $branch = '')

Rename directory or modify its attributes.

ResponseInterface
delete(string $name)

Delete Crowdin project directory.

Details

in Package at line 45
__construct(string $projectId, string $apiKey, Client $httpClient)

Constructor.

Parameters

string $projectId The project ID.
string $apiKey The API key
Client $httpClient The HTTP client object.

in Package at line 57
protected string getProjectId()

Get the project ID.

Return Value

string

in Package at line 67
protected string getApiKey()

Get the API key.

Return Value

string

in Package at line 77
protected Client getHttpClient()

Get the HTTP client object.

Return Value

Client

in Package at line 89
protected string getBasePath(string $action)

Get the base path for the command including an action.

Parameters

string $action The action to perform.

Return Value

string

at line 35
ResponseInterface add(string $name, bool $isBranch = false, string $branch = '')

Add directory to Crowdin project.

Parameters

string $name The name of the directory to add.
bool $isBranch If set to 1 the directory will be marked as a version branch. Acceptable values are: 1 or 0.
string $branch The name of related version branch.

Return Value

ResponseInterface

See also

https://crowdin.com/page/api/add-directory

at line 70
ResponseInterface update(string $name, string $newName = '', string $title = '', string $exportPattern = '', string $branch = '')

Rename directory or modify its attributes.

When renaming directory the path can not be changed (it means new_name parameter can not contain path, name only).

Parameters

string $name Full directory path that should be modified (e.g. /MainPage/AboutUs).
string $newName New directory name.
string $title New directory title to be displayed in Crowdin UI.
string $exportPattern New directory export pattern. Is used to create directory name and path in resulted translations bundle.
string $branch The name of related version branch.

Return Value

ResponseInterface

See also

https://crowdin.com/page/api/change-directory

at line 109
ResponseInterface delete(string $name)

Delete Crowdin project directory.

All nested files and directories will be deleted too.

Parameters

string $name The name of the directory to delete.

Return Value

ResponseInterface

See also

https://crowdin.com/page/api/delete-directory