\midcom_helper_filesync_importer_snippet

Import a site snippet

Note, that the request data, for ease of use, already contains the L10n Databases of the Component and MidCOM itself located in this class. They are stored as 'l10n' and 'l10n_midcom'. Also available as 'config' is the current component configuration.

Summary

Methods
Properties
Constants
__construct()
run()
create()
delete_missing_folders()
delete_missing_files()
import()
get_node_qb()
get_leaf_qb()
__get()
__isset()
set_active_leaf()
add_stylesheet()
get_workflow()
$delete_missing
$root_dir
$_component
$_i18n
$_l10n
$_l10n_midcom
$_config
No constants found
_read_dirs()
_get_node()
read_file()
No protected properties found
N/A
read_snippetdir()
$_services
N/A

Properties

$delete_missing

$delete_missing : boolean

Whether to delete elements from database that do not exist in the file system

Type

boolean

$root_dir

$root_dir : 

Type

$_component

$_component : string

The name of the component, e.g. net.nehmer.static. Should be used whenever the component's name is required instead of hardcoding it.

Type

string

$_i18n

$_i18n : \midcom_services_i18n

A handle to the i18n service.

Type

\midcom_services_i18n

$_l10n

$_l10n : \midcom_services_i18n_l10n

The components' L10n string database.

Type

\midcom_services_i18n_l10n

$_l10n_midcom

$_l10n_midcom : \midcom_services_i18n_l10n

The global MidCOM string database.

Type

\midcom_services_i18n_l10n

$_config

$_config : \midcom_helper_configuration

The current configuration.

Type

\midcom_helper_configuration

$_services

$_services : array

Array that holds the already instantiated services

Type

array

Methods

__construct()

__construct() 

Initialize all member variables, remember to set $_component before calling this constructor from your derived classes.

run()

run() 

create()

create(string  $type) : \midcom_helper_filesync_importer

Dynamically create importer instances.

The returned instances will be created but not initialized.

Parameters

string $type

type

Returns

\midcom_helper_filesync_importer

The newly created importer instance.

delete_missing_folders()

delete_missing_folders(array  $foldernames,   $parent_id) 

Parameters

array $foldernames
$parent_id

delete_missing_files()

delete_missing_files(array  $filenames,   $parent_id) 

Parameters

array $filenames
$parent_id

import()

import() 

Run the import

get_node_qb()

get_node_qb(integer  $parent_id) : \midcom_core_querybuilder

Returns node QB

Parameters

integer $parent_id

The parent's ID

Returns

\midcom_core_querybuilder

The prepared QB instance

get_leaf_qb()

get_leaf_qb(integer  $parent_id) : \midcom_core_querybuilder

Returns leaf QB

Parameters

integer $parent_id

The parent's ID

Returns

\midcom_core_querybuilder

The prepared QB instance

__get()

__get(  $field) 

Parameters

$field

__isset()

__isset(  $field) 

Parameters

$field

set_active_leaf()

set_active_leaf(  $leaf_id) 

Parameters

$leaf_id

add_stylesheet()

add_stylesheet(string  $url, string  $media = false) 

Convenience shortcut for adding CSS files

Parameters

string $url

The stylesheet URL

string $media

The media type(s) for the stylesheet, if any

get_workflow()

get_workflow(string  $identifier, array  $options = array()) : \midcom\workflow\dialog

Parameters

string $identifier
array $options

Returns

\midcom\workflow\dialog

_read_dirs()

_read_dirs(  $path) 

Parameters

$path

_get_node()

_get_node(  $classname,   $parent_id,   $path) 

Parameters

$classname
$parent_id
$path

read_file()

read_file(  $path) 

Parameters

$path

read_snippetdir()

read_snippetdir(  $path,   $parent_id) 

Parameters

$path
$parent_id