Propel 2 API
Class

Propel\Generator\Builder\Om\ClassTools

class ClassTools

Tools to support class & package inclusion and referencing.

Methods

static string classname(string $qualifiedName)

Gets just classname, given a dot-path to class.

static string getFilePath(string $path, string $classname = null, string $extension = '.php')

Gets the path to be used in include()/require() statement.

static string createFilePath(string $path, string $classname = null, string $extension = '.php')

This method replaces the `getFilePath()` method in OMBuilder as we consider `$path` as a real path instead of a dot-notation value.

static string getBaseClass(Table $table)

Gets the baseClass path if specified for table/db.

static string getInterface(Table $table)

Gets the interface path if specified for table.

static string[] getPhpReservedWords()

Gets a list of PHP reserved words.

Details

at line 28
static public string classname(string $qualifiedName)

Gets just classname, given a dot-path to class.

Parameters

string $qualifiedName

Return Value

string

at line 54
static public string getFilePath(string $path, string $classname = null, string $extension = '.php')

Gets the path to be used in include()/require() statement.

Supports multiple function signatures:

(1) getFilePath($dotPathClass);
(2) getFilePath($dotPathPrefix, $className);
(3) getFilePath($dotPathPrefix, $className, $extension);

Parameters

string $path dot-path to class or to package prefix.
string $classname class name
string $extension The extension to use on the file.

Return Value

string The constructed file path.

at line 71
static public string createFilePath(string $path, string $classname = null, string $extension = '.php')

This method replaces the `getFilePath()` method in OMBuilder as we consider `$path` as a real path instead of a dot-notation value.

`$path` is generated by the `getPackagePath()`
method.

Parameters

string $path path to class or to package prefix.
string $classname class name
string $extension The extension to use on the file.

Return Value

string The constructed file path.

at line 89
static public string getBaseClass(Table $table)

Gets the baseClass path if specified for table/db.

Parameters

Table $table

Return Value

string

at line 99
static public string getInterface(Table $table)

Gets the interface path if specified for table.

Parameters

Table $table

Return Value

string

at line 109
static public string[] getPhpReservedWords()

Gets a list of PHP reserved words.

Return Value

string[]