PHP Class Prado\Data\ActiveRecord\Relations\TActiveRecordRelationContext

This class is use internally by passing a context to the TActiveRecordRelation constructor.
Since: 3.1
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $record, $property = null, $relation = null )
getAssociationTable ( ) : string
getCondition ( ) : string
getFkField ( ) : string
getForeignRecordClass ( ) : string
getForeignRecordFinder ( ) : TActiveRecord
getParameters ( ) : array
getProperty ( ) : string
getPropertyValue ( )
getRelationForeignKeys ( ) : array
getRelationHandler ( $criteria = null ) : TActiveRecordRelation Creates and return the TActiveRecordRelation handler for specific relationships.
getRelationType ( ) : string
getSourceRecord ( ) : TActiveRecord
hasAssociationTable ( ) : boolean
hasFkField ( ) : boolean
hasRecordRelation ( ) : boolean
updateAssociatedRecords ( $updateBelongsTo = false ) : TActiveRecordRelationCommand

Méthodes protégées

Méthode Description
isEmptyFkObject ( $obj )

Method Details

__construct() public méthode

public __construct ( $record, $property = null, $relation = null )

getAssociationTable() public méthode

public getAssociationTable ( ) : string
Résultat string the M-N relationship association table name.

getCondition() public méthode

Since: 3.1.2
public getCondition ( ) : string
Résultat string the query condition for the relation as specified in RELATIONS

getFkField() public méthode

Since: 3.1.2
public getFkField ( ) : string
Résultat string foreign key field names, comma delimited.

getForeignRecordClass() public méthode

public getForeignRecordClass ( ) : string
Résultat string foreign record class name.

getForeignRecordFinder() public méthode

public getForeignRecordFinder ( ) : TActiveRecord
Résultat Prado\Data\ActiveRecord\TActiveRecord corresponding relationship foreign object finder instance.

getParameters() public méthode

Since: 3.1.2
public getParameters ( ) : array
Résultat array the query parameters for the relation as specified in RELATIONS

getProperty() public méthode

public getProperty ( ) : string
Résultat string name of the record property that the relationship results will be assigned to.

getPropertyValue() public méthode

public getPropertyValue ( )

getRelationForeignKeys() public méthode

Since: 3.1.2
public getRelationForeignKeys ( ) : array
Résultat array foreign key of this relations, the keys is dependent on the relationship type.

getRelationHandler() public méthode

An instance of TActiveRecordHasOne, TActiveRecordBelongsTo, TActiveRecordHasMany, or TActiveRecordHasManyAssocation will be returned.
public getRelationHandler ( $criteria = null ) : TActiveRecordRelation
Résultat TActiveRecordRelation record relationship handler instnace.

getRelationType() public méthode

public getRelationType ( ) : string
Résultat string HAS_MANY, HAS_ONE, or BELONGS_TO

getSourceRecord() public méthode

public getSourceRecord ( ) : TActiveRecord
Résultat Prado\Data\ActiveRecord\TActiveRecord the active record instance that queried for its related records.

hasAssociationTable() public méthode

public hasAssociationTable ( ) : boolean
Résultat boolean true if the relationship is HAS_MANY and requires an association table.

hasFkField() public méthode

Since: 3.1.2
public hasFkField ( ) : boolean
Résultat boolean true if the 3rd element of an TActiveRecord::$RELATION entry is set.

hasRecordRelation() public méthode

Since: 3.1.2
public hasRecordRelation ( ) : boolean
Résultat boolean true if the relation is defined in TActiveRecord::$RELATIONS

isEmptyFkObject() protected méthode

protected isEmptyFkObject ( $obj )

updateAssociatedRecords() public méthode

public updateAssociatedRecords ( $updateBelongsTo = false ) : TActiveRecordRelationCommand
Résultat TActiveRecordRelationCommand