public function setFieldDescription($field, $description)
    {
        $existing = $this->fields->find('Name', $field);
        if (!$existing) {
            throw new InvalidArgumentException(
                sprintf(
                    'Cannot set description of %s. It has not been added to %s.',
                    $field,
                    $this->getDataObjectClass()
                )
            );
        }

        $this->fields->replace(
            $existing,
            ArrayData::create(
                [
                    'Name' => $field,
                    'Description' => $description
                ]
            )
        );

        return $this;
    }
public function setFieldDescription($field, $description)
    {
        $existing = $this->fields->find('Name', $field);
        if (!$existing) {
            throw new InvalidArgumentException(
                sprintf(
                    'Cannot set description of %s. It has not been added to %s.',
                    $field,
                    $this->getDataObjectClass()
                )
            );
        }

        $this->fields->replace(
            $existing,
            ArrayData::create(
                [
                    'Name' => $field,
                    'Description' => $description
                ]
            )
        );

        return $this;
    }
public function setFieldDescription ( $ field , $ description ) { $ existing = $ this -> fields -> find ( 'Name' , $ field ) ; if ( ! $ existing ) { throw new InvalidArgumentException ( sprintf ( 'Cannot set description of %s. It has not been added to %s.' , $ field , $ this -> getDataObjectClass ( ) ) ) ; } $ this -> fields -> replace ( $ existing , ArrayData :: create ( [ 'Name' => $ field , 'Description' => $ description ] ) ) ; return $ this ; }
Sets the description to an existing field.

@param  string $field
@param  string $description
@return $this
Sets the description to an existing field .