public function getRelationInfo($name = '')
{
$info = ['type' => $this->type, 'model' => $this->model, 'middle' => $this->middle, 'foreignKey' => $this->foreignKey, 'localKey' => $this->localKey, 'alias' => $this->alias, 'joinType' => $this->joinType];
return $name ? $info[$name] : $info;
}