protected function validateUploadImages($entity)
    {
        $files = $this->request->file('files');

        if (empty($files['name'][0])) {
            return null;
        }

        $directory = $this->config->get("{$entity}_image_dirname", $entity);
        $results = $this->file_transfer->uploadMultiple($files, 'image', "image/upload/$directory");

        foreach ($results['transferred'] as $key => $path) {
            $this->setSubmitted("images.$key.path", $path);
        }

        if (!empty($results['errors'])) {
            $this->setError('images', implode('<br>', (array) $results['errors']));
            return false;
        }

        return true;
    }
protected function validateUploadImages($entity)
    {
        $files = $this->request->file('files');

        if (empty($files['name'][0])) {
            return null;
        }

        $directory = $this->config->get("{$entity}_image_dirname", $entity);
        $results = $this->file_transfer->uploadMultiple($files, 'image', "image/upload/$directory");

        foreach ($results['transferred'] as $key => $path) {
            $this->setSubmitted("images.$key.path", $path);
        }

        if (!empty($results['errors'])) {
            $this->setError('images', implode('<br>', (array) $results['errors']));
            return false;
        }

        return true;
    }
protected function validateUploadImages ( $ entity ) { $ files = $ this -> request -> file ( 'files' ) ; if ( empty ( $ files [ 'name' ] [ 0 ] ) ) { return null ; } $ directory = $ this -> config -> get ( "{$entity}_image_dirname" , $ entity ) ; $ results = $ this -> file_transfer -> uploadMultiple ( $ files , 'image' , "image/upload/$directory" ) ; foreach ( $ results [ 'transferred' ] as $ key => $ path ) { $ this -> setSubmitted ( "images.$key.path" , $ path ) ; } if ( ! empty ( $ results [ 'errors' ] ) ) { $ this -> setError ( 'images' , implode ( '<br>' , ( array ) $ results [ 'errors' ] ) ) ; return false ; } return true ; }
Validates uploaded images
@param string $entity
@return bool|null
Validates uploaded images