protected function with($with = null, $mode = self::MODE_OR)
    {
        if ($with instanceof GenericCollection) {
            $with = $with->toArray();
        }

        if (is_array($with)) {
            return $this->andWith((array) $with, $mode);
        }

        return $with;
    }
protected function with($with = null, $mode = self::MODE_OR)
    {
        if ($with instanceof GenericCollection) {
            $with = $with->toArray();
        }

        if (is_array($with)) {
            return $this->andWith((array) $with, $mode);
        }

        return $with;
    }
protected function with ( $ with = null , $ mode = self :: MODE_OR ) { if ( $ with instanceof GenericCollection ) { $ with = $ with -> toArray ( ) ; } if ( is_array ( $ with ) ) { return $ this -> andWith ( ( array ) $ with , $ mode ) ; } return $ with ; }
Format the with compatible parameters.

@param  array|string $with
@param  int          $mode
@return string
Format the with compatible parameters .