public function offsetSet($key, $value)
    {
        if (is_numeric($key)) {
            throw new InvalidArgumentException(
                'Entity array access only supports non-numeric keys'
            );
        }

        $key = $this->camelize($key);

        /** @internal Edge Case: "_" → "" */
        if ($key === '') {
            return;
        }

        $setter = 'set'.ucfirst($key);
        if (is_callable([ $this, $setter ])) {
            $this->{$setter}($value);
        } else {
            $this->{$key} = $value;
        }

        $this->keys[$key] = true;
    }
public function offsetSet($key, $value)
    {
        if (is_numeric($key)) {
            throw new InvalidArgumentException(
                'Entity array access only supports non-numeric keys'
            );
        }

        $key = $this->camelize($key);

        /** @internal Edge Case: "_" → "" */
        if ($key === '') {
            return;
        }

        $setter = 'set'.ucfirst($key);
        if (is_callable([ $this, $setter ])) {
            $this->{$setter}($value);
        } else {
            $this->{$key} = $value;
        }

        $this->keys[$key] = true;
    }
public function offsetSet ( $ key , $ value ) { if ( is_numeric ( $ key ) ) { throw new InvalidArgumentException ( 'Entity array access only supports non-numeric keys' ) ; } $ key = $ this -> camelize ( $ key ) ; /** @internal Edge Case: "_" → "" */ if ( $ key === '' ) { return ; } $ setter = 'set' . ucfirst ( $ key ) ; if ( is_callable ( [ $ this , $ setter ] ) ) { $ this -> { $ setter } ( $ value ) ; } else { $ this -> { $ key } = $ value ; } $ this -> keys [ $ key ] = true ; }
Assigns the value to the specified key on this entity.

Routine:
- The data key is added to the {@see self::$keys entity's key pool}.
- If the entity has a setter method (e.g., "foo_bar" → `setFooBar()`),
its called and passed the value;
- If the entity has NO setter method, the value is assigned to a property (e.g., `$fooBar`).

@see    \ArrayAccess
@param  string $key   The data key to assign $value to.
@param  mixed  $value The data value to assign to $key.
@throws InvalidArgumentException If the $key is not a string or is a numeric value.
@return void
Assigns the value to the specified key on this entity .