text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | fim | yiisoft/yii2 | php |
<|fim_suffix|>eOrAttribute}».',
'{attribute} must be no greater than {max}.' => '«{attribute}» nu trebuie să fie mai mare ca {max}.',
'{attribute} must be no less than {min}.' => '«{attribute}» nu trebuie să fie mai mic ca {min}.',
'{attribute} must not be a subnet.' => '',
'{attribute} must not be an I... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from sour... | fim | yiisoft/yii2 | php |
<|fim_suffix|>{max, number} {max, plural, one{character} other{characters}}.' => '{attribute} môže obsahovať najviac {max, number} {max, plural, =1{znak} =2{znaky} =3{znaky} =4{znaky} other{znakov}}.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} ... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | fim | yiisoft/yii2 | php |
<|fim_suffix|>} {max, plural, one{character} other{characters}}.' => '{attribute} treba da sadrži najviše {max, number} {max, plural, one{karakter} other{karaktera}}.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} treba da sadrži {length, number} ... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from sour... | fim | yiisoft/yii2 | php |
<|fim_suffix|>r{gigabytes}}' => '{nFormatted} {n, plural, =1{gigabayt} other{gigabayt}}',
'{nFormatted} {n, plural, =1{kibibyte} other{kibibytes}}' => '{nFormatted} {n, plural, =1{kibibayt} other{kibibayt}}',
'{nFormatted} {n, plural, =1{kilobyte} other{kilobytes}}' => '{nFormatted} {n, plural, =1{kilobayt} oth... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | fim | yiisoft/yii2 | php |
<|fim_suffix|> plural, =1{petabyte} other{petabytes}}' => '{nFormatted} {n, plural, one{petabayt} few{petabayt} many{petabayt} other{petabayt}}',
'{nFormatted} {n, plural, =1{tebibyte} other{tebibytes}}' => '{nFormatted} {n, plural, one{tebibayt} few{tebibayt} many{tebibayt} other{tebibayt}}',
'{nFormatted} {n,... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | 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/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extra... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from sour... | fim | yiisoft/yii2 | php |
<|fim_suffix|>該包含至少 {min, number} 個字符。',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} 只能包含最多 {max, number} 個字符。',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} 應該包含 {length,... | fim | yiisoft/yii2 | php |
<|fim_suffix|>$this->db, Connection::className());
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\mutex;
use yii\base\InvalidConfigException;
use yii\db\Connection;
use yii\di... | 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\mutex;
use Yii;
use yii\base\InvalidConfigException;
use yii\helpers\FileHelper;
/**
* FileMutex implements mutex "lock" mechanism via... | 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\mutex;
use yii\base\Component;
/**
* The Mutex component allows mutual execution of concurrent processes in order to prevent "race con... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https<|fim_suffix|>
* 'components' => [
* 'db' => [
* 'class' => 'yii\db\Connection',
* 'dsn' => 'mysql:host=127.0.0.1;dbname=demo',
* ]
* ... | 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\mutex;
use PDO;
use yii\base\InvalidConfigException;
/**
* OracleMutex implements mutex "lock" mechanism via Oracle locks.
*
* Appli... | fim | yiisoft/yii2 | php |
<|fim_suffix|> [':key1' => $key1, ':key2' => $key2]
)->queryScalar();
});
});
}
/**
* Releases lock by given name.
* @param string $name of the lock to be released.
* @return bool release result.
* @see https://www.postgresql.org/docs/9... | fim | yiisoft/yii2 | php |
<|fim_suffix|> false;
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\mutex;
use Closure;
/**
* Trait RetryAcquireTrait.
*
* @author Robert Korulczyk <robert@korulczyk.pl>
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>*/
class Assignment extends BaseObject
{
/**
* @var string|int user ID (see [[\yii\web\User::id]])
*/
public $userId;
/**
* @var string the role name
*/
public $roleName;
/**
* @var int UNIX timestamp representing the assignment creation time
*/
public... | 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\rbac;
use yii\base\Component;
use yii\base\InvalidArgumentException;
use yii\base\InvalidConfigException;
use yii\base\InvalidValueExcep... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\rbac;
/**
* For more details and usage information on CheckAccessInterface, see the [guide article on security authorization](guide:security-authoriz... | fim | yiisoft/yii2 | php |
<|fim_suffix|>m::TYPE_PERMISSION,
'name' => array_keys($result),
]);
$permissions = [];
foreach ($query->all($this->db) as $row) {
/** @var Permission $permission */
$permission = $this->populateItem($row);
$permissions[$row['name']] = $permission;... | fim | yiisoft/yii2 | php |
<|fim_suffix|>$name;
/**
* @var string the item description
*/
public $description;
/**
* @var string|null name of the rule associated with this item
*/
public $ruleName;
/**
* @var mixed the additional data associated with this item
*/
public $data;
/**
* ... | fim | yiisoft/yii2 | php |
<|fim_suffix|>which have rules will be adjusted accordingly.
*/
public function removeAllRules();
/**
* Removes all role assignments.
*/
public function removeAllAssignments();
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC... | 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\rbac;
/**
* For mo<|fim_suffix|>e 2.0
*/
class Permission extends Item
{
/**
* {@inheritdoc}
*/
public $type = self:... | fim | yiisoft/yii2 | php |
<|fim_suffix|> }
foreach ($items as $name => $item) {
if (isset($item['children'])) {
foreach ($item['children'] as $childName) {
if (isset($this->items[$childName])) {
$this->children[$name][$childName] = $this->items[$childName];
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiifra<|fim_suffix|>2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\rbac;
/**
* For more details and usage information on Role, see the [guide article on security authorization](guide:security-authorization).
*
* @author Qiang ... | 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\r<|fim_suffix|>time
*/
public $createdAt;
/**
* @var int UNIX timestamp representing the rule updating time
*/
... | 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/
*/
use yii\base\InvalidConfigException;
use yii\rbac\DbManager;
/**
* Initializes RBAC tables.
*
* @author Alexander Kochetov <creocoder@gmail.com>
*... | fim | yiisoft/yii2 | php |
<|fim_suffix|> $this->dropIndex($this->index, $authManager->assignmentTable);
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
use yii\base\InvalidConfigException;
use yii\db\Migration;... | fim | yiisoft/yii2 | php |
<|fim_suffix|> $this->dropIndex('idx-auth_item-type', $authManager->itemTable);
$this->createIndex('{{%idx-auth_item-type}}', $authManager->itemTable, 'type');
}
/**
* {@inheritdoc}
*/
public function down()
{
$authManager = $this->getAuthManager();
$this->db = $authMa... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
use yii\base\InvalidConfigException;
use yii\db\Migration;
use yii\db\Query;
use yii\rbac\DbManager;
/**
* Fix MSSQL trigger.
*
* @see https://github.com/yiisoft... | fim | yiisoft/yii2 | php |
<|fim_suffix|>mber of checks,
* 'errors' => number of errors,
* 'warnings' => number of warnings,
* ),
* 'requirements' => array(
* array(
* ...
* 'error' => is there an error,
* 'warning' => is there a warning,
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>Data version is ' .
(defined('INTL_ICU_DATA_VERSION') ? INTL_ICU_DATA_VERSION : '(ICU Data is missing)') . '.'
),
array(
'name' => 'Fileinfo extension',
'mandatory' => false,
'condition' => extension_loaded('fileinfo'),
'by' => '<a href="https://www.php.net/... | 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/
*
* @var YiiRequirementChecker $this
* @var array $summary
* @var array[] $requirements
*/
echo "\nYii Application Requirement Checker\n\n";
echo "Thi... | fim | yiisoft/yii2 | php |
<|fim_suffix|> tr.danger>th{background-color:#f2dede;border-color:#ebccd1}
.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}
.alert>p{margin-bottom:0}.alert>p+p{margin-top:5px}
.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}
.alert-info{background-color:#... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @var YiiRequirementChecker $this
* @var array $summary
* @var array[] $requirements
*/
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Yii Application Requirement Checker</title>
<?php $this->renderViewFile(dirname(__FILE__) . '/css.php'); ?>
</head>
<b... | fim | yiisoft/yii2 | php |
<|fim_suffix|>nc($this->findModel, $id, $this);
}
/** @var ActiveRecordInterface $modelClass */
$modelClass = $this->modelClass;
$keys = $modelClass::primaryKey();
if (count($keys) > 1) {
$values = explode(',', $id);
if (count($keys) === count($values)) {... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ritdoc}
*/
protected function verbs()
{
return [
'index' => ['GET', 'HEAD'],
'view' => ['GET', 'HEAD'],
'create' => ['POST'],
'update' => ['PUT', 'PATCH'],
'delete' => ['DELETE'],
];
}
/**
* Checks the p... | 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\rest;
use Yii;
use yii\filters\auth\CompositeAuth;
use yii\filters\ContentNegotiator;
use yii\filters\RateLimiter;
use yii\filters\VerbF... | fim | yiisoft/yii2 | php |
<|fim_suffix|>;
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\rest;
use Yii;
use yii\base\Model;
use yii\helpers\Url;
use yii\web\ServerErrorHttpException;
/**
* CreateActi... | fim | yiisoft/yii2 | php |
<|fim_suffix|>}
Yii::$app->getResponse()->setStatusCode(204);
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\rest;
use Yii;
use yii\web\ServerErrorHttpException;
/**... | fim | yiisoft/yii2 | php |
<|fim_suffix|> null) {
$this->dataFilter = Yii::createObject($this->dataFilter);
if ($this->dataFilter->load($requestParams)) {
$filter = $this->dataFilter->build();
if ($filter === false) {
return $this->dataFilter;
}
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>hor Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*
* @template T of Controller = Controller
* @extends BaseAction<T>
*/
class OptionsAction extends BaseAction
{
/**
* @var array the HTTP verbs that are supported by the collection URL
*/
public $collectionOptions = ['GET', 'POST', 'H... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ta provider.
*/
protected function serializeDataProvider($dataProvider)
{
if ($this->preserveKeys) {
$models = $dataProvider->getModels();
} else {
$models = array_values($dataProvider->getModels());
}
$models = $this->serializeModels($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 yii\rest;
use Yii;
use yii\base\Model;
use yii\db\ActiveRecord;
use yii\web\ServerErrorHttpException;
/**
* UpdateAction implements the AP... | 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\rest;
use Yii;
use yii\base\InvalidConfigException;
use yii\helpers\Inflector;
use yii\web\CompositeUrlRule;
use yii\web\UrlRule as WebU... | fim | yiisoft/yii2 | php |
<|fim_suffix|>del being displayed
*/
public function run($id)
{
$model = $this->findModel($id);
if ($this->checkAccess) {
call_user_func($this->checkAccess, $this->id, $model);
}
return $model;
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.c... | 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\test;
use yii\base\InvalidConfigException;
use yii\db\ActiveRecord;
use yii\db\TableSchema;
/**
* ActiveFixture represents a fixture b... | fim | yiisoft/yii2 | php |
<|fim_suffix|>y<string, mixed>> the data rows. Each array element represents one row of data (column name => column value).
*/
public $data = [];
/**
* Loads the fixture.
*
* The default implementation simply stores the data returned by [[getData()]] in [[data]].
* You should usually ... | fim | yiisoft/yii2 | php |
<|fim_suffix|>\db\ActiveRecord|null the AR model, or null if the model cannot be found in the database
* @throws \yii\base\InvalidConfigException if [[modelClass]] is not set.
*/
public function getModel($name)
{
if (!isset($this->data[$name])) {
return null;
}
if (... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @lice<|fim_suffix|>;
use yii\base\BaseObject;
use yii\db\Connection;
use yii\di\Instance;
/**
* DbFixture is the base class for DB-related fixtures.
*
* DbFixture provides the [[db]] connection to b... | 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\test;
use Yii;
use yii\base\InvalidConfigException;
/**
* FileFixtureTrait provides functionalities for loading data fixture from file... | 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\test;
use yii\base\Component;
/**
* Fixture represents a fixed state of a test environment.
*
* Each fixture instance represents a p... | fim | yiisoft/yii2 | php |
<|fim_suffix|>es(), $this->fixtures()));
}
return $this->_fixtures;
}
/**
* Returns the named fixture.
* @param string $name the fixture name. This can be either the fixture alias name, or the class name if the alias is not used.
* @return Fixture|null the fixture object, or nul... | 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\test;
use Yii;
/**
* InitDbFixture represents the initial state needed for DB-related tests.
*
* Its main task is to toggle integrit... | 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\validators;
use Yii;
use yii\helpers\Json;
/**
* BooleanValidator checks if the attribute value is a boolean value.
*
* Possible boo... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @l<|fim_suffix|>s
* being validated, then the attribute to be compared would be 'password_repeat'.
* @see compareValue
*/
public $compareAttribute;
/**
* @var mixed the consta... | fim | yiisoft/yii2 | php |
<|fim_suffix|>matter($format)
{
if (!isset($this->_dateFormats[$format])) {
// if no time was provided in the format string set timezone to default one to match yii\i18n\Formatter::formatDateTimeValue()
$timezone = strpbrk($format, 'ahHkKmsSA') !== false ? $this->timeZone : $this->de... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.c<|fim_suffix|>on that returns the default value which will
* be assigned to the attributes being validated if they are empty. The signature of the anonymous function
* should be as follows,
*
* ```
* function($model, $attribute) {
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>rs($attribute)) {
continue;
}
if ($this->allowMessageFromRule) {
$validationErrors = $dynamicModel->getErrors($attribute);
$model->addErrors([$attribute => $validationErrors]);
} else {
$this->addError($mo... | fim | yiisoft/yii2 | php |
<|fim_suffix|>matMessage($this->message, [
'attribute' => $model->getAttributeLabel($attribute),
]),
'enableIDN' => (bool) $this->enableIDN,
];
if ($this->skipOnEmpty) {
$options['skipOnEmpty'] = 1;
}
return $options;
}
/**
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>
$targetAttribute = $this->targetAttribute === null ? $attribute : $this->targetAttribute;
if ($this->skipOnError) {
foreach ((array)$targetAttribute as $k => $v) {
if ($model->hasErrors(is_int($k) ? $v : $k)) {
return;
}
... | fim | yiisoft/yii2 | php |
<|fim_suffix|> name
* - {limit}: the value of [[maxFiles]]
*/
public $tooMany;
/**
* @var string the error message used if the count of multiple uploads less that minFiles.
* You may use the following tokens in the message:
*
* - {attribute}: the attribute name
* - {limit}: th... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\validators;
use yii\base\InvalidConfigException;
use yii\helpers\Json;
/**
* FilterValidator converts the attribute value according to a filter.
*
... | fim | yiisoft/yii2 | php |
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\validators;
use Yii;
use yii\helpers\Json;
use yii\web\UploadedFile;
/**
* ImageValidator verifies if an attribute is receiving a valid image.
*
*... | fim | yiisoft/yii2 | php |
<|fim_suffix|> $method($attribute, $this->params, $this, $current);
}
/**
* {@inheritdoc}
*/
public function clientValidateAttribute($model, $attribute, $view)
{
if ($this->clientValidate !== null) {
$method = $this->clientValidate;
if (is_string($method)) ... | 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\validators;
use Yii;
use yii\base\InvalidConfigException;
use yii\helpers\Html;
use yii\helpers\IpHelper;
use yii\helpers\Json;
use 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/
*/
namespace yii\validators;
use Yii;
use yii\helpers\Json;
use yii\helpers\StringHelper;
use yii\web\JsExpression;
/**
* NumberValidator validates tha... | 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\validators;
use yii\web\AssetBundle;
/**
* This asset bundle provides the javascript files needed for the [[EmailValidator]]s c<|fim_s... | 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\validators;
use Yii;
use yii\base\InvalidConfigException;
use yii\helpers\ArrayHelper;
use yii\helpers\Json;
/**
* RangeValidator vali... | fim | yiisoft/yii2 | php |
<|fim_suffix|>OT match the attribute value.
*/
public $not = false;
/**
* {@inheritdoc}
*/
public function init()
{
parent::init();
if ($this->pattern === null) {
throw new InvalidConfigException('The "pattern" property must be set.');
}
if ($... | fim | yiisoft/yii2 | php |
<|fim_suffix|>dValue,
]);
$options['requiredValue'] = $this->requiredValue;
} else {
$options['message'] = $this->message;
}
if ($this->strict) {
$options['strict'] = 1;
}
$options['message'] = $this->formatMessage($options['messag... | fim | yiisoft/yii2 | php |
<|fim_suffix|>alidation rule for that property. Although it has no functionality, it allows Yii to determine that the property is safe to copy.
*
* > Note: [[when]] property is not supported by SafeValidator.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class SafeValidator extends Validator
{
/... | 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\validators;
use Yii;
use yii\helpers\Json;
/**
* StringValidator validates that the attribute value is of certain length.
*
* Note, ... | 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\validators;
use yii\helpers\Json;
/**
* This class converts the attribute value(s) to string(s) and strip characters.
*
* @since 2.0... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.co<|fim_suffix|>ecify the value.
* @param Model $model the data model to be validated
* @param string $attribute the name of the attribute to be validated in t... | fim | yiisoft/yii2 | php |
<|fim_suffix|>odeAsset::register($view);
}
$options = $this->getClientOptions($model, $attribute);
return 'yii.validation.url(value, messages, ' . Json::htmlEncode($options) . ');';
}
/**
* {@inheritdoc}
*/
public function getClientOptions($model, $attribute)
{
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>se https://www.yiiframework.com/license/
*/
namespace yii\validators;
use yii\web\AssetBundle;
/**
* This asset bundle provides the javascript files for client validation.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class ValidationAsset extends AssetBundle
{
public $sourcePat... | 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\validators;
use Yii;
use yii\base\Component;
use yii\base\NotSupportedException;
/**
* Validator is the base class for all validators.... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?p<|fim_suffix|>ble
?>', '<?=
$field['property']
?>', $this-><?=
$field['decorators']
?>);
<?php endforeach;
echo $this->render('_addForeignKeys', [
'table' => $table,
'foreignKeys' => $foreignKeys,
]);
<|fim_middle|>hp
/**
* @var \yii\web\View $... | fim | yiisoft/yii2 | php |
<?php
/**
* Creates a call for the method `yii\db\Migration::createTable()`
*
* @var string $table the name table
* @var string $tableComment the comment table
*/
?> $this->addCommentOnTable('<?= $table ?>', '<?= $tableComment ?>');
<|endoftext|> | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @var array $foreignKeys
* @var string $table
*/
?>
<?php foreach ($foreignKeys as $<|fim_suffix|>
'CASCADE'
);
<?php endforeach;
<|fim_middle|>column => $fkData): ?>
// creates index for column `<?= $column ?>`
$this->createIndex(
'<?= $fkD... | fim | yiisoft/yii2 | php |
<|fim_suffix|>each; ?>
]);
<?= $this->render('_addForeignKeys', [
'table' => $table,
'foreignKeys' => $foreignKeys,
]);
<|fim_prefix|><?php
/**
* Creates a call for the method `yii\db\Migration::createTable()`.
*
* @var \yii\web\View $this
* @var string $table the name table
* @var array $fields t... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @var \yii\web\View $this
* @var string $table
* @var array $foreignKeys
* @var array $fields
*/
echo $this->render('_dropForeignKeys', [
'table' => $table,
'foreignKeys' => $for<|fim_suffix|>foreach ($fields as $field): ?>
$this->dropColumn('<?= $table ?>', '<?= $field[... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @var array $foreignKeys
* @var string $table
*/
?>
<?php foreach ($foreign<|fim_suffix|>ignKey(
'<?= $fkData['fk'] ?>',
'<?= $table ?>'
);
// drops index for column `<?= $column ?>`
$this->dropIndex(
'<?= $fkData['idx'] ?>',
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>('<?= $table ?>');
<|fim_prefix|><?php
/**
* Creates a call for the method `yii\db\Migration::dropTable()`.
*
* @var \yii\web\View $this
*<|fim_middle|> @var string $table the name table
* @var array $foreignKeys the foreign keys
*/
echo $this->render('_dropForeignKeys', [
'table' => $table,
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>foreach;
endif;
<|fim_prefix|><?php
/**
* Creates a call for the method `yii\db\Migration::createTable()`.
*
* @var array $foreignKeys the foreign keys
*/
if (<|fim_middle|>!empty($foreignKeys)):?>
* Has foreign keys to the tables:
*
<?php foreach ($foreignKeys as $fkData): ?>
* - `<?= $fkData['r... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* This view is used by console/controllers/MigrateController.php.
*
* The following variabl<|fim_suffix|>])
?>
}
}
<|fim_middle|>es are available in this view:
*
* @var \yii\web\View $this
* @var string $className the new migration class name without namespace
* @var string $namespac... | fim | yiisoft/yii2 | php |
<|fim_suffix|> '<?= $table ?>',
'<?= $field_second ?>_id'
);
$this->addForeignKey(
'fk-<?= $table . '-' . $field_first ?>_id',
'<?= $table ?>',
'<?= $field_first ?>_id',
'<?= $field_first ?>',
'id',
'CASCADE'
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>lds the fields
* @var array $foreignKeys the foreign keys
*/
echo "<?php\n";
if (!empty($namespace)) {
echo "\nnamespace {$namespace};\n";
}
?>
use yii\db\Migration;
/**
* Handles the creation of table `<?= $table ?>`.
<?= $this->render('_foreignTables', [
'foreignKeys' => $foreignKeys,
]) ?... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* This view is used by console/controllers/MigrateController.php.
*
* The following variables are available in this view:
*
* @var \yii\web\View $this
* @var string $className the new migration class name without namespace
* @var string $namespace the new migration class namespace
* @va... | fim | yiisoft/yii2 | php |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.