db\ActiveRecord updateAll()

updateAll() public static method Updates the whole table using the provided attribute values and conditions. For example, to change the status to be 1 for all customers whose status is 2: Customer::updateAll(['status' => 1], 'status = 2'); public static integer updateAll ( $attributes, $condition = '', $params = [] )$attributes array Attribute values (name-value pairs) to be saved into the table $condition string|array The conditions that will be put in the WHERE part of the UPDA

db\ActiveRecord update()

update() public method Saves the changes to this active record into the associated database table. This method performs the following steps in order: call beforeValidate() when $runValidation is true. If beforeValidate() returns false, the rest of the steps will be skipped; call afterValidate() when $runValidation is true. If validation failed, the rest of the steps will be skipped; call beforeSave(). If beforeSave() returns false, the rest of the steps will be skipped; save the record into

db\ActiveRecord tableName()

tableName() public static method Declares the name of the database table associated with this AR class. By default this method returns the class name as the table name by calling yii\helpers\Inflector::camel2id() with prefix yii\db\Connection::$tablePrefix. For example if yii\db\Connection::$tablePrefix is tbl_, Customer becomes tbl_customer, and OrderItem becomes tbl_order_item. You may override this method if the table is not named after this convention. public static string tableName (

db\ActiveRecord populateRecord()

populateRecord() public static method Populates an active record object using a row of data from the database/storage. This is an internal method meant to be called to create active record objects after fetching data from the database. It is mainly used by yii\db\ActiveQuery to populate the query results into active records. When calling this method manually you should call afterFind() on the created record to trigger the afterFind Event. public static void populateRecord ( $record, $row

db\ActiveRecord primaryKey()

primaryKey() public static method Returns the primary key name(s) for this AR class. The default implementation will return the primary key(s) as declared in the DB table that is associated with this AR class. If the DB table does not declare any primary key, you should override this method to return the attributes that you want to use as primary keys for this AR class. Note that an array should be returned even for a table with single primary key. public static string[] primaryKey ( )ret

db\ActiveRecord loadDefaultValues()

loadDefaultValues() public method Loads default values from database table schema You may call this method to load default values after creating a new instance: // class Customer extends \yii\db\ActiveRecord $customer = new Customer(); $customer->loadDefaultValues(); public $this loadDefaultValues ( $skipIfSet = true )$skipIfSet boolean Whether existing value should be preserved. This will only set defaults for attributes that are null. return $this The model instance itself.

db\ActiveRecord isTransactional()

isTransactional() public method Returns a value indicating whether the specified operation is transactional in the current $scenario. public boolean isTransactional ( $operation )$operation integer The operation to check. Possible values are OP_INSERT, OP_UPDATE and OP_DELETE. return boolean Whether the specified operation is transactional in the current $scenario.

db\ActiveRecord insertInternal()

insertInternal() protected method Inserts an ActiveRecord into DB without considering transaction. protected boolean insertInternal ( $attributes = null )$attributes array List of attributes that need to be saved. Defaults to null, meaning all attributes that are loaded from DB will be saved. return boolean Whether the record is inserted successfully.

db\ActiveRecord getDb()

getDb() public static method Returns the database connection used by this AR class. By default, the "db" application component is used as the database connection. You may override this method if you want to use a different database connection. public static yii\db\Connection getDb ( )return yii\db\Connection The database connection used by this AR class.

db\ActiveRecord getTableSchema()

getTableSchema() public static method Returns the schema information of the DB table associated with this AR class. public static yii\db\TableSchema getTableSchema ( )return yii\db\TableSchema The schema information of the DB table associated with this AR class. throws yii\base\InvalidConfigException if the table for the AR class does not exist.