generateRelationName() защищенный Метод

Generate a relation name for the specified table and a base name.
protected generateRelationName ( array $relations, yii\db\TableSchema $table, string $key, boolean $multiple ) : string
$relations array the relations being generated currently.
$table yii\db\TableSchema the table schema
$key string a base name that the relation name may be generated from
$multiple boolean whether this is a has-many relation
Результат string the relation name
Пример #1
0
 /**
  * @inheritdoc
  */
 public function generateRelationName($relations, $table, $key, $multiple)
 {
     return parent::generateRelationName($relations, $table, $key, $multiple);
 }
Пример #2
0
 /**
  * @inheritdoc
  * @param \yii\gii\plus\db\TableSchema $table
  */
 protected function generateRelationName($relations, $table, $key, $multiple)
 {
     if ($table->isView) {
         $key = preg_replace('~^(?:[pfut]k_)?(\\w+_id)$~', '$1', $key);
     }
     return parent::generateRelationName($relations, $table, $key, $multiple);
 }