Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ConfigBlock
  • ConfigOperation
  • DeleteOperation
  • DownloadOperation
  • EditBlock
  • File
  • FileUpload
  • GetOperation
  • ManageBlock
  • Model
  • Module
  • SaveOperation
  • UploadOperation

Class SaveOperation

Save a file.

ICanBoogie\Object implements ICanBoogie\ToArrayRecursive uses ICanBoogie\ToArrayRecursiveTrait, ICanBoogie\PrototypeTrait
Extended by ICanBoogie\Operation
Extended by ICanBoogie\SaveOperation
Extended by Icybee\Modules\Nodes\SaveOperation
Extended by Icybee\Modules\Files\SaveOperation

Direct known subclasses

Icybee\Modules\Images\SaveOperation

Namespace: Icybee\Modules\Files
Located at vendor/icanboogie-modules/files/lib/operations/save.php

Methods summary

protected
# get_file( )
protected array
# lazy_get_properties( )

Unset the mime and size properties because they cannot be updated by the user. If the file property is defined, which is the case when an asynchronous upload happend, it is copied to the path property.

Unset the mime and size properties because they cannot be updated by the user. If the file property is defined, which is the case when an asynchronous upload happend, it is copied to the path property.

Returns

array
The properties of the operation.

Overrides

Icybee\Modules\Nodes\SaveOperation::lazy_get_properties
public Operation\Response
# __invoke( ICanBoogie\HTTP\Request $request )

The temporary files stored in the repository are cleaned before the operation is processed.

The temporary files stored in the repository are cleaned before the operation is processed.

Parameters

$request
HTTP\Request
$request The request triggering the operation.

Returns

Operation\Response
The response of the operation.

Throws

Failure
when the response has a client or server error, or the FormHasExpired exception was raised.

Overrides

ICanBoogie\Operation::__invoke
protected boolean
# control( array $controls )

If PATH is not defined, we check for a file upload, which is required if the operation key is empty. If a file upload is found, the Uploaded object is set as the operation file property, and the PATH parameter of the operation is set to the file location.

If PATH is not defined, we check for a file upload, which is required if the operation key is empty. If a file upload is found, the Uploaded object is set as the operation file property, and the PATH parameter of the operation is set to the file location.

Note that if the upload is not required - because the operation key is defined for updating an entry - the PATH parameter of the operation is set to TRUE to avoid error reporting from the form validation.

TODO: maybe this is not ideal, since the file upload should be made optionnal when the form is generated to edit existing entries.

Parameters

$controls
array
$controls The controls to pass for the operation to be processed.

Returns

boolean
true if all the controls pass, false otherwise.

Throws

HTTPError
Depends on the control.

Overrides

ICanBoogie\Operation::control
protected boolean
# validate( ICanboogie\Errors $errors )

The method validates unless there was an error during the file upload.

The method validates unless there was an error during the file upload.

Returns

boolean
true if the operation is valid, false otherwise.

Throws

Exception
If something horribly wrong happens.

Overrides

ICanBoogie\SaveOperation::validate
protected array
# process( )

Trigger a Icybee\Modules\Files\File\MoveEvent when the path of the updated record is updated.

Trigger a Icybee\Modules\Files\File\MoveEvent when the path of the updated record is updated.

Returns

array
An array composed of the save mode ('update' or 'new') and the record's key.

Throws

Exception
when saving the record fails.

Overrides

Icybee\Modules\Nodes\SaveOperation::process
protected
# resolve_request_file_from_pathname( mixed $pathname )

Methods inherited from Icybee\Modules\Nodes\SaveOperation

lazy_get_form()

Methods inherited from ICanBoogie\SaveOperation

control_record(), get_controls(), lazy_get_record()

Methods inherited from ICanBoogie\Operation

__construct(), control_authentication(), control_form(), control_method(), control_ownership(), control_permission(), control_session_token(), encode(), format_class_name(), from(), from_module_request(), from_request(), from_route(), get_is_forwarded(), get_module(), get_request(), get_response(), reset()

Methods inherited from ICanBoogie\Object

resolve_facade_properties(), resolve_private_properties(), to_array(), to_json()

Methods inherited from ICanBoogie\ToArrayRecursive

to_array_recursive()

Methods used from ICanBoogie\ToArrayRecursiveTrait

to_array_recursive()

Methods used from ICanBoogie\PrototypeTrait

__call(), __get(), __set(), __sleep(), __wakeup(), get_prototype(), has_method(), has_property(), last_chance_get(), last_chance_set()

Magic methods summary

Constants summary

string USERFILE 'path'
#

Name of the _userfile_ slot.

Name of the _userfile_ slot.

Constants inherited from ICanBoogie\Operation

CONTROL_AUTHENTICATION, CONTROL_FORM, CONTROL_METHOD, CONTROL_OWNERSHIP, CONTROL_PERMISSION, CONTROL_RECORD, CONTROL_SESSION_TOKEN, DESTINATION, KEY, NAME, RESTFUL_BASE, RESTFUL_BASE_LENGTH, SESSION_TOKEN

Properties summary

protected ICanBoogie\HTTP\File|boolean $file
#

The optional file to save with the record.

The optional file to save with the record.

protected array $accept
#

Accepted file types.

Accepted file types.

Properties inherited from ICanBoogie\Operation

$destination, $form, $format, $key, $method, $module, $properties, $request, $response

Magic properties

public read-only ICanBoogie\HTTP\File|null $file
#

The file associated with the request.

The file associated with the request.

Magic properties inherited from ICanBoogie\Operation

$is_forwarded, $record, $request

Magic properties inherited from ICanBoogie\Object

$prototype

Autodoc API documentation generated by ApiGen 2.8.0