Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F955096
DivinerAtomizer.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
DivinerAtomizer.php
View Options
<?php
/**
* Generate @{class:DivinerAtom}s from source code.
*/
abstract
class
DivinerAtomizer
{
private
$book
;
private
$fileName
;
/**
* If you make a significant change to an atomizer, you can bump this
* version to drop all the old atom caches.
*/
public
static
function
getAtomizerVersion
()
{
return
1
;
}
final
public
function
atomize
(
$file_name
,
$file_data
)
{
$this
->
fileName
=
$file_name
;
return
$this
->
executeAtomize
(
$file_name
,
$file_data
);
}
abstract
protected
function
executeAtomize
(
$file_name
,
$file_data
);
final
public
function
setBook
(
$book
)
{
$this
->
book
=
$book
;
return
$this
;
}
final
public
function
getBook
()
{
return
$this
->
book
;
}
protected
function
newAtom
(
$type
)
{
return
id
(
new
DivinerAtom
())
->
setBook
(
$this
->
getBook
())
->
setFile
(
$this
->
fileName
)
->
setType
(
$type
);
}
protected
function
newRef
(
$type
,
$name
,
$book
=
null
,
$context
=
null
)
{
$book
=
coalesce
(
$book
,
$this
->
getBook
());
return
id
(
new
DivinerAtomRef
())
->
setBook
(
$book
)
->
setContext
(
$context
)
->
setType
(
$type
)
->
setName
(
$name
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 5:00 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227108
Default Alt Text
DivinerAtomizer.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment