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 Statement

A database statement.

PDOStatement implements Traversable
Extended by ICanBoogie\ActiveRecord\Statement uses ICanBoogie\Accessor\AccessorTrait (not available)
Namespace: ICanBoogie\ActiveRecord
Located at ActiveRecord/Statement.php

Methods summary

protected
# get_connection( )
protected
# set_connection( ICanBoogie\ActiveRecord\Connection $connection )
public
# __invoke( )

Alias of ICanBoogie\ActiveRecord\Statement::execute().

Alias of ICanBoogie\ActiveRecord\Statement::execute().

The arguments can be provided as an array or a list of arguments: $statement(1, 2, 3); $statement([ 1, 2, 3 ]);

Returns


$this
public
# __toString( )

Return the queryString property of the statement.

Return the queryString property of the statement.

public
# execute( $args = [] )

Executes the statement.

Executes the statement.

The connection queries count is incremented.

Throws

ICanBoogie\ActiveRecord\StatementNotValid
when the execution of the statement fails.

Inheritdoc

Overrides

PDOStatement::execute
public ICanBoogie\ActiveRecord\Statement
# mode( mixed $mode )

Set the fetch mode for the statement.

Set the fetch mode for the statement.

Parameters

$mode

Returns

ICanBoogie\ActiveRecord\Statement
Return the instance.

Throws

ICanBoogie\ActiveRecord\UnableToSetFetchMode
if the mode cannot be set.

See

http://www.php.net/manual/en/pdostatement.setfetchmode.php
public mixed
# one( integer $fetch_style = \PDO::FETCH_BOTH, integer $cursor_orientation = \PDO::FETCH_ORI_NEXT, integer $cursor_offset = 0 )

Fetches the first row of the result set and closes the cursor.

Fetches the first row of the result set and closes the cursor.

Parameters

$fetch_style
$cursor_orientation
$cursor_offset

Returns

mixed

See

PDOStatement::fetch()
protected
# get_one( )

Alias for one().

Alias for one().

public string
# fetchColumnAndClose( integer $column_number = 0 )

Fetches a column of the first row of the result set and closes the cursor.

Fetches a column of the first row of the result set and closes the cursor.

Deprecated

Parameters

$column_number

Returns

string

See

PDOStatement::fetchColumn()
protected
# get_rc( )

Alias for fetchColumnAndClose().

Alias for fetchColumnAndClose().

public
# all( $fetch_style = null, $column_index = null, array $ctor_args = null )

Alias for \PDOStatement::fetchAll()

Alias for \PDOStatement::fetchAll()

protected
# get_all( )

Alias for all().

Alias for all().

protected array
# get_pairs( )

Alias for all(\PDO::FETCH_KEY_PAIR).

Alias for all(\PDO::FETCH_KEY_PAIR).

Returns

array

An array of key/value pairs, where key is the value of the first column and value the value of the second column.

Methods inherited from PDOStatement

__sleep(), __wakeup(), bindColumn(), bindParam(), bindValue(), closeCursor(), columnCount(), debugDumpParams(), errorCode(), errorInfo(), fetch(), fetchAll(), fetchColumn(), fetchObject(), getAttribute(), getColumnMeta(), nextRowset(), rowCount(), setAttribute(), setFetchMode()

Properties summary

Properties inherited from PDOStatement

$queryString

Magic properties

public ICanBoogie\ActiveRecord\Connection $connection

Connection associated with the statement.

public read-only array $all

An array with the matching records.

public read-only array $pairs

An array of key/value pairs, where key is the value of the first column and value the value of the second column.

public read-only mixed $one

The first matching record.

public read-only string $rc

The value of the first column of the first row.

ICanBoogie/ActiveRecord master API documentation generated by ApiGen