text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>ithProfile) {
$this->innerJoinWith('profile');
}
parent::init();
}
public function active()
{
$this->andWhere('[[status]]=1');
return $this;
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yi... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
namespace yiiunit\data\ar;
class CustomerWithAli<|fim_suffix|>**
* {@inheritdoc}
* @return CustomerQuery<static>
*/
public static function find()
{
$activeQuery = new CustomerQuery(static::class);
$activeQuery->alias('csr');
return $activeQuery;
}... | fim | yiisoft/yii2 | php |
<|fim_suffix|>operty int $status
*
* @property ProfileWithConstructor $profile
*/
class CustomerWithConstructor extends ActiveRecord
{
public static function tableName()
{
return 'customer';
}
public function __construct($name, $email, $address)
{
$this->name = $name;
$th... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\<|fim_suffix|> * DefaultMultiplePk.
*
* @author mankwok <astleykwok@gmail.com>
* @property int $id
* @property string $second_key... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ype
*/
class DefaultPk extends ActiveRecord
{
public static function tableName()
{
return 'default_pk';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
<|fim_middle|> * @license https://www.yiiframework.com/license/... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
use yii\db\ActiveQuery;
/**
* Class Department
*
* @property int $id
* @property string $title
*
* @property Employe... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
/**
* @property int $id
* @property string $title
* @property string $content
* @property int $version
* @property array $properties... | fim | yiisoft/yii2 | php |
<|fim_suffix|>nce 2.0
*/
class Dog extends Animal
{
/**
* @param self $record
* @param array $row
*/
public static function populateRecord($record, $row): void
{
parent::populateRecord($record, $row);
$record->does = 'bark';
}
}
<|fim_prefix|><?php
/**<|fim_middle|>
* ... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
use yii\db\ActiveQuery;
/**
* Class Dossier
*
* @property int $id
* @property int $department_id
* @pr<|fim_suffix|>d... | fim | yiisoft/yii2 | php |
<|fim_suffix|>])
->inverseOf('employees')
;
}
/**
* Returns employee department.
*
* @return ActiveQuery
*/
public function getDossier()
{
return $this
->hasOne(Dossier::class, [
'department_id' => 'department_id',
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
namespace yiiunit\data\ar;
use yii\db\ArrayExpression;
/**
* Class EnumTypeInCustomSchema
*
* @property int $id
* @property A<|fim_suffix|> extends ActiveRecord
{
public static function tableName()
{
return '{{%schema2.custom_type_test_table}}';
}
}
<|fim_middle|>rrayExpre... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license <|fim_suffix|>ion tableName()
{
return 'item';
}
public function getCategory()
{
return $this->hasOne(Category::class, ['id' => 'category_id']);
}
}
<|fim_mi... | fim | yiisoft/yii2 | php |
<|fim_suffix|>nt $attr1
* @property int $attr2
*/
class NoAutoLabels extends ActiveRecord
{
public function attributeLabels()
{
return [
'attr1' => 'Label for attr1',
];
}
public function generateAttributeLabel($name)
{
throw new InvalidArgumentException('Label... | fim | yiisoft/yii2 | php |
<|fim_suffix|>r1
* @property int|null $var2
* @property int|null $var3
* @property string|null $stringcol
*/
class NullValues extends ActiveRecord
{
public static function tableName()
{
return 'null_values';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyri... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
use yii\db\ActiveQuery;
/**
* Class Order.
*
* @property int $id
* @property int $customer_id
* @property int $create... | fim | yiisoft/yii2 | php |
<|fim_suffix|>d' => true,
'typecastAfterSave' => false,
'typecastBeforeSave' => false,
],
];
}
public function getOrder()
{
return $this->hasOne(Order::class, ['id' => 'order_id']);
}
public function getItem()
{
return $this->... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\ar;
use ReflectionClass;
/**
* OrderItemWithConstructor.
*
* @property int $order_id
* @property... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
/**
* Class OrderItem.
*
* @property int $order_id
* @property int $item_id
* @property int $quantity
* @pro<|fim_suf... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\ar;
use ReflectionClass;
/**
* OrderWithConstructor.
*
* @property int $id
* @property int $cust... | fim | yiisoft/yii2 | php |
<|fim_suffix|>null_fk';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
/**
* Class Order.
*
* @property int $id
* @property int $customer_id
* @property int ... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://<|fim_suffix|> {
return 'profile';
}
}
<|fim_middle|>www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
/**
* Class Profile.
*
* @property int $id
* @propert... | fim | yiisoft/yii2 | php |
<|fim_suffix|>n instance($refresh = false)
{
return self::instantiate([]);
}
public static function instantiate($row)
{
return (new ReflectionClass(static::class))->newInstanceWithoutConstructor();
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyrig<|fim_... | fim | yiisoft/yii2 | php |
<|fim_suffix|>e
*
* @author Dmytro Naumenko <d.naumenko.a@gmail.com>
* @property int $id
* @property array $data
*/
class Storage extends ActiveRecord
{
public static function tableName()
{
return 'storage';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyr... | fim | yiisoft/yii2 | php |
<|fim_suffix|>tringcol
* @property mixed $RV
*/
class TestTrigger extends ActiveRecord
{
public static function tableName()
{
return 'test_trigger';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @<|fim_middle|>license https... | fim | yiisoft/yii2 | php |
<|fim_suffix|>TriggerAlert.
*
* @property int $id
* @property string $stringcol
*/
class TestTriggerAlert extends ActiveRecord
{
public static function tableName()
{
return 'test_trigger_alert';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyrigh<|fim_middle|>t Copyr... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\ar;
/**
* Model representing type table.
*
* @property string $bigint_col
* @property int $int_col
* @property int $int_co... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\base;
use ArrayAccess;
use ReturnTypeWillChange;
/**
* ArrayAccessObject
* Object that extends [[TraversableObje... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\base;
class CallableClass
{
public function __invoke()
{
return true;
}
}
<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.c<|fim_suffix|>
namespace yiiunit\data\base;
use yii\base\Model;
/**
* InvalidRulesModel.
*/
class InvalidRulesModel extends Model
{
public function rules()
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\base;
use yii\base\Model;
/**
<|fim_suffix|>s->rules;
}
}
<|fim_middle|> * Model to test different rules combinations in M... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\base;
use yii\base\Model;
/**
* Singer.
*/
class Singer extends Model
{
public static $tableName;
public $firstName... | fim | yiisoft/yii2 | php |
<|fim_suffix|> return $this->_checkedValues;
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\base;
use yii\base\Model;
/**
* Speaker.
*/
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\base;
use Iterator;
use Countable;
use ReturnTypeWillChange;
use Exception;
/**
* TraversableObject... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii<|fim_suffix|>n Vahrmeijer <vahrmeijer@gmail.com>
* @since 2.0.11
*/
class MockDependency extends Dependency
{
protected function ge... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/**
* This is the configuration file for the Yii 2 unit tests.
*
* You can override configuration values by creating a `config.local.php` file
* an... | fim | yiisoft/yii2 | php |
<|fim_suffix|>'/config.local.php')) {
include __DIR__ . '/config.local.php';
}
return $config;
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/**
* This is the configuration file for the Yii 2... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframew<|fim_suffix|>k.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\console\controllers;
use yii\console\Controller;
/**
* @author Dmitry V. Alekseev <mail@alexeevdv.ru>
* @since 2... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\console\controllers;
use yii\console\Controller;
/**
* @author Dmitry V. Alekseev <mail@alexeevdv.ru>
* @since 2.0.16
*/
class FakeEmptyC... | fim | yiisoft/yii2 | php |
<|fim_suffix|>.16
*/
class FakeNoDefaultController extends Controller
{
public $defaultAction = 'not-exist';
public function actionIndex()
{
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
*<|fim_middle|> @license https://www.yiifr... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\console\controllers\fixtures;
use yii\test\ActiveFixture;
class DependentActiveFixture extends Activ... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright C<|fim_suffix|>ureData[] = 'some data set for first fixture';
}
public function unload(): void
{
FixtureStorage::$firstFixtureData = [];
}
}
<|fim_middle|>opyright (c) 2008 Yii Software LLC
* @license https://www.yii... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\console\controllers\fixtures;
use yii\test\ActiveFixture;
class FirstIndependentActiveFixture extend... | fim | yiisoft/yii2 | php |
<|fim_suffix|>tic::$secondFixtureData = [];
static::$subdirFirstFixtureData = [];
static::$subdirSecondFixtureData = [];
static::$activeFixtureSequence = [];
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiifram<|fim_middle|>ework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
*... | fim | yiisoft/yii2 | php |
<|fim_suffix|>globalFixturesData[] = 'some data set for global fixture';
}
public function unload(): void
{
FixtureStorage::$globalFixturesData = [];
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework<|fim_middle|>.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license h... | fim | yiisoft/yii2 | php |
<|fim_suffix|>n unload(): void
{
FixtureStorage::$secondFixtureData = [];
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
<|fim_middle|>namespace yiiunit... | fim | yiisoft/yii2 | php |
<|fim_suffix|>nimal';
public function load(): void
{
FixtureStorage::$activeFixtureSequence[] = self::class;
parent::load();
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?ph<|fim_suffix|>cense/
*/
declare(strict_types=1);
namespace yiiunit\data\console\controllers\fixtures\subdir;
use yii\test\Fixture;
use yiiunit\data\console\controllers\fixtures\FixtureStorage;
class FirstFixture extends Fixture
{
public function load(): void
{
FixtureStorage::$sub... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\console\controllers\fixtures\subdir;
use yii\tes<|fim_suffix|>
public function unload(): void
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles adding columns to table `{{%{table}}}`.
* Has foreign keys to the tables:
*
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles adding columns to table `{{%{table}}}`.
* Has foreign keys to the tables:
*
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$na<|fim_suffix|> \$this->dropColumn('{{%{table}}}', 'body');
\$this->dropColumn('{{%{table}}}', 'price');
\$... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles adding columns to table `{{%{table}}}`.
*/
class {$class} extends Migration
{
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles the creation of table `{{%test}}`.
*/
class {$class} extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
\$this->createTable('{{%test}}', [
'id' => \$this->pr... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework<|fim_suffix|>money(11,2)->notNull(),
'parenthesis_in_comment' => \$this->string(255)->notNull()->comment('Name of set (RU)'),
]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
\$this->dropTable('{{%... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @<|fim_suffix|>t")->after("id"),
'body' => \$this->text()->notNull()->defaultValue("test")->after("title"),
'address' => \$this->text()->notNull()->defaultValue("test")->after("bo... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$name<|fim_suffix|>r table `{{%user_order}}`
\$this->addForeignKey(
'{{%fk-{table}-order_id}}',
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ion safeDown()
{
\$this->dropTable('{{%{table}}}');
}
}
CODE;
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles the creation of table `{{%{table}}}`.<|fim_suffix|> }
/**
* {@inher... | fim | yiisoft/yii2 | php |
<|fim_suffix|> '{{%fk-{table}-product_id}}',
'{{%{table}}}'
);
// drops index for column `product_id`
\$this->dropIndex(
'{{%idx-{table}-product_id}}',
'{{%{table}}}'
);
// drops foreign key for table `{{%user_order}}`
\$this-... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
use yii\db\Migration;
/**
* Handles the creation of table `<|fim_suffix|>s {$class} extends Migration
{
/**
* {@inheri... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copy<|fim_suffix|>{%{table}}}`.
*/
class {$class} extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
\$this->createTable('{{%{table}}}', [
'id' => \$this->primaryKey(),
]);
}
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>s->dropTable('{{%{table}}}');
}
}
CODE;
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles the creation of tabl... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles the creation of table `{{%test}}`.
*/
class {$class} extends Migration
{
/**
* {@in... | fim | yiisoft/yii2 | php |
<|fim_suffix|>bigPrimaryKey()->unsigned(),
]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
\$this->dropTable('{{%{table}}}');
}
}
CODE;
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyr<|fim_middle|>ight Copyright (c) 2008 Yii Software LL... | fim | yiisoft/yii2 | php |
<|fim_suffix|> */
public function safeUp()
{
\$this->createTable('{{%{table}}}', [
'brand_id' => \$this->primaryKey()->unsigned(),
]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
\$this->dropTable('{{%{table}}}');
}
}
CODE;
<|fim_p... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @l<|fim_suffix|>ransaction.
public function up()
{
}
public function down()
{
echo "{$class} cannot be reverted.\\n";
return false;
}
*/
}
CODE;
<|fim_middle|>ink https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https<|fim_suffix|>->addColumn('{{%{table}}}', 'price', \$this->money(11,2)->notNull());
\$this->addColumn('{{%{table}}}', 'created_at', \$this->dateTime());
}
}
CODE;
<|fim_middle|>://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ww.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles the dropping of table `{{%{table}}}`.
*/
class {$class} extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
\$this->dropTable('{{%{table}}}');
}
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<COD<|fim_suffix|>afeUp()
{
\$this->dropTable('{{%{table}}}');
}
/**
* {@inheritdoc}
*/
public function saf... | fim | yiisoft/yii2 | php |
<|fim_suffix|> safeDown()
{
\$this->createTable('{{%{table}}}', [
'id' => \$this->primaryKey(),
]);
}
}
CODE;
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
retu... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
return <<<CODE
<?php
{$namespace}use yii\db\Migration;
/**
* Handles the creation of table `{{%{junctionTable}}}`.
* Has foreign keys to the tables... | fim | yiisoft/yii2 | php |
<|fim_suffix|>r.php',
], $this->actionConfig),
];
}
}
<|fim_prefix|><?php
declare(strict_types=1);
namespace yiiunit\data\controllers;
use yii\web\Controller;
use yii\web\ErrorAction;
class TestController extends Controller
{
public $layout = '@yiiunit/data/views/layout.php';
privat... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\helpers;
/**
* CustomDebugInfo serve<|fim_suffix|>nual/en/language.oop5.magic.php#language.oop5.magic.debuginfo
*
* ... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license h<|fim_suffix|>ramework\i18n\DbMessageSourceTest::setUpBeforeClass()
* Do not forget to update it in after changing this file!
*/
return [
'Hello world!' => 'Hallo Welt!',
];
<|fim_middle|... | fim | yiisoft/yii2 | php |
<|fim_suffix|> Do not forget to update it in after changing this file!
*/
return [
'The dog runs fast.' => 'Der Hund rennt schnell.',
'His speed is about {n} km/h.' => 'Seine Geschwindigkeit beträgt {n} km/h.',
'His name is {name} and his speed is about {n, number} km/h.' => 'Er heißt {name} und ist {n, nu... | fim | yiisoft/yii2 | php |
<|fim_suffix|>/**
* Messages are copy-pasted in \yiiunit\framework\i18n\DbMessageSourceTest::setUpBeforeClass()
* Do not forget to update it in after changing this file!
*/
return [
'The dog runs fast.' => 'The dog runs fast (en-150).',
];
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyr... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii S<|fim_suffix|>e it in after changing this file!
*/
return [
'The dog runs fast.' => 'The dog runs fast (en-US).',
];
<|fim_middle|>oftware LLC
* @license https://www.yiiframework.com/license/
*/
/**
* Messages... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/**
* Messages are copy-pasted in \yiiunit\framework\i18n\DbMessageSourceTest::setUpBeforeClass()
* Do not forget to update it in after changing this file!
*/
ret... | fim | yiisoft/yii2 | php |
<|fim_suffix|>
namespace yiiunit\data\modules\magic;
class Module extends \yii\base\Module
{
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copy<|fim_middle|>right (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\modules\magic\controllers;
use yii<|fim_suffix|> return '';
}
public function actionDe... | fim | yiisoft/yii2 | php |
<|fim_suffix|>) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\modules\magic\controllers\subFolder;
use yii\console\Controller;
class SubController extends Controller
{
public function actionTest(): string
{
return '';
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ww.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\rbac;
class UserID
{
private $id;
public function __construct($id)
{
$this->id = $id;
}
public function __toString()
{
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\validators;
use yii\validators\Validator;
class TestValidator extends Validator
{
private $_vali... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\validators\models;
use yii\base\Model;
/**
* @property mixed $attr
* @property mixed $attr_url
* @property mixed $attr_string
* @propert... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\validators\models;
use yii\base\Model;
use yii\web\UploadedFile;
class F<|fim_suffix|>lic ?UploadedFile $single = null;
p... | fim | yiisoft/yii2 | php |
<|fim_suffix|> $this->addError($attribute, 'Each & Inline validators bug');
}
}]],
];
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit... | fim | yiisoft/yii2 | php |
<|fim_suffix|>unctionModel extends Model
{
public $firstAttribute;
public function required()
{
return true;
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
<|fim_suffix|>}
public function getReferences()
{
return $this->hasMany(ValidatorTestRefModel::class, ['ref' => 'id']);
}
}
<|fim_middle|>* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/licens... | fim | yiisoft/yii2 | php |
<|fim_suffix|>dels;
use yiiunit\data\ar\ActiveRecord;
/**
* @property int $id
* @property string $a_field
* @property int $ref
*/
class ValidatorTestRefModel extends ActiveRecord
{
public $test_val = 2;
public $test_val_fail = 99;
public static function tableName()
{
return 'validator_ref... | fim | yiisoft/yii2 | php |
<|fim_suffix|>edPropModel extends Model
{
public array $arrayTypedProperty = [true, false];
}
<|fim_prefix|><?php
/**
* @link https://www.yi<|fim_middle|>iframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yiiunit\data\validators\model... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @var string $name
* @var string $message
* @var \Exce<|fim_suffix|> ?>
<|fim_middle|>ption $exception
*/
?>
Name: <?= $name ?>
Code: <?= Yii::$app->response->statusCode ?>
Message: <?= $message ?>
Exception: <?= get_class($exception)<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/** @var \Exception $exception */
?>
Code: <?= Yii::$app->response->statusCo<|fim_suffix|>lass($exception) ?>
<|fim_middle|>de ?>
Message: <?= $exception->getMessage() ?>
Exception: <?= get_c<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_suffix|>hp endif;
<|fim_prefix|><?php if (method_exists($this, 'beginPage')): ?>
<?php $this->beginPage(); ?>
<?php endif; ?>
Exception View
<?php if (method_exist<|fim_middle|>s($this, 'endBody')): ?>
<?php $this->endBody(); ?>
<?php endif; ?>
<?php if (method_exists($this, 'endPage')): ?>
<?php $this->endPage()... | fim | yiisoft/yii2 | php |
<|fim_suffix|>his->beginBody(); ?>
<?= $content ?>
<?php $this->endBody(); ?>
</body>
</html>
<?php $this->endPage(); ?>
<|fim_prefix|><?php
/**
* @var \yii\web\View $this
* @var string $content
*/
?>
<?php $this->beginPage(); ?>
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<?php $this-<|fim_middle|>>... | fim | yiisoft/yii2 | php |
<|fim_suffix|>c\'];') ?>"
}
<?php
$this->endBody();
$this->endPage();
?>
<|fim_prefix|><?php
/** @var \yii\web\View $this */
/** @var string $static */
$this->beginPage();
$this->head();
$this->beginBody();
?>
{
"static": "<?= $static ?>",
"d<|fim_middle|>ynamic": "<?= $this->renderDynamic('return Yii::$app->pa... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/** @var \yii\web\View $this */
?><?ph<|fim_suffix|>php $this->endPage(); ?>
<|fim_middle|>p $this->beginPage(); ?>1<?php $this->head(); ?>2<?php $this->beginBody(); ?>3<?php $this->endBody(); ?>4<?<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_suffix|>ew file.
<|fim_prefix|>This is a damn simple<|fim_middle|> vi<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_suffix|><|fim_prefix|><?php
use yii\grid\GridView;
/**
* @var yii\web\View $this
*<|fim_middle|> @var array $options
*/
echo GridView::widget($options);<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
use yii\widgets\ListView;
/**
* @link https://www.yiiframework.com/
* @c<|fim_suffix|> (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*
* @var array|object $model
* @var string $key
* @var int $index
* @var ListView $widget
*/
echo "Item #{$index}: {$model['log... | fim | yiisoft/yii2 | php |
<|fim_suffix|>jQuery plugin :)<|fim_prefix|>// Let's im<|fim_middle|>agine this is a <|endoftext|> | fim | yiisoft/yii2 | javascript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.