PHP Class ModelCode

Inheritance: extends CCodeModel
显示文件 Open project: openeyes/openeyes Class Usage Examples

Public Properties

Property Type Description
$baseClass
$connectionId
$modelClass
$modelPath
$tableName
$tablePrefix

Protected Properties

Property Type Description
$relations list of candidate relation code. The array are indexed by AR class names and relation names. Each element represents the code of the one relation in one AR class.

Public Methods

Method Description
attributeLabels ( )
generateLabels ( $table )
generateRules ( $table )
getRelations ( $className )
getTableSchema ( $tableName )
init ( )
prepare ( )
requiredTemplates ( )
rules ( )
validateBaseClass ( $attribute, $params )
validateConnectionId ( $attribute, $params )
validateModelPath ( $attribute, $params )
validateTableName ( $attribute, $params )

Protected Methods

Method Description
generateClassName ( $tableName )
generateRelationName ( $tableName, $fkName, $multiple ) : string Generate a name for use as a relation name (inside relations() function in a model).
generateRelations ( )
getDbConnection ( )
isRelationTable ( $table ) : boolean Checks if the given table is a "many to many" pivot table.
removePrefix ( $tableName, $addBrackets = true )

Method Details

attributeLabels() public method

public attributeLabels ( )

generateClassName() protected method

protected generateClassName ( $tableName )

generateLabels() public method

public generateLabels ( $table )

generateRelationName() protected method

Generate a name for use as a relation name (inside relations() function in a model).
protected generateRelationName ( $tableName, $fkName, $multiple ) : string
return string the relation name

generateRelations() protected method

protected generateRelations ( )

generateRules() public method

public generateRules ( $table )

getDbConnection() protected method

protected getDbConnection ( )

getRelations() public method

public getRelations ( $className )

getTableSchema() public method

public getTableSchema ( $tableName )

init() public method

public init ( )

isRelationTable() protected method

Their PK has 2 fields, and both of those fields are also FK to other separate tables.
protected isRelationTable ( $table ) : boolean
return boolean true if table matches description of helpter table.

prepare() public method

public prepare ( )

removePrefix() protected method

protected removePrefix ( $tableName, $addBrackets = true )

requiredTemplates() public method

public requiredTemplates ( )

rules() public method

public rules ( )

validateBaseClass() public method

public validateBaseClass ( $attribute, $params )

validateConnectionId() public method

public validateConnectionId ( $attribute, $params )

validateModelPath() public method

public validateModelPath ( $attribute, $params )

validateTableName() public method

public validateTableName ( $attribute, $params )

Property Details

$baseClass public_oe property

public $baseClass

$connectionId public_oe property

public $connectionId

$modelClass public_oe property

public $modelClass

$modelPath public_oe property

public $modelPath

$relations protected_oe property

list of candidate relation code. The array are indexed by AR class names and relation names. Each element represents the code of the one relation in one AR class.
protected $relations

$tableName public_oe property

public $tableName

$tablePrefix public_oe property

public $tablePrefix