Abstract Class Yiisoft\Yii\Gii\Generator\ActiveRecord\AbstractRelation
| Inheritance | Yiisoft\Yii\Gii\Generator\ActiveRecord\AbstractRelation |
|---|---|
| Subclasses | Yiisoft\Yii\Gii\Generator\ActiveRecord\InverseRelation, Yiisoft\Yii\Gii\Generator\ActiveRecord\Relation |
Public Methods
Method Details
Returns the method name for the relation getter (e.g., "getProfile").
| public string getGetterMethodName ( ) |
public function getGetterMethodName(): string
{
return 'get' . $this->getRelatedModel();
}
Returns the return type for the getter method.
| public string getGetterReturnType ( ) |
public function getGetterReturnType(): string
{
if ($this->isHasMany()) {
return 'array';
}
return '?' . $this->getRelatedModel();
}
Build link array [foreign_column => local_column]
| public abstract array |
abstract public function getLink(): array;
| public string getName ( ) |
public function getName(): string
{
return lcfirst($this->getRelatedModel());
}
Returns the method name for the relation query (e.g., "getProfileQuery").
| public string getQueryMethodName ( ) |
public function getQueryMethodName(): string
{
return 'get' . $this->getRelatedModel() . 'Query';
}
Returns true if this is a hasMany relation.
| public boolean isHasMany ( ) |
public function isHasMany(): bool
{
return false;
}
Signup or Login in order to comment.