public function setData(array $data, $replaceTemplateVariables = true) : self
    {
        $this->assertDataIsWritable();

        if ($replaceTemplateVariables) {
            $data = $this->replaceTemplateVariables($data);
        }

        $this->_data = $data;

        return $this;
    }
public function setData(array $data, $replaceTemplateVariables = true) : self
    {
        $this->assertDataIsWritable();

        if ($replaceTemplateVariables) {
            $data = $this->replaceTemplateVariables($data);
        }

        $this->_data = $data;

        return $this;
    }
public function setData ( array $ data , $ replaceTemplateVariables = true ) : self { $ this -> assertDataIsWritable ( ) ; if ( $ replaceTemplateVariables ) { $ data = $ this -> replaceTemplateVariables ( $ data ) ; } $ this -> _data = $ data ; return $ this ; }
Setter method for field data.

@param array $data                     - data.
@param bool  $replaceTemplateVariables - Replace template variables?

@throws DataIsReadOnlyException - If data is on read-only status.

@return $this
Setter method for field data .