public function setSource(Source $source)
    {
        if ($this->source !== null) {
            throw new \InvalidArgumentException(self::SOURCE_ALREADY_SETTED_EX_MSG);
        }

        $this->source = $source;

        $this->source->initialise($this->container);

        // Get columns from the source
        $this->source->getColumns($this->columns);

        return $this;
    }
public function setSource(Source $source)
    {
        if ($this->source !== null) {
            throw new \InvalidArgumentException(self::SOURCE_ALREADY_SETTED_EX_MSG);
        }

        $this->source = $source;

        $this->source->initialise($this->container);

        // Get columns from the source
        $this->source->getColumns($this->columns);

        return $this;
    }
public function setSource ( Source $ source ) { if ( $ this -> source !== null ) { throw new \ InvalidArgumentException ( self :: SOURCE_ALREADY_SETTED_EX_MSG ) ; } $ this -> source = $ source ; $ this -> source -> initialise ( $ this -> container ) ; // Get columns from the source $ this -> source -> getColumns ( $ this -> columns ) ; return $ this ; }
Sets Source to the Grid.

@param $source

@throws \InvalidArgumentException

@return self
Sets Source to the Grid .