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 ActiveRecord

Active Record faciliates the creation and use of business objects whose data require persistent storage via database.

ICanBoogie\Object implements ICanBoogie\ToArrayRecursive uses ICanBoogie\ToArrayRecursiveTrait, ICanBoogie\PrototypeTrait
Extended by ICanBoogie\ActiveRecord

Direct known subclasses

Icybee\Modules\Comments\Comment, Icybee\Modules\Contents\Rendered, Icybee\Modules\Users\User, Icybee\Modules\Nodes\Node, Icybee\Modules\Pages\Content, Icybee\Modules\Registry\Entry, Icybee\Modules\Sites\Site, Icybee\Modules\Taxonomy\Terms\Term, Icybee\Modules\Taxonomy\Vocabulary\Vocabulary, Icybee\Modules\Users\NonceLogin\Ticket, Icybee\Modules\Users\Roles\Role

Indirect known subclasses

Icybee\Modules\Articles\Article, Icybee\Modules\Contents\Content, Icybee\Modules\Files\File, Icybee\Modules\Forms\Form, Icybee\Modules\Images\Image, Icybee\Modules\Members\Member, Icybee\Modules\Pages\Page

Namespace: ICanBoogie
Located at vendor/icanboogie/activerecord/lib/activerecord.php

Methods summary

public
# __construct( string|ICanBoogie\ActiveRecord\Model $model )

Initializes the $model and ICanBoogie\ActiveRecord::$model_id properties.

Initializes the $model and ICanBoogie\ActiveRecord::$model_id properties.

Parameters

$model
string|ICanBoogie\ActiveRecord\Model
$model The model managing the active record. A ICanBoogie\ActiveRecord\Model instance can be specified as well as a model identifier. If a model identifier is specified, the model is resolved when the $model property is accessed.

Throws

InvalidArgumentException
if $model is neither a model identifier nor a ICanBoogie\ActiveRecord\Model instance.
public array
# __sleep( )

Removes the $model property.

Removes the $model property.

Properties whose value are instances of the ICanBoogie\ActiveRecord class are removed from the exported properties.

Returns

array

Overrides

ICanBoogie\Object::__sleep
protected ICanBoogie\ActiveRecord\Model
# get_model( )

Returns the model managing the active record.

Returns the model managing the active record.

This getter is used when the model has been provided as a string during construct.

Returns

ICanBoogie\ActiveRecord\Model
protected string
# get_model_id( )

Returns the identifier of the model managing the active record.

Returns the identifier of the model managing the active record.

The getter is used to provide read-only access to the property.

Returns

string
public integer
# save( )

Saves the active record using its model.

Saves the active record using its model.

Returns

integer
Primary key value of the active record.
protected array
# alter_persistent_properties( array $properties, ICanBoogie\ActiveRecord\Model $model )

Unless it's an acceptable value for a column, columns with null values are discarted. This way, we don't have to define every properties before saving our active record.

Unless it's an acceptable value for a column, columns with null values are discarted. This way, we don't have to define every properties before saving our active record.

Parameters

$properties
array
$properties
$model

Returns

array
The altered persistent properties
public boolean
# delete( )

Deletes the active record using its model.

Deletes the active record using its model.

Returns

boolean
true if the record was deleted, false otherwise.

Methods inherited from ICanBoogie\Object

from(), 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(), __wakeup(), get_prototype(), has_method(), has_property(), last_chance_get(), last_chance_set()

Magic methods summary

Properties summary

protected string $model_id
#

Identifier of the model managing the active record.

Identifier of the model managing the active record.

Note: Due to a PHP bug (or feature), the visibility of the property MUST NOT be private. https://bugs.php.net/bug.php?id=40412

Magic properties

public read-only ICanBoogie\ActiveRecord\Model $model
#

The model managing the active record.

The model managing the active record.

public read-only string $model_id
#

The identifier of the model managing the active record.

The identifier of the model managing the active record.

Magic properties inherited from ICanBoogie\Object

$prototype

Autodoc API documentation generated by ApiGen 2.8.0