diff --git a/docs/model.md b/docs/model.md index e9e0d62..1c34dd2 100644 --- a/docs/model.md +++ b/docs/model.md @@ -20,7 +20,7 @@ A model should list all its available attributes in the `attributes()` method. Attributes may be implemented in various ways. The [[\yii\base\Model]] class implements attributes as public member variables of the class, while the -[[\yii\db\ar\ActiveRecord]] class implements them as DB table columns. For example, +[[\yii\db\ActiveRecord]] class implements them as DB table columns. For example, ~~~php // LoginForm has two attributes: username and password @@ -32,7 +32,7 @@ class LoginForm extends \yii\base\Model // Post is associated with the tbl_post DB table. // Its attributes correspond to the columns in tbl_post -class Post extends \yii\db\ar\ActiveRecord +class Post extends \yii\db\ActiveRecord { public function table() { @@ -65,7 +65,7 @@ whose keys are the scenario names and whose values are the corresponding active attribute lists. Below is an example: ~~~php -class User extends \yii\db\ar\ActiveRecord +class User extends \yii\db\ActiveRecord { public function table() { diff --git a/framework/base/Application.php b/framework/base/Application.php index b38b2a2..fbd0c63 100644 --- a/framework/base/Application.php +++ b/framework/base/Application.php @@ -52,7 +52,7 @@ use yii\base\Exception; * @property CCache $cache Returns the cache component. * @property CPhpMessageSource $coreMessages Returns the core message translations. * @property CDateFormatter $dateFormatter Returns the locale-dependent date formatter. - * @property \yii\db\dao\Connection $db Returns the database connection component. + * @property \yii\db\Connection $db Returns the database connection component. * @property CErrorHandler $errorHandler Returns the error handler component. * @property string $extensionPath Returns the root directory that holds all third-party extensions. * @property string $id Returns the unique identifier for the application. @@ -324,7 +324,7 @@ class Application extends Module /** * Returns the database connection component. - * @return \yii\db\dao\Connection the database connection + * @return \yii\db\Connection the database connection */ public function getDb() { diff --git a/framework/base/Module.php b/framework/base/Module.php index 07005fb..7b00ac7 100644 --- a/framework/base/Module.php +++ b/framework/base/Module.php @@ -501,7 +501,7 @@ abstract class Module extends Component * ~~~ * array( * 'db' => array( - * 'class' => 'yii\db\dao\Connection', + * 'class' => 'yii\db\Connection', * 'dsn' => 'sqlite:path/to/file.db', * ), * 'cache' => array( diff --git a/framework/caching/DbCache.php b/framework/caching/DbCache.php index 2d8b4fd..0eea7d5 100644 --- a/framework/caching/DbCache.php +++ b/framework/caching/DbCache.php @@ -10,8 +10,8 @@ namespace yii\caching; use yii\base\Exception; -use yii\db\dao\Connection; -use yii\db\dao\Query; +use yii\db\Connection; +use yii\db\Query; /** * DbCache implements a cache application component by storing cached data in a database. diff --git a/framework/caching/DbDependency.php b/framework/caching/DbDependency.php index 319483e..1b252ea 100644 --- a/framework/caching/DbDependency.php +++ b/framework/caching/DbDependency.php @@ -10,8 +10,8 @@ namespace yii\caching; use yii\base\Exception; -use yii\db\dao\Connection; -use yii\db\dao\Query; +use yii\db\Connection; +use yii\db\Query; /** * DbDependency represents a dependency based on the query result of a SQL statement. diff --git a/framework/console/create/default/protected/config/main.php b/framework/console/create/default/protected/config/main.php index f0ca5be..1e3f981 100644 --- a/framework/console/create/default/protected/config/main.php +++ b/framework/console/create/default/protected/config/main.php @@ -6,7 +6,7 @@ return array( // uncomment the following to use a MySQL database /* 'db' => array( - 'class' => 'yii\db\dao\Connection', + 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=testdrive', 'username' => 'root', 'password' => '', diff --git a/framework/db/ar/ActiveQuery.php b/framework/db/ActiveQuery.php similarity index 97% rename from framework/db/ar/ActiveQuery.php rename to framework/db/ActiveQuery.php index 11ae08d..3f534f4 100644 --- a/framework/db/ar/ActiveQuery.php +++ b/framework/db/ActiveQuery.php @@ -8,14 +8,14 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\ar; +namespace yii\db; -use yii\db\dao\Connection; -use yii\db\dao\Command; -use yii\db\dao\QueryBuilder; -use yii\db\dao\BaseQuery; +use yii\db\Connection; +use yii\db\Command; +use yii\db\QueryBuilder; +use yii\db\BaseQuery; use yii\base\VectorIterator; -use yii\db\dao\Expression; +use yii\db\Expression; use yii\db\Exception; class ActiveQuery extends BaseQuery diff --git a/framework/db/ar/ActiveRecord.php b/framework/db/ActiveRecord.php similarity index 99% rename from framework/db/ar/ActiveRecord.php rename to framework/db/ActiveRecord.php index 9685909..2424446 100644 --- a/framework/db/ar/ActiveRecord.php +++ b/framework/db/ActiveRecord.php @@ -8,16 +8,16 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\ar; +namespace yii\db; use yii\base\Model; use yii\base\Event; use yii\base\ModelEvent; use yii\db\Exception; -use yii\db\dao\Connection; -use yii\db\dao\TableSchema; -use yii\db\dao\Query; -use yii\db\dao\Expression; +use yii\db\Connection; +use yii\db\TableSchema; +use yii\db\Query; +use yii\db\Expression; use yii\util\StringHelper; /** diff --git a/framework/db/ar/ActiveRecordBehavior.php b/framework/db/ActiveRecordBehavior.php similarity index 99% rename from framework/db/ar/ActiveRecordBehavior.php rename to framework/db/ActiveRecordBehavior.php index b5d9305..b4b7b5e 100644 --- a/framework/db/ar/ActiveRecordBehavior.php +++ b/framework/db/ActiveRecordBehavior.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\ar; +namespace yii\db; use yii\base\ModelBehavior; diff --git a/framework/db/ar/ActiveRelation.php b/framework/db/ActiveRelation.php similarity index 98% rename from framework/db/ar/ActiveRelation.php rename to framework/db/ActiveRelation.php index 64f15a2..013df4b 100644 --- a/framework/db/ar/ActiveRelation.php +++ b/framework/db/ActiveRelation.php @@ -8,11 +8,11 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\ar; +namespace yii\db; -use yii\db\dao\Connection; -use yii\db\dao\Command; -use yii\db\dao\QueryBuilder; +use yii\db\Connection; +use yii\db\Command; +use yii\db\QueryBuilder; /** * It is used in three scenarios: diff --git a/framework/db/dao/BaseQuery.php b/framework/db/BaseQuery.php similarity index 99% rename from framework/db/dao/BaseQuery.php rename to framework/db/BaseQuery.php index f91beb7..58b8f57 100644 --- a/framework/db/dao/BaseQuery.php +++ b/framework/db/BaseQuery.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; /** * BaseQuery is the base class that represents a SQL SELECT statement in a DBMS-independent way. diff --git a/framework/db/dao/ColumnSchema.php b/framework/db/ColumnSchema.php similarity index 99% rename from framework/db/dao/ColumnSchema.php rename to framework/db/ColumnSchema.php index 5f1fbdf..2e0c75c 100644 --- a/framework/db/dao/ColumnSchema.php +++ b/framework/db/ColumnSchema.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; /** * ColumnSchema class describes the metadata of a column in a database table. diff --git a/framework/db/dao/Command.php b/framework/db/Command.php similarity index 99% rename from framework/db/dao/Command.php rename to framework/db/Command.php index 78b3581..c9b133f 100644 --- a/framework/db/dao/Command.php +++ b/framework/db/Command.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; use yii\db\Exception; diff --git a/framework/db/dao/Connection.php b/framework/db/Connection.php similarity index 96% rename from framework/db/dao/Connection.php rename to framework/db/Connection.php index 6bb1576..93cf8b7 100644 --- a/framework/db/dao/Connection.php +++ b/framework/db/Connection.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; use yii\db\Exception; @@ -25,7 +25,7 @@ use yii\db\Exception; * the DB connection: * * ~~~ - * $connection = new \yii\db\dao\Connection(array( + * $connection = new \yii\db\Connection(array( * 'dsn' => $dsn, * 'username' => $username, * 'password' => $password, @@ -76,7 +76,7 @@ use yii\db\Exception; * array( * 'components' => array( * 'db' => array( - * 'class' => '\yii\db\dao\Connection', + * 'class' => '\yii\db\Connection', * 'dsn' => 'mysql:host=127.0.0.1;dbname=demo', * 'username' => 'root', * 'password' => '', @@ -238,15 +238,15 @@ class Connection extends \yii\base\ApplicationComponent * [[Driver]] class to support DBMS that is not supported by Yii. */ public $driverMap = array( - 'pgsql' => 'yii\db\dao\pgsql\Driver', // PostgreSQL - 'mysqli' => 'yii\db\dao\mysql\Driver', // MySQL - 'mysql' => 'yii\db\dao\mysql\Driver', // MySQL - 'sqlite' => 'yii\db\dao\sqlite\Driver', // sqlite 3 - 'sqlite2' => 'yii\db\dao\sqlite\Driver', // sqlite 2 + 'pgsql' => 'yii\db\pgsql\Driver', // PostgreSQL + 'mysqli' => 'yii\db\mysql\Driver', // MySQL + 'mysql' => 'yii\db\mysql\Driver', // MySQL + 'sqlite' => 'yii\db\sqlite\Driver', // sqlite 3 + 'sqlite2' => 'yii\db\sqlite\Driver', // sqlite 2 'mssql' => 'yi\db\dao\mssql\Driver', // Mssql driver on windows hosts - 'dblib' => 'yii\db\dao\mssql\Driver', // dblib drivers on linux (and maybe others os) hosts - 'sqlsrv' => 'yii\db\dao\mssql\Driver', // Mssql - 'oci' => 'yii\db\dao\oci\Driver', // Oracle driver + 'dblib' => 'yii\db\mssql\Driver', // dblib drivers on linux (and maybe others os) hosts + 'sqlsrv' => 'yii\db\mssql\Driver', // Mssql + 'oci' => 'yii\db\oci\Driver', // Oracle driver ); /** * @var Transaction the currently active transaction @@ -612,7 +612,7 @@ class Connection extends \yii\base\ApplicationComponent public function getStats() { $logger = \Yii::getLogger(); - $timings = $logger->getProfiling(array('yii\db\dao\Command::query', 'yii\db\dao\Command::execute')); + $timings = $logger->getProfiling(array('yii\db\Command::query', 'yii\db\Command::execute')); $count = count($timings); $time = 0; foreach ($timings as $timing) { diff --git a/framework/db/dao/DataReader.php b/framework/db/DataReader.php similarity index 99% rename from framework/db/dao/DataReader.php rename to framework/db/DataReader.php index 3d744f4..26168f9 100644 --- a/framework/db/dao/DataReader.php +++ b/framework/db/DataReader.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; use yii\db\Exception; diff --git a/framework/db/dao/Driver.php b/framework/db/Driver.php similarity index 99% rename from framework/db/dao/Driver.php rename to framework/db/Driver.php index 46a0d62..a04e867 100644 --- a/framework/db/dao/Driver.php +++ b/framework/db/Driver.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; use yii\db\Exception; diff --git a/framework/db/dao/Expression.php b/framework/db/Expression.php similarity index 98% rename from framework/db/dao/Expression.php rename to framework/db/Expression.php index 5975997..3ff6374 100644 --- a/framework/db/dao/Expression.php +++ b/framework/db/Expression.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; /** * Expression represents a DB expression that does not need escaping or quoting. diff --git a/framework/db/dao/Query.php b/framework/db/Query.php similarity index 97% rename from framework/db/dao/Query.php rename to framework/db/Query.php index 0769f92..2ca072a 100644 --- a/framework/db/dao/Query.php +++ b/framework/db/Query.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; /** * Query represents a SQL statement in a way that is independent of DBMS. @@ -144,7 +144,7 @@ class Query extends BaseQuery * The columns in the new table should be specified as name-definition pairs (e.g. 'name'=>'string'), * where name stands for a column name which will be properly quoted by the method, and definition * stands for the column type which can contain an abstract DB type. - * The method [[\yii\db\dao\QueryBuilder::getColumnType()]] will be called + * The method [[\yii\db\QueryBuilder::getColumnType()]] will be called * to convert the abstract column types to physical ones. For example, `string` will be converted * as `varchar(255)`, and `string not null` becomes `varchar(255) not null`. * @@ -200,7 +200,7 @@ class Query extends BaseQuery * Builds and executes a SQL statement for adding a new DB column. * @param string $table the table that the new column will be added to. The table name will be properly quoted by the method. * @param string $column the name of the new column. The name will be properly quoted by the method. - * @param string $type the column type. [[\yii\db\dao\QueryBuilder::getColumnType()]] will be called + * @param string $type the column type. [[\yii\db\QueryBuilder::getColumnType()]] will be called * to convert the give column type to the physical one. For example, `string` will be converted * as `varchar(255)`, and `string not null` becomes `varchar(255) not null`. * @return Query the query object itself @@ -240,7 +240,7 @@ class Query extends BaseQuery * Builds and executes a SQL statement for changing the definition of a column. * @param string $table the table whose column is to be changed. The table name will be properly quoted by the method. * @param string $column the name of the column to be changed. The name will be properly quoted by the method. - * @param string $type the column type. [[\yii\db\dao\QueryBuilder::getColumnType()]] will be called + * @param string $type the column type. [[\yii\db\QueryBuilder::getColumnType()]] will be called * to convert the give column type to the physical one. For example, `string` will be converted * as `varchar(255)`, and `string not null` becomes `varchar(255) not null`. * @return Query the query object itself diff --git a/framework/db/dao/QueryBuilder.php b/framework/db/QueryBuilder.php similarity index 99% rename from framework/db/dao/QueryBuilder.php rename to framework/db/QueryBuilder.php index 5a76729..3cfc874 100644 --- a/framework/db/dao/QueryBuilder.php +++ b/framework/db/QueryBuilder.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; use yii\db\Exception; diff --git a/framework/db/dao/TableSchema.php b/framework/db/TableSchema.php similarity index 99% rename from framework/db/dao/TableSchema.php rename to framework/db/TableSchema.php index b905e3b..537c275 100644 --- a/framework/db/dao/TableSchema.php +++ b/framework/db/TableSchema.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; use yii\db\Exception; diff --git a/framework/db/dao/Transaction.php b/framework/db/Transaction.php similarity index 99% rename from framework/db/dao/Transaction.php rename to framework/db/Transaction.php index 0556ecb..bc36785 100644 --- a/framework/db/dao/Transaction.php +++ b/framework/db/Transaction.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao; +namespace yii\db; use yii\db\Exception; diff --git a/framework/db/dao/mysql/Driver.php b/framework/db/mysql/Driver.php similarity index 92% rename from framework/db/dao/mysql/Driver.php rename to framework/db/mysql/Driver.php index e9c0f8d..654db54 100644 --- a/framework/db/dao/mysql/Driver.php +++ b/framework/db/mysql/Driver.php @@ -7,10 +7,10 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao\mysql; +namespace yii\db\mysql; -use yii\db\dao\TableSchema; -use yii\db\dao\ColumnSchema; +use yii\db\TableSchema; +use yii\db\ColumnSchema; /** * Driver is the class for retrieving metadata from a MySQL database (version 4.1.x and 5.x). @@ -18,7 +18,7 @@ use yii\db\dao\ColumnSchema; * @author Qiang Xue * @since 2.0 */ -class Driver extends \yii\db\dao\Driver +class Driver extends \yii\db\Driver { /** * @var array mapping from physical column types (keys) to abstract column types (values) @@ -85,7 +85,7 @@ class Driver extends \yii\db\dao\Driver /** * Loads the metadata for the specified table. * @param string $name table name - * @return \yii\db\dao\TableSchema driver dependent table metadata. Null if the table does not exist. + * @return \yii\db\TableSchema driver dependent table metadata. Null if the table does not exist. */ protected function loadTableSchema($name) { @@ -100,7 +100,7 @@ class Driver extends \yii\db\dao\Driver /** * Resolves the table name and schema name (if any). - * @param \yii\db\dao\TableSchema $table the table metadata object + * @param \yii\db\TableSchema $table the table metadata object * @param string $name the table name */ protected function resolveTableNames($table, $name) @@ -142,7 +142,7 @@ class Driver extends \yii\db\dao\Driver /** * Resolves the default value for the column. - * @param \yii\db\dao\ColumnSchema $column the column metadata object + * @param \yii\db\ColumnSchema $column the column metadata object * @param string $value the default value fetched from database */ protected function resolveColumnDefault($column, $value) @@ -154,7 +154,7 @@ class Driver extends \yii\db\dao\Driver /** * Resolves the abstract data type for the column. - * @param \yii\db\dao\ColumnSchema $column the column metadata object + * @param \yii\db\ColumnSchema $column the column metadata object */ public function resolveColumnType($column) { @@ -196,7 +196,7 @@ class Driver extends \yii\db\dao\Driver /** * Collects the metadata of table columns. - * @param \yii\db\dao\TableSchema $table the table metadata + * @param \yii\db\TableSchema $table the table metadata * @return boolean whether the table exists in the database */ protected function findColumns($table) @@ -222,7 +222,7 @@ class Driver extends \yii\db\dao\Driver /** * Collects the foreign key column details for the given table. - * @param \yii\db\dao\TableSchema $table the table metadata + * @param \yii\db\TableSchema $table the table metadata */ protected function findConstraints($table) { diff --git a/framework/db/dao/mysql/QueryBuilder.php b/framework/db/mysql/QueryBuilder.php similarity index 97% rename from framework/db/dao/mysql/QueryBuilder.php rename to framework/db/mysql/QueryBuilder.php index 6e1a401..41cbc2c 100644 --- a/framework/db/dao/mysql/QueryBuilder.php +++ b/framework/db/mysql/QueryBuilder.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao\mysql; +namespace yii\db\mysql; use yii\db\Exception; @@ -17,7 +17,7 @@ use yii\db\Exception; * @author Qiang Xue * @since 2.0 */ -class QueryBuilder extends \yii\db\dao\QueryBuilder +class QueryBuilder extends \yii\db\QueryBuilder { /** * @var array mapping from abstract column types (keys) to physical column types (values). diff --git a/framework/db/dao/sqlite/Driver.php b/framework/db/sqlite/Driver.php similarity index 91% rename from framework/db/dao/sqlite/Driver.php rename to framework/db/sqlite/Driver.php index bc127d4..d88e5c9 100644 --- a/framework/db/dao/sqlite/Driver.php +++ b/framework/db/sqlite/Driver.php @@ -7,10 +7,10 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao\sqlite; +namespace yii\db\sqlite; -use yii\db\dao\TableSchema; -use yii\db\dao\ColumnSchema; +use yii\db\TableSchema; +use yii\db\ColumnSchema; /** * Driver is the class for retrieving metadata from a SQLite (2/3) database. @@ -18,7 +18,7 @@ use yii\db\dao\ColumnSchema; * @author Qiang Xue * @since 2.0 */ -class Driver extends \yii\db\dao\Driver +class Driver extends \yii\db\Driver { /** * @var array mapping from physical column types (keys) to abstract column types (values) @@ -76,7 +76,7 @@ class Driver extends \yii\db\dao\Driver /** * Loads the metadata for the specified table. * @param string $name table name - * @return \yii\db\dao\TableSchema driver dependent table metadata. Null if the table does not exist. + * @return \yii\db\TableSchema driver dependent table metadata. Null if the table does not exist. */ protected function loadTableSchema($name) { @@ -92,7 +92,7 @@ class Driver extends \yii\db\dao\Driver /** * Collects the table column metadata. - * @param \yii\db\dao\TableSchema $table the table metadata + * @param \yii\db\TableSchema $table the table metadata * @return boolean whether the table exists in the database */ protected function findColumns($table) @@ -120,7 +120,7 @@ class Driver extends \yii\db\dao\Driver /** * Collects the foreign key column details for the given table. - * @param \yii\db\dao\TableSchema $table the table metadata + * @param \yii\db\TableSchema $table the table metadata */ protected function findConstraints($table) { @@ -155,7 +155,7 @@ class Driver extends \yii\db\dao\Driver /** * Resolves the abstract data type for the column. - * @param \yii\db\dao\ColumnSchema $column the column metadata object + * @param \yii\db\ColumnSchema $column the column metadata object */ public function resolveColumnType($column) { @@ -189,7 +189,7 @@ class Driver extends \yii\db\dao\Driver /** * Resolves the default value for the column. - * @param \yii\db\dao\ColumnSchema $column the column metadata object + * @param \yii\db\ColumnSchema $column the column metadata object * @param string $value the default value fetched from database */ protected function resolveColumnDefault($column, $value) diff --git a/framework/db/dao/sqlite/QueryBuilder.php b/framework/db/sqlite/QueryBuilder.php similarity index 98% rename from framework/db/dao/sqlite/QueryBuilder.php rename to framework/db/sqlite/QueryBuilder.php index 12d0710..e226390 100644 --- a/framework/db/dao/sqlite/QueryBuilder.php +++ b/framework/db/sqlite/QueryBuilder.php @@ -7,7 +7,7 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\db\dao\sqlite; +namespace yii\db\sqlite; use yii\db\Exception; @@ -17,7 +17,7 @@ use yii\db\Exception; * @author Qiang Xue * @since 2.0 */ -class QueryBuilder extends \yii\db\dao\QueryBuilder +class QueryBuilder extends \yii\db\QueryBuilder { /** * @var array mapping from abstract column types (keys) to physical column types (values). diff --git a/framework/logging/DbTarget.php b/framework/logging/DbTarget.php index 56a27bc..10d463e 100644 --- a/framework/logging/DbTarget.php +++ b/framework/logging/DbTarget.php @@ -23,7 +23,7 @@ namespace yii\logging; class DbTarget extends Target { /** - * @var string the ID of [[\yii\db\dao\Connection]] application component. + * @var string the ID of [[\yii\db\Connection]] application component. * Defaults to 'db'. Please make sure that your database contains a table * whose name is as specified in [[tableName]] and has the required table structure. * @see tableName @@ -31,7 +31,7 @@ class DbTarget extends Target public $connectionID = 'db'; /** * @var string the name of the DB table that stores log messages. Defaults to '{{log}}'. - * If you are using table prefix 'tbl_' (configured via [[\yii\db\dao\Connection::tablePrefix]]), + * If you are using table prefix 'tbl_' (configured via [[\yii\db\Connection::tablePrefix]]), * it means the DB table would be named as 'tbl_log'. * * The DB table must have the following structure: @@ -62,14 +62,14 @@ class DbTarget extends Target /** * Returns the DB connection used for saving log messages. - * @return \yii\db\dao\Connection the DB connection instance + * @return \yii\db\Connection the DB connection instance * @throws \yii\base\Exception if [[connectionID]] does not refer to a valid application component ID. */ public function getDbConnection() { if ($this->_db === null) { $this->_db = \Yii::$application->getComponent($this->connectionID); - if (!$this->_db instanceof \yii\db\dao\Connection) { + if (!$this->_db instanceof \yii\db\Connection) { throw new \yii\base\Exception('DbTarget.connectionID must refer to a valid application component ID'); } } diff --git a/framework/logging/Logger.php b/framework/logging/Logger.php index 2f0cf89..19f0f06 100644 --- a/framework/logging/Logger.php +++ b/framework/logging/Logger.php @@ -190,7 +190,7 @@ class Logger extends \yii\base\Component * @param array $categories list of categories that you are interested in. * You can use an asterisk at the end of a category to do a prefix match. * For example, 'yii\db\*' will match categories starting with 'yii\db\', - * such as 'yii\db\dao\Connection'. + * such as 'yii\db\Connection'. * @param array $excludeCategories list of categories that you are interested in. * @return array the profiling results. Each array element has the following structure: * `array($token, $category, $time)`. diff --git a/framework/logging/Target.php b/framework/logging/Target.php index 1a1979a..88cb5cb 100644 --- a/framework/logging/Target.php +++ b/framework/logging/Target.php @@ -37,7 +37,7 @@ abstract class Target extends \yii\base\Component * @var array list of message categories that this target is interested in. Defaults to empty, meaning all categories. * You can use an asterisk at the end of a category so that the category may be used to * match those categories sharing the same common prefix. For example, 'yii\db\*' will match - * categories starting with 'yii\db\', such as 'yii\db\dao\Connection'. + * categories starting with 'yii\db\', such as 'yii\db\Connection'. */ public $categories = array(); /** @@ -45,7 +45,7 @@ abstract class Target extends \yii\base\Component * If this property is not empty, then any category listed here will be excluded from [[categories]]. * You can use an asterisk at the end of a category so that the category can be used to * match those categories sharing the same common prefix. For example, 'yii\db\*' will match - * categories starting with 'yii\db\', such as 'yii\db\dao\Connection'. + * categories starting with 'yii\db\', such as 'yii\db\Connection'. * @see categories */ public $except = array(); diff --git a/framework/validators/ExistValidator.php b/framework/validators/ExistValidator.php index 9ef86ff..7f62ee9 100644 --- a/framework/validators/ExistValidator.php +++ b/framework/validators/ExistValidator.php @@ -21,22 +21,22 @@ namespace yii\validators; class ExistValidator extends Validator { /** - * @var string the yii\db\ar\ActiveRecord class name or alias of the class + * @var string the yii\db\ActiveRecord class name or alias of the class * that should be used to look for the attribute value being validated. - * Defaults to null, meaning using the yii\db\ar\ActiveRecord class of + * Defaults to null, meaning using the yii\db\ActiveRecord class of * the attribute being validated. * @see attributeName */ public $className; /** - * @var string the yii\db\ar\ActiveRecord class attribute name that should be + * @var string the yii\db\ActiveRecord class attribute name that should be * used to look for the attribute value being validated. Defaults to null, * meaning using the name of the attribute being validated. * @see className */ public $attributeName; /** - * @var \yii\db\dao\BaseQuery additional query criteria. This will be combined + * @var \yii\db\BaseQuery additional query criteria. This will be combined * with the condition that checks if the attribute value exists in the * corresponding table column. */ @@ -51,7 +51,7 @@ class ExistValidator extends Validator * Validates the attribute of the object. * If there is any error, the error message is added to the object. * - * @param \yii\db\ar\ActiveRecord $object the object being validated + * @param \yii\db\ActiveRecord $object the object being validated * @param string $attribute the attribute being validated * * @throws \yii\base\Exception if table doesn't have column specified @@ -72,7 +72,7 @@ class ExistValidator extends Validator $finder = $object->find()->where(array($column->name => $value)); - if ($this->query instanceof \yii\db\dao\BaseQuery) { + if ($this->query instanceof \yii\db\BaseQuery) { $finder->mergeWith($this->query); } diff --git a/framework/validators/UniqueValidator.php b/framework/validators/UniqueValidator.php index 0366792..df6147f 100644 --- a/framework/validators/UniqueValidator.php +++ b/framework/validators/UniqueValidator.php @@ -28,7 +28,7 @@ class UniqueValidator extends Validator */ public $allowEmpty = true; /** - * @var string the yii\db\ar\ActiveRecord class name or alias of the class + * @var string the yii\db\ActiveRecord class name or alias of the class * that should be used to look for the attribute value being validated. * Defaults to null, meaning using the class of the object currently * being validated. @@ -43,7 +43,7 @@ class UniqueValidator extends Validator */ public $attributeName; /** - * @var \yii\db\ar\ActiveQuery additional query criteria. This will be + * @var \yii\db\ActiveQuery additional query criteria. This will be * combined with the condition that checks if the attribute value exists * in the corresponding table column. */ @@ -87,7 +87,7 @@ class UniqueValidator extends Validator $finder->where($this->caseSensitive ? "{$column->quotedName}=:value" : "LOWER({$column->quotedName})=LOWER(:value)"); $finder->params(array(':value' => $value)); - if ($this->query instanceof \yii\db\dao\BaseQuery) { + if ($this->query instanceof \yii\db\BaseQuery) { $finder->mergeWith($this->query); } diff --git a/tests/unit/MysqlTestCase.php b/tests/unit/MysqlTestCase.php index c933bcc..5fe7dbd 100644 --- a/tests/unit/MysqlTestCase.php +++ b/tests/unit/MysqlTestCase.php @@ -13,12 +13,12 @@ class MysqlTestCase extends TestCase /** * @param bool $reset whether to clean up the test database - * @return \yii\db\dao\Connection + * @return \yii\db\Connection */ function getConnection($reset = true) { $params = $this->getParam('mysql'); - $db = new \yii\db\dao\Connection; + $db = new \yii\db\Connection; $db->dsn = $params['dsn']; $db->username = $params['username']; $db->password = $params['password']; diff --git a/tests/unit/data/ar/ActiveRecord.php b/tests/unit/data/ar/ActiveRecord.php index aafc99f..71ad83f 100644 --- a/tests/unit/data/ar/ActiveRecord.php +++ b/tests/unit/data/ar/ActiveRecord.php @@ -9,7 +9,7 @@ namespace yiiunit\data\ar; -use yii\db\dao\Connection; +use yii\db\Connection; /** * ActiveRecord is ... @@ -17,7 +17,7 @@ use yii\db\dao\Connection; * @author Qiang Xue * @since 2.0 */ -class ActiveRecord extends \yii\db\ar\ActiveRecord +class ActiveRecord extends \yii\db\ActiveRecord { public static $db; diff --git a/tests/unit/data/ar/Customer.php b/tests/unit/data/ar/Customer.php index 05b8de1..5c42ecf 100644 --- a/tests/unit/data/ar/Customer.php +++ b/tests/unit/data/ar/Customer.php @@ -1,7 +1,7 @@