Answer the question
In order to leave comments, you need to log in
How to add get function name to phpdoc in PhpStorm?
Greetings.
There is a handy thing in Yii2 classes called getMethdod() which is used to create logical Relations in an AR model.
So, these methods are accessed as properties by name with a small letter without the prefix get.
For example,
class Customer extends ActiveRecord
{
public function getOrders()
{
return $this->hasMany(Order::className(), ['customer_id' => 'id']);
}
}
/**
* @property mixed $orders
*/
Answer the question
In order to leave comments, you need to log in
Gii is able to generate this business together with model. PhpStorm, as far as I know, no.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question