Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1094914
NuanceManagementImportWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
NuanceManagementImportWorkflow.php
View Options
<?php
final
class
NuanceManagementImportWorkflow
extends
NuanceManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'import'
)
->
setExamples
(
'**import** --source __source__ [__options__]'
)
->
setSynopsis
(
pht
(
'Import data from a source.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'source'
,
'param'
=>
'source'
,
'help'
=>
pht
(
'Choose which source to import.'
),
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$source
=
$this
->
loadSource
(
$args
,
'source'
);
$definition
=
$source
->
getDefinition
()
->
setViewer
(
$this
->
getViewer
())
->
setSource
(
$source
);
if
(!
$definition
->
hasImportCursors
())
{
throw
new
PhutilArgumentUsageException
(
pht
(
'This source ("%s") does not expose import cursors.'
,
$source
->
getName
()));
}
$cursors
=
$definition
->
getImportCursors
();
if
(!
$cursors
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'This source ("%s") does not have any import cursors.'
,
$source
->
getName
()));
}
foreach
(
$cursors
as
$cursor
)
{
$cursor
->
importFromSource
();
}
return
0
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 30, 9:21 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
272616
Default Alt Text
NuanceManagementImportWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment