core/model/modx/import/modstaticimport.class.php

Show: inherited
Table of Contents

Package
modx  
Subpackage
import  

\modStaticImport

Package: modx\import

Provides common functions for importing content from static files.

Parent(s)
\modImport

Properties

Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX instanceInherited from: \modImport::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modImport::$$modx  
Propertypublicarray  $properties= 'array ()'
inherited

A collection of properties that are being used in this importInherited from: \modImport::$$properties
Default valuearray ()Details
Type
array
Inherited_from
\modImport::$$properties  
Propertypublicarray  $results= 'array()'
inherited

A collection of results in an arrayInherited from: \modImport::$$results
Default valuearray()Details
Type
array
Inherited_from
\modImport::$$results  

Methods

methodpublic__construct( \modX $modx ) : void
inherited

Inherited from: \modImport::__construct()
Parameters
Name Type Description
$modx \modX

A reference to the modX instance

methodpublicgetFileContent( string $file ) : string
inherited

Gets the buffered content of a file

Inherited from: \modImport::getFileContent()
Parameters
Name Type Description
$file string

An absolute path to the file

Returns
Type Description
string
methodpublicgetFileContentType( \$extension $extension ) : string
inherited

Gets the content type of a file

Inherited from: \modImport::getFileContentType()
Parameters
Name Type Description
$extension \$extension

The extension of the file

Returns
Type Description
string The content-type of the file
methodpublicgetFiles( array $filesfound, string $directory, array $listing = array (), int $count = 0 ) : array
inherited

Inherited from: \modImport::getFiles()
Parameters
Name Type Description
$filesfound array

A reference to an array of file locations

$directory string

The directory to import from

$listing array

A listing of imported files

$count int

The current count iteration

Returns
Type Description
array
methodpublicgetResourceAlias( \modResource $resource, string $alias, integer $parent, string $context = 'web' ) : string

Calculate a resource alias from the imported file

Parameters
Name Type Description
$resource \modResource

A reference to the new modResource object

$alias string

A suggested alias

$parent integer

The parent ID of the Resource

$context string

The context of the Resource

Returns
Type Description
string The formatted alias
methodpublicimportFiles( array $allowedfiles, integer $parent, string $filepath, array $files, string $context = 'web', string $class = 'modStaticResource', string $basefilepath = '' ) :

Import files into MODX

Parameters
Name Type Description
$allowedfiles array

An array of allowed file types

$parent integer

The parent Resource to pull into

$filepath string

The path to the files to import

$files array

An array of imported files

$context string

The context to import into

$class string

The class of Resource to import as

$basefilepath string

The base file path for the import

methodpubliclog( string $message ) : void
inherited

Log a message to the results array

Inherited from: \modImport::log()
Parameters
Name Type Description
$message string

A string message to log

Documentation was generated by DocBlox 0.18.1.