Properties

Methods

__construct()

__construct(  $object) 

Parameters

$object

get_object_name()

get_object_name(string  $name_property = null) : string

Resolves the "name" of given object

Parameters

string $name_property

property to use as "name", if left to default (null), will be reflected

Returns

string —

value of name property or boolean false on failure

name_is_clean()

name_is_clean(string  $name_property = null) : boolean

Checks for "clean" URL name

Parameters

string $name_property

property to use as "name", if left to default (null), will be reflected

Returns

boolean —

indicating cleanliness

name_is_safe()

name_is_safe(string  $name_property = null) : boolean

Checks for URL-safe name

Parameters

string $name_property

property to use as "name", if left to default (null), will be reflected

Returns

boolean —

indicating safety

name_is_safe_or_empty()

name_is_safe_or_empty(string  $name_property = null) : boolean

Checks for URL-safe name, this variant accepts empty name

Parameters

string $name_property

property to use as "name", if left to default (null), will be reflected

Returns

boolean —

indicating safety

name_is_clean_or_empty()

name_is_clean_or_empty(string  $name_property = null) : boolean

Checks for "clean" URL name, this variant accepts empty name

Parameters

string $name_property

property to use as "name", if left to default (null), will be reflected

Returns

boolean —

indicating cleanliness

name_is_unique_or_empty()

name_is_unique_or_empty() : boolean

Check that none of given objects siblings have same name, or the name is empty.

Returns

boolean —

indicating uniqueness

name_is_unique()

name_is_unique() : boolean

Check that none of given object's siblings have same name.

Returns

boolean —

indicating uniqueness

generate_unique_name()

generate_unique_name(string  $title_property = null, string  $extension = '') : string

Generates an unique name for the given object.

1st IF name is empty, we generate one from title (if title is empty too, we return false) Then we check if it's unique, if not we add an incrementing number to it (before this we make some educated guesses about a good starting value)

Parameters

string $title_property

Property of the object to use at title, if null will be reflected (see midcom_helper_reflector::get_object_title())

string $extension

The file extension, when working with attachments

Returns

string —

string usable as name or boolean false on critical failures

_name_is_unique_check_siblings()

_name_is_unique_check_siblings(array  $sibling_classes,   $parent) : boolean

Check uniqueness for each sibling

Parameters

array $sibling_classes

array of classes to check

$parent

Returns

boolean —

true means no clashes, false means clash.

_name_is_unique_check_roots()

_name_is_unique_check_roots(array  $sibling_classes) : boolean

Check uniqueness for each root level class

Parameters

array $sibling_classes

array of classes to check

Returns

boolean —

true means no clashes, false means clash.

_get_sibling_qb()

_get_sibling_qb(  $schema_type,   $parent) 

Parameters

$schema_type
$parent

_get_root_qb()

_get_root_qb(  $schema_type) 

Parameters

$schema_type

_parse_filename()

_parse_filename(  $name,   $extension,   $default) 

Parameters

$name
$extension
$default

_generate_unique_name_resolve_i()

_generate_unique_name_resolve_i(string  $current_name, string  $extension) : array

Resolve the base value for the incrementing suffix and for the name.

Parameters

string $current_name

the "current name" of the object (might not be the actual name value see the title logic in generate_unique_name())

string $extension

The file extension, when working with attachments

Returns

array —

first key is the resolved $i second is the $base_name, which is $current_name without numeric suffix

process_schema_type()

process_schema_type(  $qb,   $i,   $schema_type,   $base_name,   $extension) 

Parameters

$qb
$i
$schema_type
$base_name
$extension