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

  • Constructor

Class Constructor

This is the super class for all models using the _constructor_ model (currently "nodes" and "users"). It provides support for the constructor property whether it is for saving records or filtering them through the own scope.

ICanBoogie\Object implements ICanBoogie\ToArrayRecursive uses ICanBoogie\ToArrayRecursiveTrait, ICanBoogie\PrototypeTrait
Extended by ICanBoogie\ActiveRecord\Table
Extended by ICanBoogie\ActiveRecord\Model implements ArrayAccess
Extended by Icybee\ActiveRecord\Model\Constructor

Direct known subclasses

Icybee\Modules\Nodes\Model, Icybee\Modules\Users\Model

Indirect known subclasses

Icybee\Modules\Articles\Model, Icybee\Modules\Contents\Model, Icybee\Modules\Files\Model, Icybee\Modules\Forms\Model, Icybee\Modules\Images\Model, Icybee\Modules\Members\Model, Icybee\Modules\Pages\Model

Namespace: Icybee\ActiveRecord\Model
Located at vendor/icybee/core/lib/activerecord/model.constructor.php

Methods summary

public
# __construct( array $attributes )

Override the constructor to provide support for the ICanBoogie\ActiveRecord\Model::ACTIVERECORD_CLASS tag and extended support for the ICanBoogie\ActiveRecord\Table::EXTENDING tag.

Override the constructor to provide support for the ICanBoogie\ActiveRecord\Model::ACTIVERECORD_CLASS tag and extended support for the ICanBoogie\ActiveRecord\Table::EXTENDING tag.

If ICanBoogie\ActiveRecord\Table::EXTENDING is defined but the model has no schema (ICanBoogie\ActiveRecord\Table::SCHEMA is empty), the name of the model and the schema are inherited from the extended model and ICanBoogie\ActiveRecord\Table::EXTENDING is set to the parent model object. If ICanBoogie\ActiveRecord\Model::ACTIVERECORD_CLASS is empty, its value is set to the extended model's active record class.

If ICanBoogie\ActiveRecord\Model::ACTIVERECORD_CLASS is set, its value is saved in the ICanBoogie\ActiveRecord\Model::$activerecord_class property.

Parameters

$attributes
array
$tags Tags used to construct the model.

Throws

InvalidArgumentException
if the ICanBoogie\ActiveRecord\Table::CONNECTION attribute is empty.

Overrides

ICanBoogie\ActiveRecord\Model::__construct
public
# save( array $properties, mixed $key = null, array $options = array() )

Overwrites the constructor property of new records.

Overwrites the constructor property of new records.

Overrides

ICanBoogie\ActiveRecord\Model::save
public ActiveRecord|array
# find( mixed $key )

Makes sure that records are found using their true constructor.

Makes sure that records are found using their true constructor.

Parameters

$key
mixed
$key A key or an array of keys.

Returns

ActiveRecord|array
A record or a set of records.

Throws

ICanBoogie\ActiveRecord\RecordNotFound
when the record, or one or more records of the records set, could not be found.

Overrides

ICanBoogie\ActiveRecord\Model::find
public array
# find_using_constructor( array $keys )

Finds records using their constructor.

Finds records using their constructor.

Unlike Icybee\ActiveRecord\Model\Constructor::find() this method is designed to find records that where created by different constructors. The result is the same, bu where Icybee\ActiveRecord\Model\Constructor::find() uses a new request for each record that is not created by the current model, this method only needs one query by constructor plus one extra query.

Parameters

$keys
array
$keys

Returns

array

Throws

ICanBoogie\ActiveRecord\RecordNotFound
If a record was not found.
protected ICanBoogie\ActiveRecord\Query
# scope_own( ICanBoogie\ActiveRecord\Query $query )

Adds the "constructor = <constructor>" condition to the query.

Adds the "constructor = <constructor>" condition to the query.

Parameters

$query
ICanBoogie\ActiveRecord\Query
$query The query to alter.

Returns

ICanBoogie\ActiveRecord\Query

Methods inherited from ICanBoogie\ActiveRecord\Model

__call(), __get(), belongs_to(), delete(), eliminate(), get_activerecord_class(), get_all(), get_count(), get_exists(), get_id(), get_one(), has_scope(), new_record(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), retrieve(), scope(), store()

Methods inherited from ICanBoogie\ActiveRecord\Table

__invoke(), drop(), execute(), filter_values(), get_alias(), get_connection(), get_name(), get_name_unprefixed(), get_parent(), get_primary(), get_schema(), insert(), install(), is_installed(), lazy_get_extended_schema(), prepare(), query(), quote(), resolve_statement(), save_callback(), truncate(), uninstall(), update()

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

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

Magic methods summary

Magic methods inherited from ICanBoogie\ActiveRecord\Model

all(), average(), count(), exists(), group(), joins(), limit(), maximum(), minimum(), offset(), one(), order(), select(), sum(), where()

Constants summary

string T_CONSTRUCTOR 'constructor'
#

Constants inherited from ICanBoogie\ActiveRecord\Model

ACTIVERECORD_CLASS, BELONGS_TO, CLASSNAME, ID, T_ACTIVERECORD_CLASS, T_CLASS, T_ID

Constants inherited from ICanBoogie\ActiveRecord\Table

ALIAS, CONNECTION, EXTENDING, IMPLEMENTING, NAME, SCHEMA, T_ALIAS, T_CONNECTION, T_EXTENDS, T_IMPLEMENTS, T_NAME, T_SCHEMA

Properties summary

protected mixed $constructor
#

Properties inherited from ICanBoogie\ActiveRecord\Model

$activerecord_class, $attributes

Properties inherited from ICanBoogie\ActiveRecord\Table

$alias, $connection, $implements, $name, $name_unprefixed, $parent, $primary, $schema, $select_join, $update_join

Magic properties inherited from ICanBoogie\ActiveRecord\Model

$activerecord_cache, $activerecord_class, $all, $count, $exists, $id

Magic properties inherited from ICanBoogie\ActiveRecord\Table

$alias, $connection, $extended_schema, $name_unprefixed, $parent, $primary, $schema

Magic properties inherited from ICanBoogie\Object

$prototype

Autodoc API documentation generated by ApiGen 2.8.0