@ -24,7 +24,7 @@ use yii\helpers\ArrayHelper;
*
* @property array $dirtyAttributes The changed attribute values (name-value pairs). This property is
* read-only.
* @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]].
* @property bool $isNewRecord Whether the record is new and should be inserted when calling [[save()]].
* @property array $oldAttributes The old attribute values (name-value pairs). Note that the type of this
* property differs in getter and setter. See [[getOldAttributes()]] and [[setOldAttributes()]] for details.
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
@ -152,7 +152,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* @param array $attributes attribute values (name-value pairs) to be saved into the table
* @param string|array $condition the conditions that will be put in the WHERE part of the UPDATE SQL.
* Please refer to [[Query::where()]] on how to specify this parameter.
* @return integer the number of rows updated
* @return int the number of rows updated
* @throws NotSupportedException if not overridden
*/
public static function updateAll($attributes, $condition = '')
@ -172,7 +172,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* Use negative values if you want to decrement the counters.
* @param string|array $condition the conditions that will be put in the WHERE part of the UPDATE SQL.
* Please refer to [[Query::where()]] on how to specify this parameter.
* @return integer the number of rows updated
* @return int the number of rows updated
* @throws NotSupportedException if not overrided
*/
public static function updateAllCounters($counters, $condition = '')
@ -193,7 +193,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* @param string|array $condition the conditions that will be put in the WHERE part of the DELETE SQL.
* Please refer to [[Query::where()]] on how to specify this parameter.
* @param array $params the parameters (name => value) to be bound to the query.
* @return integer the number of rows deleted
* @return int the number of rows deleted
* @throws NotSupportedException if not overrided
*/
public static function deleteAll($condition = '', $params = [])
@ -311,7 +311,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* Checks if a property value is null.
* This method overrides the parent implementation by checking if the named attribute is `null` or not.
* @param string $name the property name or the event name
* @return boolean whether the property value is null
* @return bool whether the property value is null
*/
public function __isset($name)
{
@ -436,7 +436,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Check whether the named relation has been populated with records.
* @param string $name the relation name, e.g. `orders` for a relation defined via `getOrders()` method (case-sensitive).
* @return boolean whether relation has been populated with records.
* @return bool whether relation has been populated with records.
* @see getRelation()
*/
public function isRelationPopulated($name)
@ -457,7 +457,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Returns a value indicating whether the model has an attribute with the specified name.
* @param string $name the name of the attribute
* @return boolean whether the model has an attribute with the specified name.
* @return bool whether the model has an attribute with the specified name.
*/
public function hasAttribute($name)
{
@ -557,10 +557,10 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Returns a value indicating whether the named attribute has been changed.
* @param string $name the name of the attribute.
* @param boolean $identical whether the comparison of new and old value is made for
* @param bool $identical whether the comparison of new and old value is made for
* identical values using `===`, defaults to `true`. Otherwise `==` is used for comparison.
* This parameter is available since version 2.0.4.
* @return boolean whether the attribute has been changed
* @return bool whether the attribute has been changed
*/
public function isAttributeChanged($name, $identical = true)
{
@ -622,12 +622,12 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* $customer->save();
* ```
*
* @param boolean $runValidation whether to perform validation (calling [[validate()]])
* @param bool $runValidation whether to perform validation (calling [[validate()]])
* before saving the record. Defaults to `true`. If the validation fails, the record
* will not be saved to the database and this method will return `false`.
* @param array $attributeNames list of attribute names that need to be saved. Defaults to null,
* meaning all attributes that are loaded from DB will be saved.
* @return boolean whether the saving succeeded (i.e. no validation errors occurred).
* @return bool whether the saving succeeded (i.e. no validation errors occurred).
*/
public function save($runValidation = true, $attributeNames = null)
{
@ -679,12 +679,12 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* }
* ```
*
* @param boolean $runValidation whether to perform validation (calling [[validate()]])
* @param bool $runValidation whether to perform validation (calling [[validate()]])
* before saving the record. Defaults to `true`. If the validation fails, the record
* will not be saved to the database and this method will return `false`.
* @param array $attributeNames list of attribute names that need to be saved. Defaults to null,
* meaning all attributes that are loaded from DB will be saved.
* @return integer |false the number of rows affected, or `false` if validation fails
* @return int|false the number of rows affected, or `false` if validation fails
* or [[beforeSave()]] stops the updating process.
* @throws StaleObjectException if [[optimisticLock|optimistic locking]] is enabled and the data
* being updated is outdated.
@ -711,7 +711,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* Note that this method will **not** perform data validation and will **not** trigger events.
*
* @param array $attributes the attributes (names or name-value pairs) to be updated
* @return integer the number of rows affected.
* @return int the number of rows affected.
*/
public function updateAttributes($attributes)
{
@ -742,7 +742,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* @see update()
* @param array $attributes attributes to update
* @return integer |false the number of rows affected, or false if [[beforeSave()]] stops the updating process.
* @return int|false the number of rows affected, or false if [[beforeSave()]] stops the updating process.
* @throws StaleObjectException
*/
protected function updateInternal($attributes = null)
@ -797,7 +797,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
*
* @param array $counters the counters to be updated (attribute name => increment value)
* Use negative values if you want to decrement the counters.
* @return boolean whether the saving is successful
* @return bool whether the saving is successful
* @see updateAllCounters()
*/
public function updateCounters($counters)
@ -830,7 +830,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* In the above step 1 and 3, events named [[EVENT_BEFORE_DELETE]] and [[EVENT_AFTER_DELETE]]
* will be raised by the corresponding methods.
*
* @return integer |false the number of rows deleted, or `false` if the deletion is unsuccessful for some reason.
* @return int|false the number of rows deleted, or `false` if the deletion is unsuccessful for some reason.
* Note that it is possible the number of rows deleted is 0, even though the deletion execution is successful.
* @throws StaleObjectException if [[optimisticLock|optimistic locking]] is enabled and the data
* being deleted is outdated.
@ -860,7 +860,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Returns a value indicating whether the current record is new.
* @return boolean whether the record is new and should be inserted when calling [[save()]].
* @return bool whether the record is new and should be inserted when calling [[save()]].
*/
public function getIsNewRecord()
{
@ -869,7 +869,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Sets the value indicating whether the record is new.
* @param boolean $value whether the record is new and should be inserted when calling [[save()]].
* @param bool $value whether the record is new and should be inserted when calling [[save()]].
* @see getIsNewRecord()
*/
public function setIsNewRecord($value)
@ -919,9 +919,9 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* }
* ```
*
* @param boolean $insert whether this method called while inserting a record.
* @param bool $insert whether this method called while inserting a record.
* If `false`, it means the method is called while updating a record.
* @return boolean whether the insertion or updating should continue.
* @return bool whether the insertion or updating should continue.
* If `false`, the insertion or updating will be cancelled.
*/
public function beforeSave($insert)
@ -938,7 +938,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* or an [[EVENT_AFTER_UPDATE]] event if `$insert` is `false`. The event class used is [[AfterSaveEvent]].
* When overriding this method, make sure you call the parent implementation so that
* the event is triggered.
* @param boolean $insert whether this method called while inserting a record.
* @param bool $insert whether this method called while inserting a record.
* If `false`, it means the method is called while updating a record.
* @param array $changedAttributes The old values of attributes that had changed and were saved.
* You can use this parameter to take action based on the changes made for example send an email
@ -970,7 +970,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* }
* ```
*
* @return boolean whether the record should be deleted. Defaults to `true`.
* @return bool whether the record should be deleted. Defaults to `true`.
*/
public function beforeDelete()
{
@ -997,7 +997,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* If the refresh is successful, an [[EVENT_AFTER_REFRESH]] event will be triggered.
* This event is available since version 2.0.8.
*
* @return boolean whether the row still exists in the database. If `true`, the latest data
* @return bool whether the row still exists in the database. If `true`, the latest data
* will be populated to this active record. Otherwise, this record will remain unchanged.
*/
public function refresh()
@ -1034,7 +1034,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* The comparison is made by comparing the table names and the primary key values of the two active records.
* If one of the records [[isNewRecord|is new]] they are also considered not equal.
* @param ActiveRecordInterface $record record to compare to
* @return boolean whether the two active records refer to the same row in the same database table.
* @return bool whether the two active records refer to the same row in the same database table.
*/
public function equals($record)
{
@ -1047,7 +1047,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Returns the primary key value(s).
* @param boolean $asArray whether to return the primary key value as an array. If `true`,
* @param bool $asArray whether to return the primary key value as an array. If `true`,
* the return value will be an array with column names as keys and column values as values.
* Note that for composite primary keys, an array will always be returned regardless of this parameter value.
* @property mixed The primary key value. An array (column name => column value) is returned if
@ -1077,7 +1077,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* This refers to the primary key value that is populated into the record
* after executing a find method (e.g. find(), findOne()).
* The value remains unchanged even if the primary key attribute is manually assigned with a different value.
* @param boolean $asArray whether to return the primary key value as an array. If `true`,
* @param bool $asArray whether to return the primary key value as an array. If `true`,
* the return value will be an array with column name as key and column value as value.
* If this is `false` (default), a scalar value will be returned for non-composite primary key.
* @property mixed The old primary key value. An array (column name => column value) is
@ -1155,7 +1155,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* Returns whether there is an element at the specified offset.
* This method is required by the interface [[\ArrayAccess]].
* @param mixed $offset the offset to check on
* @return boolean whether there is an element at the specified offset.
* @return bool whether there is an element at the specified offset.
*/
public function offsetExists($offset)
{
@ -1167,7 +1167,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* A relation is defined by a getter method which returns an [[ActiveQueryInterface]] object.
* It can be declared in either the Active Record class itself or one of its behaviors.
* @param string $name the relation name, e.g. `orders` for a relation defined via `getOrders()` method (case-sensitive).
* @param boolean $throwException whether to throw exception if the relation does not exist.
* @param bool $throwException whether to throw exception if the relation does not exist.
* @return ActiveQueryInterface|ActiveQuery the relational query object. If the relation does not exist
* and `$throwException` is `false`, `null` will be returned.
* @throws InvalidParamException if the named relation does not exist.
@ -1316,7 +1316,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* @param ActiveRecordInterface $model the model to be unlinked from the current one.
* You have to make sure that the model is really related with the current model as this method
* does not check this.
* @param boolean $delete whether to delete the model that contains the foreign key.
* @param bool $delete whether to delete the model that contains the foreign key.
* If `false`, the model's foreign key will be set `null` and saved.
* If `true`, the model containing the foreign key will be deleted.
* @throws InvalidCallException if the models cannot be unlinked
@ -1414,7 +1414,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* Note that to destroy the relationship without removing records make sure your keys can be set to null
*
* @param string $name the case sensitive name of the relationship, e.g. `orders` for a relation defined via `getOrders()` method.
* @param boolean $delete whether to delete the model that contains the foreign key.
* @param bool $delete whether to delete the model that contains the foreign key.
*/
public function unlinkAll($name, $delete = false)
{
@ -1509,7 +1509,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* Returns a value indicating whether the given set of attributes represents the primary key for this model
* @param array $keys the set of attributes to check
* @return boolean whether the given set of attributes represents the primary key for this model
* @return bool whether the given set of attributes represents the primary key for this model
*/
public static function isPrimaryKey($keys)
{