Commit 3b40d449 by Carsten Brandt

made createQuery() config param optional

parent 1708a36d
......@@ -36,7 +36,7 @@ before_script:
script:
# - vendor/bin/phpunit --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose --exclude-group mssql,oci,wincache,xcache,zenddata,vendor
- vendor/bin/phpunit --verbose --exclude-group mssql,oci,wincache,xcache,zenddata,vendor
- vendor/bin/phpunit --verbose --exclude-group mssql,oci,wincache,xcache,zenddata
- cd apps/basic && php vendor/bin/codecept run
#after_script:
......
......@@ -80,7 +80,9 @@
"require-dev": {
"phpunit/phpunit": "3.7.*",
"twig/twig": "*",
"smarty/smarty": "*"
"smarty/smarty": "*",
"imagine/imagine": "v0.5.0",
"swiftmailer/swiftmailer": "*"
},
"suggest": {
"phpdocumentor/reflection": "required by yii2-apidoc extension",
......
......@@ -148,9 +148,9 @@ class ActiveRecord extends BaseActiveRecord
* You may also define default conditions that should apply to all queries unless overridden:
*
* ```php
* public static function createQuery()
* public static function createQuery($config = [])
* {
* return parent::createQuery()->where(['deleted' => false]);
* return parent::createQuery($config)->where(['deleted' => false]);
* }
* ```
*
......@@ -160,7 +160,7 @@ class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
*/
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new ActiveQuery($config);
......
......@@ -102,9 +102,9 @@ abstract class ActiveRecord extends BaseActiveRecord
* You may also define default conditions that should apply to all queries unless overridden:
*
* ```php
* public static function createQuery()
* public static function createQuery($config = [])
* {
* return parent::createQuery()->where(['deleted' => false]);
* return parent::createQuery($config)->where(['deleted' => false]);
* }
* ```
*
......@@ -114,7 +114,7 @@ abstract class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
*/
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new ActiveQuery($config);
......
......@@ -55,9 +55,9 @@ abstract class ActiveRecord extends \yii\mongodb\ActiveRecord
* You may also define default conditions that should apply to all queries unless overridden:
*
* ```php
* public static function createQuery()
* public static function createQuery($config = [])
* {
* return parent::createQuery()->where(['deleted' => false]);
* return parent::createQuery($config)->where(['deleted' => false]);
* }
* ```
*
......@@ -67,7 +67,7 @@ abstract class ActiveRecord extends \yii\mongodb\ActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
*/
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new ActiveQuery($config);
......
......@@ -59,9 +59,9 @@ class ActiveRecord extends BaseActiveRecord
* You may also define default conditions that should apply to all queries unless overridden:
*
* ```php
* public static function createQuery()
* public static function createQuery($config= [])
* {
* return parent::createQuery()->where(['deleted' => false]);
* return parent::createQuery($config)->where(['deleted' => false]);
* }
* ```
*
......@@ -71,7 +71,7 @@ class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
*/
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new ActiveQuery($config);
......
......@@ -144,9 +144,9 @@ abstract class ActiveRecord extends BaseActiveRecord
* You may also define default conditions that should apply to all queries unless overridden:
*
* ```php
* public static function createQuery()
* public static function createQuery($config = [])
* {
* return parent::createQuery()->where(['deleted' => false]);
* return parent::createQuery($config)->where(['deleted' => false]);
* }
* ```
*
......@@ -156,7 +156,7 @@ abstract class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
*/
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new ActiveQuery($config);
......
......@@ -159,9 +159,9 @@ class ActiveRecord extends BaseActiveRecord
* You may also define default conditions that should apply to all queries unless overridden:
*
* ```php
* public static function createQuery()
* public static function createQuery($config = [])
* {
* return parent::createQuery()->where(['deleted' => false]);
* return parent::createQuery($config)->where(['deleted' => false]);
* }
* ```
*
......@@ -171,7 +171,7 @@ class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
*/
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new ActiveQuery($config);
......
......@@ -122,9 +122,9 @@ interface ActiveRecordInterface
* You may also define default conditions that should apply to all queries unless overridden:
*
* ```php
* public static function createQuery()
* public static function createQuery($config = [])
* {
* return parent::createQuery()->where(['deleted' => false]);
* return parent::createQuery($config)->where(['deleted' => false]);
* }
* ```
*
......@@ -134,7 +134,7 @@ interface ActiveRecordInterface
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveQueryInterface the newly created [[ActiveQueryInterface|ActiveQuery]] instance.
*/
public static function createQuery($config);
public static function createQuery($config = []);
/**
* Updates records using the provided attribute values and conditions.
......
......@@ -41,7 +41,7 @@ class Customer extends ActiveRecord
parent::afterSave($insert);
}
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new CustomerQuery($config);
......
......@@ -63,7 +63,7 @@ class Customer extends ActiveRecord
}
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new CustomerQuery($config);
......
......@@ -25,7 +25,7 @@ class Customer extends ActiveRecord
return $this->hasMany(CustomerOrder::className(), ['customer_id' => '_id']);
}
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new CustomerQuery($config);
......
......@@ -20,7 +20,7 @@ class CustomerFile extends ActiveRecord
);
}
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new CustomerFileQuery($config);
......
......@@ -31,7 +31,7 @@ class Customer extends ActiveRecord
parent::afterSave($insert);
}
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new CustomerQuery($config);
......
......@@ -25,7 +25,7 @@ class ArticleIndex extends ActiveRecord
return $this->source->content;
}
public static function createQuery($config)
public static function createQuery($config = [])
{
$config['modelClass'] = get_called_class();
return new ArticleIndexQuery($config);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment