Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97248211
PhabricatorDestructibleCodex.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 3, 18:57
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 18:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23364181
Attached To
rPH Phabricator
PhabricatorDestructibleCodex.php
View Options
<?php
abstract
class
PhabricatorDestructibleCodex
extends
Phobject
{
private
$viewer
;
private
$object
;
public
function
getDestructionNotes
()
{
return
array
();
}
final
public
function
setViewer
(
PhabricatorUser
$viewer
)
{
$this
->
viewer
=
$viewer
;
return
$this
;
}
final
public
function
getViewer
()
{
return
$this
->
viewer
;
}
final
public
function
setObject
(
PhabricatorDestructibleCodexInterface
$object
)
{
$this
->
object
=
$object
;
return
$this
;
}
final
public
function
getObject
()
{
return
$this
->
object
;
}
final
public
static
function
newFromObject
(
PhabricatorDestructibleCodexInterface
$object
,
PhabricatorUser
$viewer
)
{
if
(!(
$object
instanceof
PhabricatorDestructibleInterface
))
{
throw
new
Exception
(
pht
(
'Object (of class "%s") implements interface "%s", but must also '
.
'implement interface "%s".'
,
get_class
(
$object
),
'PhabricatorDestructibleCodexInterface'
,
'PhabricatorDestructibleInterface'
));
}
$codex
=
$object
->
newDestructibleCodex
();
if
(!(
$codex
instanceof
PhabricatorDestructibleCodex
))
{
throw
new
Exception
(
pht
(
'Object (of class "%s") implements interface "%s", but defines '
.
'method "%s" incorrectly: this method must return an object of '
.
'class "%s".'
,
get_class
(
$object
),
'PhabricatorDestructibleCodexInterface'
,
'newDestructibleCodex()'
,
__CLASS__
));
}
$codex
->
setObject
(
$object
)
->
setViewer
(
$viewer
);
return
$codex
;
}
}
Event Timeline
Log In to Comment