public function with($relation)
    {
        $this->reset();

        if (func_num_args() > 1) {
            return $this->with(func_get_args());
        }

        if (is_array($relation)) {
            $this->related = array_merge($this->related, $relation);
        } else {
            $this->related[] = $relation;
        }

        $this->relatedCount = count($this->related);

        return $this;
    }
public function with($relation)
    {
        $this->reset();

        if (func_num_args() > 1) {
            return $this->with(func_get_args());
        }

        if (is_array($relation)) {
            $this->related = array_merge($this->related, $relation);
        } else {
            $this->related[] = $relation;
        }

        $this->relatedCount = count($this->related);

        return $this;
    }
public function with ( $ relation ) { $ this -> reset ( ) ; if ( func_num_args ( ) > 1 ) { return $ this -> with ( func_get_args ( ) ) ; } if ( is_array ( $ relation ) ) { $ this -> related = array_merge ( $ this -> related , $ relation ) ; } else { $ this -> related [ ] = $ relation ; } $ this -> relatedCount = count ( $ this -> related ) ; return $ this ; }
Adds a relation to the transformer.

@param $relation
@return $this
Adds a relation to the transformer .