public function addRelation(TableRelation $relation, string $name = null)
    {
        $name = $name ?? $relation->name;
        $relation->name = $name;
        $this->relations[$name] = $relation;
        return $this;
    }
public function addRelation(TableRelation $relation, string $name = null)
    {
        $name = $name ?? $relation->name;
        $relation->name = $name;
        $this->relations[$name] = $relation;
        return $this;
    }
public function addRelation ( TableRelation $ relation , string $ name = null ) { $ name = $ name ?? $ relation -> name ; $ relation -> name = $ name ; $ this -> relations [ $ name ] = $ relation ; return $ this ; }
Create an advanced relation using the internal array format
@param  TableRelation     $relation      the relation definition
@param  string|null       $name          optional name of the relation (defaults to the related table name)
@return $this
Create an advanced relation using the internal array format