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

  • ActiveRecord
  • Cache
  • Configs
  • Core
  • DateTime
  • Debug
  • DeleteOperation
  • Errors
  • Event
  • EventHook
  • Events
  • FileCache
  • FormattedString
  • Helpers
  • I18n
  • Image
  • Inflections
  • Inflector
  • Models
  • Module
  • Modules
  • Object
  • Operation
  • PingOperation
  • Prototype
  • Route
  • Routes
  • SaveOperation
  • Session
  • TimeZone
  • TimeZoneLocation
  • Uploaded
  • Vars
  • VarsIterator

Interfaces

  • StorageInterface
  • ToArray
  • ToArrayRecursive

Traits

  • PrototypeTrait
  • ToArrayRecursiveTrait

Exceptions

  • AlreadyAuthenticated
  • AuthenticationRequired
  • Exception
  • ModuleConstructorMissing
  • ModuleIsDisabled
  • ModuleNotDefined
  • OffsetError
  • OffsetNotDefined
  • OffsetNotReadable
  • OffsetNotWritable
  • PermissionRequired
  • PropertyError
  • PropertyIsReserved
  • PropertyNotDefined
  • PropertyNotReadable
  • PropertyNotWritable
  • RouteNotDefined
  • SecurityException

Constants

  • TOKEN_ALPHA
  • TOKEN_ALPHA_UPCASE
  • TOKEN_NUMERIC
  • TOKEN_SYMBOL
  • TOKEN_SYMBOL_WIDE

Functions

  • array_flatten
  • array_insert
  • array_merge_recursive
  • camelize
  • capitalize
  • downcase
  • dump
  • escape
  • escape_all
  • exact_array_merge_recursive
  • excerpt
  • format
  • generate_token
  • generate_token_wide
  • generate_v4_uuid
  • get_autoconfig
  • humanize
  • hyphenate
  • log
  • log_error
  • log_info
  • log_success
  • log_time
  • normalize
  • normalize_namespace_part
  • normalize_url_path
  • pbkdf2
  • pluralize
  • remove_accents
  • shorten
  • singularize
  • sort_by_weight
  • stable_sort
  • strip_root
  • titleize
  • unaccent_compare
  • unaccent_compare_ci
  • underscore
  • upcase

Class SaveOperation

The "save" operation is used to create or update a record.

ICanBoogie\Object implements ICanBoogie\ToArrayRecursive uses ICanBoogie\ToArrayRecursiveTrait, ICanBoogie\PrototypeTrait
Extended by ICanBoogie\Operation
Extended by ICanBoogie\SaveOperation

Direct known subclasses

Icybee\Modules\Comments\SaveOperation, Icybee\Modules\Nodes\SaveOperation, Icybee\Modules\Sites\SaveOperation, Icybee\Modules\Taxonomy\Terms\SaveOperation, Icybee\Modules\Taxonomy\Vocabulary\SaveOperation, Icybee\Modules\Users\Roles\SaveOperation, Icybee\Operation\Constructor\Save

Indirect known subclasses

Icybee\Modules\Contents\SaveOperation, Icybee\Modules\Files\SaveOperation, Icybee\Modules\Images\SaveOperation, Icybee\Modules\Members\SaveOperation, Icybee\Modules\Pages\SaveOperation, Icybee\Modules\Users\SaveOperation

Namespace: ICanBoogie
Located at vendor/icanboogie/module/lib/operations/save.php

Methods summary

protected array
# get_controls( )

Change controls:

Change controls:

  • CONTROL_PERMISSION: Module::PERMISSION_CREATE
  • CONTROL_OWNERSHIP: true
  • CONTROL_FORM: true

Returns

array

Overrides

ICanBoogie\Operation::get_controls
protected ICanBoogie\ActiveRecord
# lazy_get_record( )

Overrides the getter to prevent exceptions when the operation key is empty.

Overrides the getter to prevent exceptions when the operation key is empty.

Returns

ICanBoogie\ActiveRecord

Overrides

ICanBoogie\Operation::lazy_get_record
protected ICanBoogie\ActiveRecord|null
# control_record( )

Overrides the method in order for the control to pass if the operation key is empty, which is the case when creating a new record.

Overrides the method in order for the control to pass if the operation key is empty, which is the case when creating a new record.

Returns

ICanBoogie\ActiveRecord|null

Overrides

ICanBoogie\Operation::control_record
protected array
# lazy_get_properties( )

Filters out the operation's parameters, which are not defined as fields by the primary model of the module, and take care of filtering or resolving properties values.

Filters out the operation's parameters, which are not defined as fields by the primary model of the module, and take care of filtering or resolving properties values.

Fields defined as 'boolean'

The value of the property is filtered using the filter_var() function and the FILTER_VALIDATE_BOOLEAN filter. If the property in the operation params is empty, the property value is set the false.

Fields defined as 'varchar'

If the property is not empty in the operation params, the property value is trimed using the trim() function, ensuring that there is no leading or trailing white spaces.

Returns

array
The properties of the operation.

Overrides

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

The method simply returns true.

The method simply returns true.

Returns

boolean
true if the operation is valid, false otherwise.

Throws

Exception
If something horribly wrong happens.
protected array
# process( )

Creates or updates a record in the module's primary model.

Creates or updates a record in the module's primary model.

A record is created if the operation's key is empty, otherwise an existing record is updated.

The method uses the properties property to get the properties used to create or update the record.

Returns

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

Throws

ICanBoogie\Exception
when saving the record fails.

Methods inherited from ICanBoogie\Operation

__construct(), __invoke(), control(), 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(), lazy_get_form(), 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

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

Properties inherited from ICanBoogie\Operation

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

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