PHP Class FOF30\Utils\ModelTypeHints

Show file Open project: akeeba/fof Class Usage Examples

Protected Properties

Property Type Description
$className string Name of the class. If empty will be inferred from the current object
$model FOF30\Model\DataModel The model for which to create type hints

Public Methods

Method Description
__construct ( DataModel $model ) Public constructor
getFieldType ( string $type ) : string Translates the database field type into a PHP base type
getHints ( ) : string Returns the docblock with the magic field hints for the model class
getRawHints ( ) : array Return the raw hints array
setClassName ( string $className )

Method Details

__construct() public method

Public constructor
public __construct ( DataModel $model )
$model FOF30\Model\DataModel The model to create hints for

getFieldType() public static method

Translates the database field type into a PHP base type
public static getFieldType ( string $type ) : string
$type string The type of the field
return string The PHP base type

getHints() public method

Returns the docblock with the magic field hints for the model class
public getHints ( ) : string
return string

getRawHints() public method

Return the raw hints array
public getRawHints ( ) : array
return array

setClassName() public method

public setClassName ( string $className )
$className string

Property Details

$className protected property

Name of the class. If empty will be inferred from the current object
protected string $className
return string

$model protected property

The model for which to create type hints
protected DataModel,FOF30\Model $model
return FOF30\Model\DataModel