public function bulkUploadField($gridField)
    {
        $fileRelationName = $this->getFileRelationName($gridField);
        $fieldName = $fileRelationName . '_' . $this->getRecordClassName($gridField) . '_BU';
        $uploadField = BulkUploadField::create($gridField, $fieldName, '')
            ->setForm($gridField->getForm())
            ->setRecord(DataObject::create()) // avoid UploadField to get auto-config from the Page (e.g fix allowedMaxFileNumber)
            ;

        //UploadField setup
        foreach ($this->ufSetup as $fn => $param) {
            $uploadField->{$fn}($param);
        }

        $schema['data']['createFileEndpoint'] = [
            'url' => $gridField->Link('bulkupload/upload'),
            'method' => 'post',
            'payloadFormat' => 'urlencoded',
        ];

        $schema['data']['attachFileEndpoint'] = [
            'url' => $gridField->Link('bulkupload/attach'),
            'method' => 'post'
        ];

        $uploadField->setSchemaData($schema);

        return $uploadField;
    }
public function bulkUploadField($gridField)
    {
        $fileRelationName = $this->getFileRelationName($gridField);
        $fieldName = $fileRelationName . '_' . $this->getRecordClassName($gridField) . '_BU';
        $uploadField = BulkUploadField::create($gridField, $fieldName, '')
            ->setForm($gridField->getForm())
            ->setRecord(DataObject::create()) // avoid UploadField to get auto-config from the Page (e.g fix allowedMaxFileNumber)
            ;

        //UploadField setup
        foreach ($this->ufSetup as $fn => $param) {
            $uploadField->{$fn}($param);
        }

        $schema['data']['createFileEndpoint'] = [
            'url' => $gridField->Link('bulkupload/upload'),
            'method' => 'post',
            'payloadFormat' => 'urlencoded',
        ];

        $schema['data']['attachFileEndpoint'] = [
            'url' => $gridField->Link('bulkupload/attach'),
            'method' => 'post'
        ];

        $uploadField->setSchemaData($schema);

        return $uploadField;
    }
public function bulkUploadField ( $ gridField ) { $ fileRelationName = $ this -> getFileRelationName ( $ gridField ) ; $ fieldName = $ fileRelationName . '_' . $ this -> getRecordClassName ( $ gridField ) . '_BU' ; $ uploadField = BulkUploadField :: create ( $ gridField , $ fieldName , '' ) -> setForm ( $ gridField -> getForm ( ) ) -> setRecord ( DataObject :: create ( ) ) // avoid UploadField to get auto-config from the Page (e.g fix allowedMaxFileNumber) ; //UploadField setup foreach ( $ this -> ufSetup as $ fn => $ param ) { $ uploadField -> { $ fn } ( $ param ) ; } $ schema [ 'data' ] [ 'createFileEndpoint' ] = [ 'url' => $ gridField -> Link ( 'bulkupload/upload' ) , 'method' => 'post' , 'payloadFormat' => 'urlencoded' , ] ; $ schema [ 'data' ] [ 'attachFileEndpoint' ] = [ 'url' => $ gridField -> Link ( 'bulkupload/attach' ) , 'method' => 'post' ] ; $ uploadField -> setSchemaData ( $ schema ) ; return $ uploadField ; }
Returned a configured UploadField instance
embedded in the gridfield heard.

@param GridField $gridField Current GridField

@return UploadField Configured UploadField instance
Returned a configured UploadField instance embedded in the gridfield heard .