Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889213
DrydockBlueprintTypeTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
DrydockBlueprintTypeTransaction.php
View Options
<?php
final
class
DrydockBlueprintTypeTransaction
extends
DrydockBlueprintTransactionType
{
const
TRANSACTIONTYPE
=
'drydock.blueprint.type'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getClassName
(
)
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setClassName
(
$value
)
;
}
public
function
getTitle
(
)
{
// These transactions can only be applied during object creation and never
// generate a timeline event.
return
null
;
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
(
)
;
$name
=
$object
->
getClassName
(
)
;
if
(
$this
->
isEmptyTextTransaction
(
$name
,
$xactions
)
)
{
$errors
[
]
=
$this
->
newRequiredError
(
pht
(
'You must select a blueprint type when creating a blueprint.'
)
)
;
}
$map
=
DrydockBlueprintImplementation
::
getAllBlueprintImplementations
(
)
;
foreach
(
$xactions
as
$xaction
)
{
if
(
!
$this
->
isNewObject
(
)
)
{
$errors
[
]
=
$this
->
newInvalidError
(
pht
(
'The type of a blueprint can not be changed once it has '
.
'been created.'
)
,
$xaction
)
;
continue
;
}
$new
=
$xaction
->
getNewValue
(
)
;
if
(
!
isset
(
$map
[
$new
]
)
)
{
$errors
[
]
=
$this
->
newInvalidError
(
pht
(
'Blueprint type "%s" is not valid. Valid types are: %s.'
,
$new
,
implode
(
', '
,
array_keys
(
$map
)
)
)
)
;
continue
;
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 11:49 (5 w, 13 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124250
Default Alt Text
DrydockBlueprintTypeTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment