0 follower

Abstract Class Yiisoft\Yii\Gii\Generator\ActiveRecord\AbstractRelation

InheritanceYiisoft\Yii\Gii\Generator\ActiveRecord\AbstractRelation
SubclassesYiisoft\Yii\Gii\Generator\ActiveRecord\InverseRelation, Yiisoft\Yii\Gii\Generator\ActiveRecord\Relation

Method Details

Hide inherited methods

getGetterMethodName() public method

Returns the method name for the relation getter (e.g., "getProfile").

public string getGetterMethodName ( )

                public function getGetterMethodName(): string
{
    return 'get' . $this->getRelatedModel();
}

            
getGetterReturnType() public method

Returns the return type for the getter method.

public string getGetterReturnType ( )

                public function getGetterReturnType(): string
{
    if ($this->isHasMany()) {
        return 'array';
    }
    return '?' . $this->getRelatedModel();
}

            
getInverseOf() public abstract method

public abstract string getInverseOf ( )

                abstract public function getInverseOf(): string;

            
getLink() public abstract method

Build link array [foreign_column => local_column]

public abstract array getLink ( )

getName() public method

public string getName ( )

                public function getName(): string
{
    return lcfirst($this->getRelatedModel());
}

            
getQueryMethodName() public method

Returns the method name for the relation query (e.g., "getProfileQuery").

public string getQueryMethodName ( )

                public function getQueryMethodName(): string
{
    return 'get' . $this->getRelatedModel() . 'Query';
}

            
getRelatedModel() public abstract method

public abstract string getRelatedModel ( )

                abstract public function getRelatedModel(): string;

            
isHasMany() public method

Returns true if this is a hasMany relation.

public boolean isHasMany ( )

                public function isHasMany(): bool
{
    return false;
}

            
isHasOne() public method

Returns true if this is a hasOne relation.

public boolean isHasOne ( )

                public function isHasOne(): bool
{
    return true;
}