src/DataAwareTrait.php
public function setData($name, $value)
    {
        if (!isset($this->data)) {
            throw new RuntimeException("Data property is required for DataAwareTrait to work");
        }

        // we use snake_case field keys
        // but camelCase setters
        $name = $this->decamelize($name);

        // only set values for predefined data keys
        if (array_key_exists($name, $this->data)) {
            $this->data[$name] = $value[0];
        }

        return $this;
    }
public function setData($name, $value)
    {
        if (!isset($this->data)) {
            throw new RuntimeException("Data property is required for DataAwareTrait to work");
        }

        // we use snake_case field keys
        // but camelCase setters
        $name = $this->decamelize($name);

        // only set values for predefined data keys
        if (array_key_exists($name, $this->data)) {
            $this->data[$name] = $value[0];
        }

        return $this;
    }
public function setData ( $ name , $ value ) { if ( ! isset ( $ this -> data ) ) { throw new RuntimeException ( "Data property is required for DataAwareTrait to work" ) ; } // we use snake_case field keys // but camelCase setters $ name = $ this -> decamelize ( $ name ) ; // only set values for predefined data keys if ( array_key_exists ( $ name , $ this -> data ) ) { $ this -> data [ $ name ] = $ value [ 0 ] ; } return $ this ; }
Data setter
Make sure only valid data passes through

@param string $name data key name
@param mixed $value data value name
Data setter Make sure only valid data passes through