ICanBoogie/ActiveRecord master
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • ActiveRecord
      • Driver

Classes

  • ActiveRecordCacheBase
  • BelongsToRelation
  • Connection
  • ConnectionCollection
  • ConnectionOptions
  • DateTimePropertySupport
  • HasManyRelation
  • Helpers
  • Model
  • ModelCollection
  • Query
  • Relation
  • RelationCollection
  • RelationNotDefined
  • RuntimeActiveRecordCache
  • Schema
  • SchemaColumn
  • Statement
  • Table

Interfaces

  • ActiveRecordCache
  • Driver
  • Exception

Traits

  • CreatedAtProperty
  • DateProperty
  • DateTimeProperty
  • FinishAtProperty
  • FinishedAtProperty
  • StartAtProperty
  • StartedAtProperty
  • UpdatedAtProperty

Exceptions

  • ActiveRecordClassNotValid
  • ConnectionAlreadyEstablished
  • ConnectionNotDefined
  • ConnectionNotEstablished
  • DriverNotDefined
  • ModelAlreadyInstantiated
  • ModelNotDefined
  • RecordNotFound
  • ScopeNotDefined
  • StatementInvocationFailed
  • StatementNotValid
  • UnableToSetFetchMode

Functions

  • extract_charset_and_collate
  • get_model

Class ModelCollection

Model collection.

ICanBoogie\ActiveRecord\ModelCollection implements ArrayAccess uses ICanBoogie\Accessor\AccessorTrait (not available)
Namespace: ICanBoogie\ActiveRecord
Located at ActiveRecord/ModelCollection.php

Methods summary

protected
# get_instances( )
protected
# get_definitions( )
protected
# get_connections( )
public
# __construct( ICanBoogie\ActiveRecord\ConnectionCollection $connections, array $definitions = [] )

Initializes the ICanBoogie\ActiveRecord\ModelCollection::$connections and ICanBoogie\ActiveRecord\ModelCollection::$definitions properties.

Initializes the ICanBoogie\ActiveRecord\ModelCollection::$connections and ICanBoogie\ActiveRecord\ModelCollection::$definitions properties.

Parameters

$connections
$definitions
Model definitions.
public boolean
# offsetExists( string $id )

Checks if a model is defined.

Checks if a model is defined.

Parameters

$id
Model identifier.

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public
# offsetSet( string $id, array $definition )

Sets the definition of a model.

Sets the definition of a model.

The Model::ID and Model::NAME are set to the provided id if they are not defined.

Parameters

$id
Model identifier.
$definition
Model definition.

Throws

ICanBoogie\ActiveRecord\ModelAlreadyInstantiated
in attempt to write a model already instantiated.

Implementation of

ArrayAccess::offsetSet()
public ICanBoogie\ActiveRecord\Model
# offsetGet( string $id )

Returns a ICanBoogie\ActiveRecord\Model instance.

Returns a ICanBoogie\ActiveRecord\Model instance.

Parameters

$id
Model identifier.

Returns

ICanBoogie\ActiveRecord\Model

Throws

ICanBoogie\ActiveRecord\ModelNotDefined
when the model is not defined.

Implementation of

ArrayAccess::offsetGet()
public
# offsetUnset( string $id )

Unset the definition of a model.

Unset the definition of a model.

Parameters

$id
Model identifier.

Throws

ICanBoogie\ActiveRecord\ModelAlreadyInstantiated

in attempt to unset the definition of an already instantiated model.

Implementation of

ArrayAccess::offsetUnset()
protected array
# resolve_model_attributes( array $attributes )

Resolves model attributes.

Resolves model attributes.

The methods replaces Model::CONNECTION and Model::EXTENDING identifier with instances.

Parameters

$attributes

Returns

array
protected ICanBoogie\ActiveRecord\Model
# instantiate_model( array $attributes )

Instantiate a model with the specified attributes.

Instantiate a model with the specified attributes.

Parameters

$attributes

Returns

ICanBoogie\ActiveRecord\Model
public ICanBoogie\ActiveRecord\ModelCollection
# install( )

Install all the models.

Install all the models.

Returns

ICanBoogie\ActiveRecord\ModelCollection
public ICanBoogie\ActiveRecord\ModelCollection
# uninstall( )

Uninstall all the models.

Uninstall all the models.

Returns

ICanBoogie\ActiveRecord\ModelCollection
public array
# is_installed( )

Check if models are installed.

Check if models are installed.

Returns

array

An array of key/value pair where key is a model identifier and value true if the model is installed, false otherwise.

Properties summary

protected ICanBoogie\ActiveRecord\Model[] $instances

Instantiated models.

Instantiated models.

# []
protected array $definitions

Models definitions.

Models definitions.

# []
protected ICanBoogie\ActiveRecord\ConnectionCollection $connections
#

Magic properties

public read-only ICanBoogie\ActiveRecord\ConnectionCollection $connections
public read-only array $definitions
ICanBoogie/ActiveRecord master API documentation generated by ApiGen