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

  • ActiveRecordCache
  • CollectDependenciesEvent
  • Connection
  • Connections
  • DateTimePropertySupport
  • Helpers
  • Hooks
  • Model
  • Models
  • Query
  • RunTimeActiveRecordCache
  • Statement
  • Table

Interfaces

  • ActiveRecordCacheInterface

Traits

  • CreatedAtProperty
  • DateTimeProperty
  • UpdatedAtProperty

Exceptions

  • ActiveRecordException
  • ConnectionAlreadyEstablished
  • ConnectionNotDefined
  • ConnectionNotEstablished
  • ModelAlreadyInstantiated
  • ModelNotDefined
  • RecordNotFound
  • ScopeNotDefined
  • StatementInvalid

Functions

  • get_model

Class Table

A representation of a database table.

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

Direct known subclasses

ICanBoogie\ActiveRecord\Model

Indirect known subclasses

Icybee\ActiveRecord\Model\Constructor, Icybee\Modules\Articles\Model, Icybee\Modules\Pages\Model, Icybee\Modules\Registry\Model, Icybee\Modules\Sites\Model, Icybee\Modules\Taxonomy\Terms\Model, Icybee\Modules\Taxonomy\Vocabulary\Model, Icybee\Modules\Users\Model, Icybee\Modules\Users\NonceLogin\TicketModel, Icybee\Modules\Users\Roles\Model, Icybee\Modules\Comments\Model, Icybee\Modules\Contents\Model, Icybee\Modules\Files\Model, Icybee\Modules\Forms\Model, Icybee\Modules\Images\Model, Icybee\Modules\Members\Model, Icybee\Modules\Nodes\Model, Icybee\Modules\Pages\ContentModel

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

Methods summary

protected ICanBoogie\ActiveRecord\Database
# get_connection( )

Returns the connection used by the table.

Returns the connection used by the table.

Returns

ICanBoogie\ActiveRecord\Database
protected string
# get_name( )

Returns the name of the table.

Returns the name of the table.

Returns

string
protected string
# get_name_unprefixed( )

Returns the unprefixed name of the table.

Returns the unprefixed name of the table.

Returns

string
protected ICanBoogie\ActiveRecord\mixed
# get_primary( )

Returns the name of the primary key.

Returns the name of the primary key.

Returns

ICanBoogie\ActiveRecord\mixed
protected string
# get_alias( )

Returns the alias of the table.

Returns the alias of the table.

Returns

string
protected array
# get_schema( )

Returns the schema of the table.

Returns the schema of the table.

Returns

array
protected string
# get_parent( )

Returns the parent of the table.

Returns the parent of the table.

Returns

string
public
# __construct( array $attributes )

Initialiazes the following properties: ICanBoogie\ActiveRecord\Table::$alias, ICanBoogie\ActiveRecord\Table::$connection, ICanBoogie\ActiveRecord\Table::$implements, ICanBoogie\ActiveRecord\Table::$name_unprefixed, ICanBoogie\ActiveRecord\Table::$schema and ICanBoogie\ActiveRecord\Table::$parent.

Initialiazes the following properties: ICanBoogie\ActiveRecord\Table::$alias, ICanBoogie\ActiveRecord\Table::$connection, ICanBoogie\ActiveRecord\Table::$implements, ICanBoogie\ActiveRecord\Table::$name_unprefixed, ICanBoogie\ActiveRecord\Table::$schema and ICanBoogie\ActiveRecord\Table::$parent.

Parameters

$attributes
array
$attributes

Throws

InvalidArgumentException
if the ICanBoogie\ActiveRecord\Table::CONNECTION attribute is empty.
public
# __invoke( mixed $query, array $args = [], array $options = [] )

Alias to the ICanBoogie\ActiveRecord\Table::query() method.

Alias to the ICanBoogie\ActiveRecord\Table::query() method.

public
# install( )
public
# uninstall( )
public boolean
# is_installed( )

Checks whether the table is installed.

Checks whether the table is installed.

Returns

boolean
true if the table exists, false otherwise.
protected array
# lazy_get_extended_schema( )

Returns the extended schema.

Returns the extended schema.

Returns

array
public string
# resolve_statement( string $statement )

Resolve statement placeholders.

Resolve statement placeholders.

The following placeholder are replaced:

  • {alias}: The alias of the table.
  • {prefix}: The prefix used for the tables of the connection.
  • {primary}: The primary key of the table.
  • {self}: The name of the table.
  • {self_and_related}: The escaped name of the table and the possible JOIN clauses.

Note: If the table has a multi-column primary keys {primary} is replaced by __multicolumn_primary__<concatened_columns> where <concatened_columns> is a the columns concatenated with an underscore ("_") as separator. For instance, if a table primary key is made of columns "p1" and "p2", {primary} is replaced by __multicolumn_primary__p1_p2. It's not very helpful, but we still have to decide what to do with this.

Parameters

$statement
string
$statement The statement to resolve.

Returns

string
public Database\Statement
# prepare( mixed $query, mixed $options = [] )

Interface to the connection's prepare method.

