model/modx/modsnippet.class.php
- extends
- modScript
- package
- modx
- Classes
- modSnippet
Description
A modScript derivative representing a MODX PHP code snippet.
\modSnippet
- Extends from
- \modScript
- extends
- modScript
- package
- modx
- Methods
- getContent
- remove
- save
- setContent
Description
A modScript derivative representing a MODX PHP code snippet.
{@inheritdoc}
Methods
getContent
getContent(
array $options
=
array
)
:
string
Get the source content of this snippet.
{@inheritDoc}
Arguments
- $options
- array
Output
- string
- The source content.
Details
- visibility
- public
- final
- false
- static
- false
remove
remove(
array $ancestors
=
array
)
:
boolean
Overrides modElement::remove to add custom error logging and fire modX-specific events.
{@inheritDoc}
Arguments
- $ancestors
- array
Keeps track of classes which have already been removed to prevent loop with circular references.
Output
- boolean
- Returns true on success, false on failure.
Details
- visibility
- public
- final
- false
- static
- false
save
save(
boolean|integer $cacheFlag
=
null
)
:
boolean
Overrides modElement::save to add custom error logging and fire modX-specific events.
{@inheritDoc}
Arguments
- $cacheFlag
- booleaninteger
Indicates if the saved object(s) should be cached and optionally, by specifying an integer value, for how many seconds before expiring. Overrides the cacheFlag for the object(s).
Output
- boolean
- Returns true on success, false on failure.
Details
- visibility
- public
- final
- false
- static
- false
setContent
setContent(
string $content, array $options
=
array
)
:
string
Set the source content of this snippet.
{@inheritDoc}
Arguments
- $content
- string
- $options
- array
Output
- string
- True if successfully set
Details
- visibility
- public
- final
- false
- static
- false