Yii Framework 3.0 API Documentation
This is the Yii Framework API Documentation. Here you will find detailed information about all classes provided by the Framework. Below you find a list of the existing classes, interfaces, and traits, ordered by their fully qualified name (including the namespace). Each of them has a dedicated page which contains a description about the purpose of the class, a list of the available methods, properties and constants, and detailed description on how to use each of them.
On this page you find all the classes included in version 3.0 of the framework. You can use the dropdown menu on the top right to switch between versions.
You can search API documentation using the search form on the top.
You can search for class names and also method and property names, e.g. ActiveRecord.save() or just .save() or ::save().
This page is also available in JSON format:curl https://www.yiiframework.com/doc/api/3.0/db -H 'Accept: application/json'
| Class | Description |
|---|---|
| Yiisoft\Db\Cache\SchemaCache | Implements a cache for the database schema information. |
| Yiisoft\Db\Command\AbstractCommand | Represents an SQL statement to execute in a database. |
| Yiisoft\Db\Command\CommandInterface | This interface represents a database command, such as a SELECT, INSERT, UPDATE, or DELETE statement. |
| Yiisoft\Db\Connection\AbstractConnection | Represents a connection to a database. |
| Yiisoft\Db\Connection\ConnectionInterface | This interface provides methods for establishing a connection to a database, executing SQL statements, and performing other tasks related to interacting with a database. |
| Yiisoft\Db\Connection\ConnectionProvider | ConnectionProvider is used to manage DB connections. |
| Yiisoft\Db\Connection\ServerInfoInterface | Should be implemented by a class that provides information about the database server. |
| Yiisoft\Db\Constant\ColumnInfoSource | Defines the possible sources of column information. |
| Yiisoft\Db\Constant\ColumnType | Defines the available abstract column types. |
| Yiisoft\Db\Constant\DataType | Types of data. |
| Yiisoft\Db\Constant\GettypeResult | The following constants are returned by {@see gettype()} function. |
| Yiisoft\Db\Constant\IndexType | Defines the available index types for {@see DDLQueryBuilderInterface::createIndex()} method. |
| Yiisoft\Db\Constant\PseudoType | Defines the available column pseudo-types. |
| Yiisoft\Db\Constant\ReferentialAction | ReferentialAction represents the possible foreign key actions that can be performed on the referenced table. |
| Yiisoft\Db\Constraint\Check | Represents a CHECK constraint in a database. |
| Yiisoft\Db\Constraint\ConstraintSchemaInterface | Defines the methods to get information about database constraints: |
| Yiisoft\Db\Constraint\DefaultValue | Represents a default value constraint in a database. |
| Yiisoft\Db\Constraint\ForeignKey | Represents a foreign key constraint in a database. |
| Yiisoft\Db\Constraint\Index | Represents an index constraint in a database. |
| Yiisoft\Db\Debug\CommandInterfaceProxy | |
| Yiisoft\Db\Debug\ConnectionInterfaceProxy | |
| Yiisoft\Db\Debug\DatabaseCollector | |
| Yiisoft\Db\Debug\TransactionInterfaceDecorator | |
| Yiisoft\Db\Driver\DriverInterface | Represents a database driver. |
| Yiisoft\Db\Driver\Pdo\AbstractPdoCommand | Represents a database command that can be executed using a PDO (PHP Data Object) database connection. |
| Yiisoft\Db\Driver\Pdo\AbstractPdoConnection | Represents a connection to a database using the PDO (PHP Data Objects) extension. |
| Yiisoft\Db\Driver\Pdo\AbstractPdoDriver | Serves as the base class for creating PDO (PHP Data Objects) drivers. |
| Yiisoft\Db\Driver\Pdo\AbstractPdoSchema | Represents a schema for a PDO (PHP Data Object) connection. |
| Yiisoft\Db\Driver\Pdo\AbstractPdoTransaction | Represents a DB transaction. |
| Yiisoft\Db\Driver\Pdo\LogType | |
| Yiisoft\Db\Driver\Pdo\PdoCommandInterface | This interface defines the method {@see getPdoStatement()} that must be implemented by {@see \PDO}. |
| Yiisoft\Db\Driver\Pdo\PdoConnectionInterface | This interface defines a set of methods to implement in a class that allows to connect to a database with {@see PDO} (PHP Data Objects). |
| Yiisoft\Db\Driver\Pdo\PdoDataReader | Provides an abstract way to read data from a database. |
| Yiisoft\Db\Driver\Pdo\PdoDriverInterface | This interface provides a set of methods to implement by {@see PDO} (PHP Data Objects) driver classes. |
| Yiisoft\Db\Driver\Pdo\PdoServerInfo | |
| Yiisoft\Db\Exception\ConvertException | Converts an exception into a more specific one. |
| Yiisoft\Db\Exception\Exception | Represents an exception that's caused by some DB-related operations. |
| Yiisoft\Db\Exception\IntegrityException | Represents an exception caused by a violation of a database integrity constraint. |
| Yiisoft\Db\Exception\InvalidCallException | Represents an exception caused by calling a method in the wrong way. |
| Yiisoft\Db\Exception\InvalidConfigException | Represents an exception caused by the wrong object configuration. |
| Yiisoft\Db\Exception\NotSupportedException | Represents an exception caused by accessing features that aren't supported by the underlying DBMS. |
| Yiisoft\Db\Exception\PsrInvalidArgumentException | Represents an exception that's caused by invalid operations of cache. |
| Yiisoft\Db\Expression\CompositeExpression | Represents a composite expression consisting of multiple expressions. |
| Yiisoft\Db\Expression\CompositeExpressionBuilder | Builds a SQL representation of a {@see CompositeExpression}. |
| Yiisoft\Db\Expression\Expression | Represents a DB expression that doesn't need escaping or quoting. |
| Yiisoft\Db\Expression\ExpressionBuilder | It's used to build expressions for use in database queries. |
| Yiisoft\Db\Expression\ExpressionBuilderInterface | This interface defines the methods to build database expressions, such as conditions for a SELECT statement or values to insert into a table. |
| Yiisoft\Db\Expression\ExpressionInterface | This interface defines a set of methods that an object should implement to represent an expression in database queries, such as one for filtering or ordering results. |
| Yiisoft\Db\Expression\Function\ArrayMerge | Represents an SQL expression that returns the merged array from a list of operands. |
| Yiisoft\Db\Expression\Function\Builder\GreatestBuilder | Builds SQL GREATEST() function expressions for {@see Greatest} objects. |
| Yiisoft\Db\Expression\Function\Builder\LeastBuilder | Builds SQL LEAST() function expressions for {@see Least} objects. |
| Yiisoft\Db\Expression\Function\Builder\LengthBuilder | Builds SQL LENGTH() function expressions for {@see Length} objects. |
| Yiisoft\Db\Expression\Function\Builder\LongestBuilder | Builds SQL representation of function expressions which returns the longest string from a set of operands. |
| Yiisoft\Db\Expression\Function\Builder\MultiOperandFunctionBuilder | Base class for building SQL representation of multi-operand function expressions. |
| Yiisoft\Db\Expression\Function\Builder\ShortestBuilder | Builds SQL representation of function expressions which return the shortest string from a set of operands. |
| Yiisoft\Db\Expression\Function\Greatest | Represents a SQL GREATEST() function that returns the greatest value from a list of values or expressions. |
| Yiisoft\Db\Expression\Function\Least | Represents a SQL LEAST() function that returns the least value from a list of values or expressions. |
| Yiisoft\Db\Expression\Function\Length | Represents a SQL LENGTH() function that returns the length of string represented as an expression. |
| Yiisoft\Db\Expression\Function\Longest | Represents SQL expression that returns the longest string from a list of operands. |
| Yiisoft\Db\Expression\Function\MultiOperandFunction | Base class for functions that operate on multiple operands with the same type. |
| Yiisoft\Db\Expression\Function\Shortest | Represents SQL expression that returns the shortest string from a list of operands. |
| Yiisoft\Db\Expression\Statement\Builder\CaseXBuilder | Builds expressions for {@see CaseX}. |
| Yiisoft\Db\Expression\Statement\CaseX | Represents a SQL CASE expression. |
| Yiisoft\Db\Expression\Statement\WhenThen | Represents the condition and the result of a WHEN-THEN clause in a SQL CASE statement. |
| Yiisoft\Db\Expression\Value\ArrayValue | Represents an array SQL expression. |
| Yiisoft\Db\Expression\Value\Builder\AbstractArrayValueBuilder | Abstract expression builder for {@see ArrayValue}. |
| Yiisoft\Db\Expression\Value\Builder\AbstractStructuredValueBuilder | Abstract expression builder for {@see StructuredValue}. |
| Yiisoft\Db\Expression\Value\Builder\ArrayValueBuilder | Default expression builder for {@see ArrayValue}. Builds an expression as a JSON. |
| Yiisoft\Db\Expression\Value\Builder\ColumnNameBuilder | Builder for {@see ColumnName} expressions. |
| Yiisoft\Db\Expression\Value\Builder\DateTimeValueBuilder | Builder for {@see DateTimeValue} expressions. |
| Yiisoft\Db\Expression\Value\Builder\JsonValueBuilder | Builds expressions for {@see JsonValue}. |
| Yiisoft\Db\Expression\Value\Builder\ParamBuilder | Implements the {@see ExpressionBuilderInterface} interface, is used to build {@see Param} objects. |
| Yiisoft\Db\Expression\Value\Builder\StructuredValueBuilder | Default expression builder for {@see StructuredValue}. Builds an expression as a JSON. |
| Yiisoft\Db\Expression\Value\Builder\ValueBuilder | Builder for {@see Value} expressions that converts values into SQL parameters. |
| Yiisoft\Db\Expression\Value\ColumnName | Represents a column name expression for SQL queries. |
| Yiisoft\Db\Expression\Value\DateTimeValue | Represents a value that should be treated as a date and time value for specific column type. |
| Yiisoft\Db\Expression\Value\JsonValue | Represents data to encode to JSON. |
| Yiisoft\Db\Expression\Value\Param | Represents a parameter used in building an SQL statement. |
| Yiisoft\Db\Expression\Value\StructuredValue | Represents a structured type SQL expression. |
| Yiisoft\Db\Expression\Value\Value | Represents a value for SQL queries. |
| Yiisoft\Db\Helper\DbArrayHelper | Array manipulation methods. |
| Yiisoft\Db\Helper\DbStringHelper | String manipulation methods. |
| Yiisoft\Db\Helper\DbUuidHelper | |
| Yiisoft\Db\Profiler\ContextInterface | Profiling context. |
| Yiisoft\Db\Profiler\Context\AbstractContext | |
| Yiisoft\Db\Profiler\Context\CommandContext | |
| Yiisoft\Db\Profiler\Context\ConnectionContext | |
| Yiisoft\Db\Profiler\ProfilerAwareInterface | |
| Yiisoft\Db\Profiler\ProfilerAwareTrait | Provides access to the database profiler, a tool for collecting and analyzing database queries. |
| Yiisoft\Db\Profiler\ProfilerInterface | Interface-decorator to work with yiisoft\profiler or another profiler. |
| Yiisoft\Db\QueryBuilder\AbstractColumnDefinitionBuilder | Builds column definition from {@see ColumnInterface} object. Column definition is a string that represents
the column type and all constraints associated with the column. For example: VARCHAR(128) NOT NULL DEFAULT 'foo'. |
| Yiisoft\Db\QueryBuilder\AbstractDDLQueryBuilder | It's used to create and change the structure of database objects in a database. |
| Yiisoft\Db\QueryBuilder\AbstractDMLQueryBuilder | It's used to manipulate data in tables. |
| Yiisoft\Db\QueryBuilder\AbstractDQLQueryBuilder | It's used to query data from a database. |
| Yiisoft\Db\QueryBuilder\AbstractQueryBuilder | Builds a SELECT SQL statement based on the specification given as a {@see QueryInterface} object. |
| Yiisoft\Db\QueryBuilder\ColumnDefinitionBuilderInterface | |
| Yiisoft\Db\QueryBuilder\Condition\AbstractBetween | Condition that's represented BETWEEN or NOT BETWEEN operator is used to check if a value is between two values. |
| Yiisoft\Db\QueryBuilder\Condition\AbstractCompare | Abstract condition that represents comparison operators. |
| Yiisoft\Db\QueryBuilder\Condition\AbstractExists | Represents EXISTS and NOT EXISTS operators. |
| Yiisoft\Db\QueryBuilder\Condition\AbstractIn | Represents IN and NOT IN operators. |
| Yiisoft\Db\QueryBuilder\Condition\AbstractLike | Condition that represents LIKE operator. |
| Yiisoft\Db\QueryBuilder\Condition\AbstractOverlaps | The base class for classes representing the array and JSON overlaps conditions. |
| Yiisoft\Db\QueryBuilder\Condition\All | Represents condition that always evaluates to true. |
| Yiisoft\Db\QueryBuilder\Condition\AndX | Condition that connects two or more SQL expressions with the AND operator. |
| Yiisoft\Db\QueryBuilder\Condition\ArrayOverlaps | Condition that represents ARRAY OVERLAPS operator is used to check if a column of array type overlaps another array. |
| Yiisoft\Db\QueryBuilder\Condition\Between | Condition that's represented BETWEEN operator is used to check if a value is between two values. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\AllBuilder | Builds SQL expressions for {@see All} condition. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\BetweenBuilder | Build an object of {@see Between} or {@see NotBetween} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\CompareBuilder | Build objects of {@see Equals}, {@see NotEquals}, {@see GreaterThan}, {@see GreaterThanOrEqual}, {@see LessThan}, or {@see LessThanOrEqual} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\ExistsBuilder | Build an object of {@see Exists} or {@see NotExists} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\InBuilder | Build an object of {@see In} or {@see NotIn} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\LikeBuilder | Build an object of {@see Like} or {@see NotLike} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\LogicalBuilder | Build an object of {@see AndX} or {@see OrX} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\NoneBuilder | Builds SQL expressions for {@see None} condition. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\NotBuilder | Build an object of {@see Not} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\Builder\SimpleBuilder | Build an object of {@see Simple} into SQL expressions. |
| Yiisoft\Db\QueryBuilder\Condition\ConditionInterface | Should be implemented by classes that represent a condition in the {@see \Yiisoft\Db\QueryBuilder\QueryBuilder}. |
| Yiisoft\Db\QueryBuilder\Condition\Equals | Represents an equality condition like "column" = value. |
| Yiisoft\Db\QueryBuilder\Condition\Exists | Condition that represents EXISTS operator that checks whether a sub-query returns any rows. |
| Yiisoft\Db\QueryBuilder\Condition\GreaterThan | Represents a greater than condition like "column" > value. |
| Yiisoft\Db\QueryBuilder\Condition\GreaterThanOrEqual | Represents a greater than or equal condition like "column" >= value. |
| Yiisoft\Db\QueryBuilder\Condition\In | Condition that represents IN operator. |
| Yiisoft\Db\QueryBuilder\Condition\JsonOverlaps | Condition that represents JSON OVERLAPS operator and is used to check if a column of JSON type overlaps an array. |
| Yiisoft\Db\QueryBuilder\Condition\LessThan | Represents a less than condition like "column" < value. |
| Yiisoft\Db\QueryBuilder\Condition\LessThanOrEqual | Represents a less than or equal condition like "column" <= value. |
| Yiisoft\Db\QueryBuilder\Condition\Like | |
| Yiisoft\Db\QueryBuilder\Condition\None | Represents condition that always evaluates to false. |
| Yiisoft\Db\QueryBuilder\Condition\Not | Condition that represents NOT operator (negation). |
| Yiisoft\Db\QueryBuilder\Condition\NotBetween | Condition that's represented NOT BETWEEN operator is used to check if a value is not between two values. |
| Yiisoft\Db\QueryBuilder\Condition\NotEquals | Represents a not equals condition like "column" <> value. |
| Yiisoft\Db\QueryBuilder\Condition\NotExists | Condition that represents NOT EXISTS operator that checks if a sub-query returns no rows. |
| Yiisoft\Db\QueryBuilder\Condition\NotIn | Condition that represents NOT IN operator. |
| Yiisoft\Db\QueryBuilder\Condition\NotLike | |
| Yiisoft\Db\QueryBuilder\Condition\OrX | Condition that connects two or more SQL expressions with the OR operator. |
| Yiisoft\Db\QueryBuilder\Condition\Simple | Represents a simple condition like "column" operator value. |
| Yiisoft\Db\QueryBuilder\DDLQueryBuilderInterface | Defines methods for building SQL statements for DDL (data definition language). |
| Yiisoft\Db\QueryBuilder\DMLQueryBuilderInterface | Defines methods for building SQL statements for DML (data manipulation language). |
| Yiisoft\Db\QueryBuilder\DQLQueryBuilderInterface | Defines methods for building SQL statements for DQL (data query language). |
| Yiisoft\Db\QueryBuilder\QueryBuilderInterface | Defines the common interface to be implemented by query builder classes. |
| Yiisoft\Db\Query\BatchQueryResult | Represents the result of a batch query execution. |
| Yiisoft\Db\Query\BatchQueryResultInterface | This interface represents a batch query from which you can retrieve data in batches. |
| Yiisoft\Db\Query\DataReaderInterface | This interface represents a forward-only stream of rows from a query result set. |
| Yiisoft\Db\Query\Query | Represents a SELECT SQL statement in a way that's independent of DBMS. |
| Yiisoft\Db\Query\QueryExpressionBuilder | Used internally to build a {@see Query} object using unified {@see \Yiisoft\Db\QueryBuilder\AbstractQueryBuilder} expression building interface. |
| Yiisoft\Db\Query\QueryFunctionsInterface | A query function is a function that's called in a query to perform operation on the data selected or updated. |
| Yiisoft\Db\Query\QueryInterface | Defines several methods for building and executing database queries, including methods for selecting data, inserting data, updating data, and deleting data. |
| Yiisoft\Db\Query\QueryPartsInterface | This interface defines a set of methods to create and manipulate the different parts of a database query, such as the {@see addGroupBy()}, {@see addSelect()}, {@see addOrderBy()}, {@see andFilterCompare()}, etc. |
| Yiisoft\Db\Query\WithQuery | Represents a common table expression (CTE) for SQL WITH queries. |
| Yiisoft\Db\Schema\AbstractSchema | Provides a set of methods for working with database schemas such as creating, modifying, and inspecting tables, columns, and other database objects. |
| Yiisoft\Db\Schema\Column\AbstractArrayColumn | Represents an abstract array column. |
| Yiisoft\Db\Schema\Column\AbstractColumn | Represents the metadata of a column in a database table. |
| Yiisoft\Db\Schema\Column\AbstractColumnFactory | The default implementation of the {@see ColumnFactoryInterface}. |
| Yiisoft\Db\Schema\Column\AbstractJsonColumn | Represents an abstract JSON column. |
| Yiisoft\Db\Schema\Column\AbstractStructuredColumn | Represents an abstract structured column. |
| Yiisoft\Db\Schema\Column\ArrayColumn | Represents an array column with eager parsing values retrieved from the database. |
| Yiisoft\Db\Schema\Column\ArrayLazyColumn | Represents an array column with lazy parsing values retrieved from the database. |
| Yiisoft\Db\Schema\Column\BigIntColumn | Represents the metadata for a bigint column. |
| Yiisoft\Db\Schema\Column\BinaryColumn | Represents the metadata for a binary column. |
| Yiisoft\Db\Schema\Column\BitColumn | Represents the metadata for a bit column. |
| Yiisoft\Db\Schema\Column\BooleanColumn | Represents the metadata for a boolean column. |
| Yiisoft\Db\Schema\Column\CollatableColumnInterface | Represents a column with collation. |
| Yiisoft\Db\Schema\Column\ColumnBuilder | Column builder for database {@see ColumnInterface} instances. |
| Yiisoft\Db\Schema\Column\ColumnFactoryInterface | The interface must be implemented by a column factory class. It should create an instance of {@see ColumnInterface} for a database column type and initialize column information. |
| Yiisoft\Db\Schema\Column\ColumnInterface | This interface defines a set of methods that must be implemented by a class that represents a database table column. |
| Yiisoft\Db\Schema\Column\DateTimeColumn | Represents the metadata for a datetime column. |
| Yiisoft\Db\Schema\Column\DoubleColumn | Represents the metadata for a double column. |
| Yiisoft\Db\Schema\Column\EnumColumn | |
| Yiisoft\Db\Schema\Column\IntegerColumn | Represents the schema for an integer column. |
| Yiisoft\Db\Schema\Column\JsonColumn | Represents a JSON column with eager parsing values retrieved from the database. |
| Yiisoft\Db\Schema\Column\JsonLazyColumn | Represents a JSON column with lazy parsing values retrieved from the database. |
| Yiisoft\Db\Schema\Column\StringColumn | Represents the metadata for a string column. |
| Yiisoft\Db\Schema\Column\StructuredColumn | Represents a structured column with eager parsing values retrieved from the database. |
| Yiisoft\Db\Schema\Column\StructuredLazyColumn | Represents a structured column with lazy parsing values retrieved from the database. |
| Yiisoft\Db\Schema\Data\AbstractLazyArray | Represents an array value retrieved from the database. |
| Yiisoft\Db\Schema\Data\AbstractStructuredLazyArray | Represents an array value of a structured type retrieved from the database. |
| Yiisoft\Db\Schema\Data\JsonLazyArray | Represents a JSON array value retrieved from the database. |
| Yiisoft\Db\Schema\Data\LazyArray | Represents a JSON array value retrieved from the database. |
| Yiisoft\Db\Schema\Data\LazyArrayInterface | The interface for classes that represent an array with lazy parsing of data retrieved from the database. |
| Yiisoft\Db\Schema\Data\LazyArrayTrait | Provides a common implementation for {@see AbstractLazyArray}, {@see AbstractStructuredLazyArray} and {@see JsonLazyArray}. |
| Yiisoft\Db\Schema\Data\StringableStream | Represents a resource stream to be used as a {@see Stringable} value. |
| Yiisoft\Db\Schema\Data\StructuredLazyArray | Represents a structured JSON array value retrieved from the database. |
| Yiisoft\Db\Schema\Quoter | The Quoter is a class that's used to quote table and column names for use in SQL statements. |
| Yiisoft\Db\Schema\QuoterInterface | This interface provides a set of methods to quote table and column names, values, and other SQL expressions independently of the database. |
| Yiisoft\Db\Schema\SchemaInterface | Represents the schema for a database table. |
| Yiisoft\Db\Schema\TableSchema | Represents the metadata of a database table. |
| Yiisoft\Db\Schema\TableSchemaInterface | Represents the metadata of a database table. |
| Yiisoft\Db\Syntax\AbstractSqlParser | SQL parser. |
| Yiisoft\Db\Syntax\ColumnDefinitionParser | Parses column definition string. For example, string(255) or int unsigned. |
| Yiisoft\Db\Transaction\TransactionInterface | Defines the interface for a database transaction. |
Signup or Login in order to comment.