Interface to the connection's prepare method.

The statement is resolved by the ICanBoogie\ActiveRecord\Table::resolve_statement() method before the call is forwarded.

Returns

Database\Statement
public
# quote( mixed $string, mixed $parameter_type = PDO::PARAM_STR )
public mixed
# execute( mixed $query, array $args = [], array $options = [] )

Executes a statement.

Executes a statement.

The statement is prepared by the ICanBoogie\ActiveRecord\Table::prepare() method before it is executed.

Returns

mixed
public Database\Statement
# query( string $query, array $args = [], array $options = [] )

Interface to the connection's query() method.

Interface to the connection's query() method.

The statement is resolved using the resolve_statement() method and prepared.

Parameters

$query
string
$query
$args
array
$args
$options
array
$options

Returns

Database\Statement
protected
# filter_values( array $values, mixed $extended = false )
public
# save( array $values, mixed $id = null, array $options = [] )
protected
# save_callback( array $values, mixed $id = null, array $options = [] )
public mixed
# insert( array $values, array $options = [] )

Inserts values into the table.

Inserts values into the table.

Parameters

$values
array
$values The values to insert.
$options
array
$options The folowing options can be used: - ignore: Ignore duplicate errors. - on duplicate: specifies the column to update on duplicate, and the values to update them. If true the $values array is used, after the primary keys has been removed.

Returns

mixed
public boolean
# update( array $values, mixed $key )

Update the values of an entry.

Update the values of an entry.

Even if the entry is spread over multiple tables, all the tables are updated in a single step.

Parameters

$values
array
$values
$key
mixed
$key

Returns

boolean
public boolean
# delete( mixed $key )

Deletes a record.

Deletes a record.

Parameters

$key
mixed
$key Identifier of the record.

Returns

boolean
public
# truncate( )
public
# drop( array $options = [] )

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

Magic methods summary

Constants summary

string T_ALIAS 'alias'
#
string T_CONNECTION 'connection'
#
string T_EXTENDS 'extends'
#
string T_IMPLEMENTS 'implements'
#
string T_NAME 'name'
#
string T_SCHEMA 'schema'
#
string ALIAS 'alias'
#
string CONNECTION 'connection'
#
string EXTENDING 'extends'
#
string IMPLEMENTING 'implements'
#
string NAME 'name'
#
string SCHEMA 'schema'
#

Properties summary

protected ICanBoogie\ActiveRecord\Connection $connection
#

A database connection.

A database connection.

protected string $name
#

Name of the table, including the prefix defined by the model's connection.

Name of the table, including the prefix defined by the model's connection.

protected string $name_unprefixed
#

Unprefixed version of the table's name.

Unprefixed version of the table's name.

The "{self}" placeholder used in queries is replaced by the properties value.

protected mixed $primary
#

Primary key of the table, retrieved from the schema defined using the ICanBoogie\ActiveRecord\Table::SCHEMA attribute.

Primary key of the table, retrieved from the schema defined using the ICanBoogie\ActiveRecord\Table::SCHEMA attribute.

protected string $alias
#

Alias for the table's name, which can be defined using the ICanBoogie\ActiveRecord\Table::ALIAS attribute or automatically created.

Alias for the table's name, which can be defined using the ICanBoogie\ActiveRecord\Table::ALIAS attribute or automatically created.

The "{primary}" placeholder used in queries is replaced by the properties value.

protected array $schema
#

Schema for the table.

Schema for the table.

The "{alias}" placeholder used in queries is replaced by the properties value.

protected ICanBoogie\ActiveRecord\Table $parent
#

The parent is used when the table is in a hierarchy, which is the case if the table extends another table.

The parent is used when the table is in a hierarchy, which is the case if the table extends another table.

protected array $implements
#
protected string $update_join
#

SQL fragment for the FROM clause of the query, made of the table's name and alias and those of the hierarchy.

SQL fragment for the FROM clause of the query, made of the table's name and alias and those of the hierarchy.

protected string $select_join
#

SQL fragment for the FROM clause of the query, made of the table's name and alias and those of the related tables, inherited and implemented.

SQL fragment for the FROM clause of the query, made of the table's name and alias and those of the related tables, inherited and implemented.

The "{self_and_related}" placeholder used in queries is replaced by the properties value.

Magic properties

public read-only ICanBoogie\ActiveRecord\Connection $connection
#

Connection used by the table.

Connection used by the table.

public read-only array $schema
#

The schema of the table.

The schema of the table.

public read-only array $extended_schema
#

The extended schema of the table.

The extended schema of the table.

public read-only string $name_unprefixed
#

Unprefixed name of the table.

Unprefixed name of the table.

public read-only mixed $primary
#

Primary key of the table, or null if there is none.

Primary key of the table, or null if there is none.

public read-only string $alias
#

The alias name of the table.

The alias name of the table.

public read-only ICanBoogie\ActiveRecord\Table|null $parent
#

The parent of the table.

The parent of the table.

Magic properties inherited from ICanBoogie\Object

$prototype

Autodoc API documentation generated by ApiGen 2.8.0