text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>ns QueryInterface object
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$value = $this->getValue();
if ($value instanceof QueryInterface) {
throw new InvalidConfigException('The JsonExpression class can not be serialized to JSON when the value is... | fim | yiisoft/yii2 | php |
<|fim_suffix|>table the table to be commented. The table name will be properly quoted by the method.
* @param string $comment the text of the comment to be added. The comment will be properly quoted by the method.
* @since 2.0.8
*/
public function addCommentOnTable($table, $comment)
{
$ti... | 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\db;
/**
* The MigrationInterface defines the minimum set of methods to be implemented by a database migration.
*
* Each migration cla... | 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/<|fim_suffix|> $type
*/
public function __construct($value, $type)
{
$this->value = $value;
$this->type = $type;
}
/**
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>blic const PARAM_PREFIX = ':pv';
/**
* {@inheritdoc}
*/
public function build(ExpressionInterface $expression, array &$params = [])
{
$placeholder = static::PARAM_PREFIX . count($params);
$params[$placeholder] = $expression;
return $placeholder;
}
}
<|fim... | 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\db;
use Yii;
use yii\base\Component;
use yii\base\InvalidArgumentException;
use yii\helpers\ArrayHelper;
use yii\base\InvalidConfigExcep... | 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\db;
use yii\base\InvalidArgumentException;
use yii\base\NotSupportedException;
use yii\db\conditions\ConditionInterface;
use yii\db\conditions\HashCon... | 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\db;
/**
* Class QueryExpressionBuilder is used internally to build [[Query]] object
* using unified [[QueryBuilder]] expression building interface.
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>* @see orWhere()
*/
public function andWhere($condition);
/**
* Adds an additional WHERE condition to the existing one.
* The new condition and the existing one will be joined using the 'OR' operator.
* @param array $condition the new WHERE condition. Please refer to [[where()... | 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\db;
use yii\base\NotSupportedException;
/**
* The BaseQuery trait represents the minimum method set of a database Query.
*
* It is supposed to be ... | fim | yiisoft/yii2 | php |
<|fim_suffix|>thod will call a `'getTable' . ucfirst($type)` named method with the table name
* and the refresh flag to obtain the metadata.
* @param string $schema the schema of the metadata. Defaults to empty string, meaning the current or default schema name.
* @param string $type metadata type.
... | 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\db;
/**
* SchemaBuilderTrait contains shortcut methods to create instances of [[ColumnSchemaBuilder]].
*
* These can be used in datab... | 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\db;
use yii\base\BaseObject;
/**
* SqlToken represents SQL tokens produced by [[SqlTokenizer]] or its child classes.
*
* @property S... | 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\db;
use yii\base\Component;
use yii\base\InvalidArgumentException;
/**
* SqlTokenizer splits an SQL query into individual SQL tokens.
*
* It can b... | fim | yiisoft/yii2 | php |
<|fim_suffix|>extends Exception
{
/**
* @return string the user-friendly name of this exception
*/
public function getName()
{
return 'Stale Object Exception';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @lice... | fim | yiisoft/yii2 | php |
<|fim_suffix|>**
* Manually specifies the primary key for this table.
* @param string|array $keys the primary key (can be composite)
* @throws InvalidArgumentException if the specified key cannot be found in the table.
*/
public function fixPrimaryKey($keys)
{
$keys = (array) $keys;
... | fim | yiisoft/yii2 | php |
<|fim_suffix|> // but the event handler to "commitTransaction" throw an exception
return;
}
$this->_level--;
if ($this->_level === 0) {
Yii::debug('Roll back transaction', __METHOD__);
// make sure the transaction wasn't autocommitted
if ($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/
*/
namespace yii\db;
/**
* ViewFinderTrait implements the method getViewNames for finding views in a database.
*
* @author Qiang Xue <qiang.xue@gmail.... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframewor<|fim_suffix|>
namespace yii\db\conditions;
/**
* Condition that connects two or more SQL expressions with the `AND` operator.
*
* @author Dmytro Naumenko <d.naumenko... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ntervalStartColumn()
{
return $this->intervalStartColumn;
}
/**
* @return string|ExpressionInterface|Query
*/
public function getIntervalEndColumn()
{
return $this->intervalEndColumn;
}
/**
* {@inheritdoc}
* @throws InvalidArgumentException... | fim | yiisoft/yii2 | php |
<|fim_suffix|>
}
return $this->queryBuilder->bindParam($value, $params);
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\db\conditions;
use yii\db\ExpressionBu... | 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\db\conditions;
use yii\base\InvalidArgumentException;
/**
* Class BetweenCondition represents a `BETWEEN` condition.
*
* @author Dmytro Naumenko <... | fim | yiisoft/yii2 | php |
<|fim_suffix|>on that will not be additionally
* escaped or quoted.
*
* @param ExpressionInterface|BetweenCondition $expression the expression to be built.
* @param array $params the binding parameters.
* @return string the raw SQL that will not be additionally escaped or quoted.
*/
pu... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ww.yiiframework.com/license/
*/
namespace yii\db\conditions;
use yii\base\InvalidParamException;
use yii\db\ExpressionInterface;
/**
* Interface ConditionInterface should be implemented by classes that represent a condition
* in DBAL of framework.
*
* @author Dmytro Naumenko <d.naumenko.a@gmail.co... | 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\db\conditions;
/**
* Class ConjunctionCondition
*
* @author Dmytro Naumenko <d.naumenko.a@gmail.com>
* @since 2.0.14
*/
abstract class Conjunctio... | fim | yiisoft/yii2 | php |
<|fim_suffix|>tion) {
if (is_array($condition)) {
$condition = $this->queryBuilder->buildCondition($condition, $params);
}
if ($condition instanceof ExpressionInterface) {
$condition = $this->queryBuilder->buildExpression($condition, $params);
... | 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\db\conditions;
use yii\base\InvalidArgumentException;
use yii\db\Query;
/**
* Condition that represents `EXISTS` operator.
*
* @auth... | 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\db\conditions;
use yii\db\ExpressionBuilderInterface;
use yii\db\ExpressionBuilderTrait;
use yii\db\ExpressionInterface;
/**
* Class E... | fim | yiisoft/yii2 | php |
<|fim_suffix|>sh = $hash;
}
/**
* @return array|null
*/
public function getHash()
{
return $this->hash;
}
/**
* {@inheritdoc}
*/
public static function fromArrayDefinition($operator, $operands)
{
return new static($operands);
}
}
<|fim_prefix|><?... | 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\db\conditions;
use yii\db\ExpressionBuilderInterface;<|fim_suffix|>ace;
use yii\db\Query;
use yii\helpers\ArrayHelper;
/**
* Class Has... | fim | yiisoft/yii2 | php |
<|fim_suffix|>etColumn()
{
return $this->column;
}
/**
* @return ExpressionInterface[]|string[]|int[]
*/
public function getValues()
{
return $this->values;
}
/**
* {@inheritdoc}
* @throws InvalidArgumentException if wrong number of operands have been giv... | 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\db\conditions;
use yii\db\Expression;
use yii\db\ExpressionBuilderInterface;
use yii\db\ExpressionBuilderTrait;
use yii\db\ExpressionInterface;
use yi... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**<|fim_suffix|>aping is condition builder responsibility.
* Note that when using an escape mapping (or the third operand is not provided),
* the values will be automatically enclosed within a pair of percentage characters.
*/
public function setEscapingReplacements($escapingRep... | 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\db\conditions;
use yii\base\InvalidArgumentException;
use yii\db\ExpressionBuilderInterface;
use yii\db\ExpressionBuilderTrait;
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\db\conditions;
use yii\base\InvalidArgumentException;
/**
<|fim_suffix|>()
{
return $this->condition;
}
/**
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>NegationOperator()
{
return 'NOT';
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\db\conditions;
use yii\db\ExpressionBuilderInterface;
use yii\db\Ex... | 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\db\conditions;
/**
* Condition that connects two or more SQL expressions with the `AND` operator.
*
* @author Dmytro Naumenko <d.naum... | 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\db\conditions;
use yii\base\InvalidArgumentException;
/**
* Class SimpleCondition represents a simple condition like `"column" operato... | 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\db\conditions;
use yii\db\ExpressionBuilderInterface;
use yii\db\Expr<|fim_suffix|>ildExpression($column, $params);
} elseif (is... | 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\db\cubrid;
use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
/**
* ColumnSchemaBuilder is the schema builder for Cubrid d... | 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\db\cubrid;
use yii\base\InvalidArgumentException;
use yii\base\NotSupportedException;
use yii\db\Exception;
use yii\db\Expression;
/**
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>Constraint([
'name' => $name,
'columnNames' => ArrayHelper::getColumn($foreignKey, 'FKCOLUMN_NAME'),
'foreignTableName' => $foreignKey[0]['PKTABLE_NAME'],
'foreignColumnNames' => ArrayHelper::getColumn($foreignKey, 'PKCOLUMN_NAME'),
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>value based on [[\yii\db\Schema::quoteValue()]].
* {@inheritdoc}
*/
protected $escapingReplacements = [
'%' => '!%',
'_' => '!_',
'!' => '!!',
];
}
<|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 Co<|fim_suffix|> /**
* Prepares default value and converts it according to [[phpType]]
* @param mixed $value default value
* @return mixed converted value
* @since 2.0.24
*/
public function defaultPhpTypecast($v... | fim | yiisoft/yii2 | php |
<|fim_suffix|>
{
if ($this->getTypeCategory() === self::CATEGORY_PK) {
$format = '{type}{check}{comment}{append}';
} else {
$format = $this->format;
}
return $this->buildCompleteString($format);
}
/**
* Changes default format string to MSSQL ALT... | fim | yiisoft/yii2 | php |
<|fim_suffix|> }
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c)<|fim_middle|> 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\db\mssql;
/**
* This is an extension of the default PDO class of DBLIB drivers.
* It provides ... | fim | yiisoft/yii2 | php |
<|fim_suffix|>f the last inserted ID.
* @param string|null $sequence the sequence name. Defaults to null.
* @return string|false last inserted ID value.
*/
#[\ReturnTypeWillChange]
public function lastInsertId($sequence = null)
{
return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTIT... | 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\db\mssql;
use yii\base\InvalidArgumentException;
use yii\base\NotSupportedException;
use yii\db\Expression;
use yii\db\Query;
use yii\db... | 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\db\mssql;
use Yii;
use yii\db\CheckConstraint;
use yii\db\Constraint;
use yii\db\ConstraintFinderInterface;
use yii\db\ConstraintFinderTrait;
use yii\... | fim | yiisoft/yii2 | php |
<|fim_suffix|>sertId() : parent::lastInsertId($sequence);
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\db\mssql;
/**
* This is an extension of the default PDO class of SQLS... | fim | yiisoft/yii2 | php |
<|fim_suffix|>\yii\db\TableSchema
{
/**
* @var string|null name of the catalog (database) that this table belongs to.
* Defaults to null, meaning no catalog (or the current database).
*/
public $catalogName;
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright... | fim | yiisoft/yii2 | php |
<|fim_suffix|>foreach ($columns as $i => $column) {
if ($column instanceof Expression) {
$column = $column->expression;
}
$quotedColumns[$i] = strpos($column, '(') === false ? $this->queryBuilder->db->quoteColumnName($column) : $column;
}
$vss = [];
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>escapingReplacements = [
'%' => '[%]',
'_' => '[_]',
'[' => '[[]',
']' => '[]]',
'\\' => '[\\]',
];
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/licen... | 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\db\mysql;
use yii\db\ExpressionInterface;
use yii\db\JsonExpression;
/**
* Class ColumnSchema for MySQL database
*
* @author Dmytro ... | 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\db\mysql;
use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
/**
* ColumnSchemaBuilder is the schema builder <|fim_suffix|... | 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\db\mysql;
use yii\db\ExpressionBuilderInterface;
use yii\db\ExpressionBuilderTrait;
use yii\db\ExpressionInterfac... | fim | yiisoft/yii2 | php |
<|fim_suffix|> => 'timestamp',
Schema::TYPE_TIME => 'time',
];
if ($this->supportsFractionalSeconds()) {
$map = [
Schema::TYPE_DATETIME => 'datetime(0)',
Schema::TYPE_TIMESTAMP => 'timestamp(0)',
Schema::TYPE_TIME => 'time(0)',
... | 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\db\mysql;
use Yii;
use yii\base\InvalidConfigException;
use yii\base\NotSupportedException;
use yii\db\CheckConstraint;
use yii\db\Constraint;
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\db\oci;
use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
/**
* ColumnSchemaBuilder is the schema builder for Oracle data... | fim | yiisoft/yii2 | php |
<|fim_suffix|>nse https://www.yiiframework.com/license/
*/
namespace yii\db\oci;
/**
* Command represents an Oracle SQL statement to be executed against a database.
*
* {@inheritdoc}
*
* @since 2.0.33
*/
class Command extends \yii\db\Command
{
/**
* {@inheritdoc}
*/
protected function bindPen... | 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\db\oci;
use yii\base\InvalidArgumentException;
use yii\db\Connection;
use yii\db\Exception;
use yii\db\Expression;
use yii\db\Query;
use... | 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\db\oci;
use Yii;
use yii\base\InvalidCallException;
use yii\base\NotSupportedException;
use yii\db\CheckConstraint;
use yii\db\ColumnSch... | fim | yiisoft/yii2 | php |
<|fim_suffix|>on to be built.
* @param array $params the binding parameters.
* @return string|null null when split is not required. Otherwise - built SQL condition.
*/
protected function splitCondition(InCondition $condition, &$params)
{
$operator = $condition->getOperator();
$val... | 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\db\oci\conditions;
use yii\db\ExpressionInterface;
/**
* {@inheritdoc}
*/
class LikeConditionBuilder extends \yii\db\conditions\LikeC... | 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\db\pgsql;
use yii\db\ArrayExpression;
use yii\db\ExpressionBuilderInterface;
use yii\db\ExpressionBuilderTrait;
use yii\db\ExpressionInt... | 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\db\pgsql;
/**
* The class converts PostgreSQL array representation to PHP array
*
* @author Sergei Tigrov <rrr-r@ya.ru>
* @author Dm... | 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\db\pgsql;
use yii\db\ArrayExpression;
use yii\db\ExpressionInterface;
use yii\db\JsonExpression;
/**
* Class ColumnSchema for PostgreS... | 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\db\pgsql;
use yii\db\ArrayExpression;
use yii\db\ExpressionBuilderInterface;
use yii\db\ExpressionBuilderTrait;
use yii\db\ExpressionInt... | 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\db\pgsql;
use yii\base\InvalidArgumentException;
use yii\db\Expression;
use yii\db\ExpressionInterface;
use yii\db\Query;
use yii\db\Pdo... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @co<|fim_suffix|>column details for the given table.
* @param TableSchema $table the table metadata
*/
protected function findConstraints($table)
{
$tableName = $this->quoteValue($table->name);
$tableSchema = $this->quo... | 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\db\sqlite;
use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
/**
* ColumnS<|fim_suffix|>peCategory()) {
case ... | 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\db\sqlite;
use yii\db\SqlToken;
use yii\helpers\StringHelper;
/**
* Command represents an SQLite's SQL statement to be executed agains... | 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\db\sqlite;
use yii\base\InvalidArgumentException;
use yii\base\NotSupportedException;
use yii\db\Connection;
use yii\db\Expression;
use ... | fim | yiisoft/yii2 | php |
<|fim_suffix|> $index['origin'] = 'pk';
} elseif ($index['unique'] && $this->isSystemIdentifier($index['name'])) {
$index['origin'] = 'u';
}
}
$result['indexes'][] = new IndexConstraint([
'isPrimary' => $index['o... | 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\db\sqlite;
/**
* SqlTokenizer splits SQLite query into individual SQL tokens.
* It's used to obtain a `CHECK` constraint information f... | fim | yiisoft/yii2 | php |
<|fim_suffix|>m($value[$column], $params);
$vs[] = $quotedColumns[$i] . ($operator === 'IN' ? ' = ' : ' != ') . $phName;
} else {
$vs[] = $quotedColumns[$i] . ($operator === 'IN' ? ' IS' : ' IS NOT') . ' NULL';
}
}
$vss[] = ... | 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\db\sqlite\conditions;
/**
* {@inheritdoc}
*/
class LikeConditionBuilder extends \yii\db\conditions\LikeConditionB... | 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\di;
use ReflectionClass;
use ReflectionException;
use ReflectionNamedType;
use ReflectionParameter;
use Yii;
use yii\base\Component;
use... | fim | yiisoft/yii2 | php |
<|fim_suffix|>/
public static function __set_state($state)
{
if (!isset($state['id'])) {
throw new InvalidConfigException('Failed to instantiate class "Instance". Required parameter "id" is missing');
}
return new self($state['id']);
}
}
<|fim_prefix|><?php
/**
* @link... | fim | yiisoft/yii2 | php |
<|fim_suffix|>on
{
/**
* {@inheritdoc}
*/
public function __construct($class, $message = null, $code = 0, $previous = null)
{
if ($message === null) {
$message = "Can not instantiate $class.";
}
parent::__construct($message, $code, $previous);
}
/**
... | fim | yiisoft/yii2 | php |
<|fim_suffix|>n array representing a class method (e.g. `['Foo', 'bar']`).
* The callable will be called by [[get()]] to return an object associated with the specified component ID.
* - an object: When [[get()]] is called, this object will be returned.
*
* @throws InvalidConfigException if the def... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ll be denied.
*
* To use AccessControl, declare it in the `behaviors()` method of your controller class.
* For example, the following declarations will allow authenticated users to access the "create"
* and "update" actions and deny all other users from accessing these two actions.
*
* ```
* public... | fim | yiisoft/yii2 | php |
<|fim_suffix|> like in the following code:
*
* ```
* 'rules' => [
* [
* 'allow' => true,
* 'actions' => ['update'],
* 'roles' => ['updatePost'],
* 'roleParams' => function($rule) {
* return ['post' => Post::findOne(Yii::$app->r... | 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\filters;
use Yii;
use yii\base\ActionFilter;
use yii\base\Component;
use yii\web\BadRequestHttpException;
use yii\web\Request;
/**
* A... | 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\filters;
use Yii;
use yii\base\ActionFilter;
use yii\base\BootstrapInterface;
use yii\base\Component;
use yii\web\BadRequestHttpExceptio... | 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\filters;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
use yii\base\Component;
use yii\base\Controller;
use yii\base\InvalidConfigException... | 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\filters;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
use yii\base\Component;
use yii\base\Controller;
use yii\helpers\Strin... | fim | yiisoft/yii2 | php |
<|fim_suffix|>ing turning off automatic sending of cache headers entirely.
* You may set this property to be `public`, `private`, `private_no_expire`, and `nocache`.
* Please refer to [session_cache_limiter()](https://www.php.net/manual/en/function.session-cache-limiter.php)
* for detailed explanation of... | fim | yiisoft/yii2 | php |
<|fim_suffix|>
$response->{$name} = $data[$name];
}
foreach (['headers', 'cookies'] as $name) {
if (isset($data[$name]) && is_array($data[$name])) {
$response->{$name}->fromArray(array_merge($data[$name], $response->{$name}->toArray()));
}
}
... | fim | yiisoft/yii2 | php |
<|fim_prefix|><?php
/**
* @link https://www.y<|fim_suffix|> element is the number of allowed requests,
* and the second element is the corresponding UNIX timestamp.
*/
public function loadAllowance($request, $action);
/**
* Saves the number of allowed requests and the corresponding timestamp t... | 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\filters;
use Closure;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
use yii\base\Component;
use yii\base\Controller;
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\filters;
use Yii;
use yii\base\Action;
use yii\base\ActionEvent;
use yii\base\Behavior;
use yii\web\Controller;
use yii\web\MethodNotAll... | 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\filters\auth;
use yii\web\IdentityInterface;
use yii\web\Request;
use yii\web\Response;
use yii\web\UnauthorizedHttpException;
use yii\w... | fim | yiisoft/yii2 | php |
<|fim_suffix|>
/**
* {@inheritdoc}
*/
public function handleFailure($response)
{
throw new UnauthorizedHttpException('Your request was made with invalid credentials.');
}
/**
* Checks, whether authentication is optional for the given action.
*
* @param Action $acti... | 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\filters\auth;
use Yii;
use yii\base\ActionFilter;
use yii\base\Component;
use yii\base\Controller;
use yii\base\InvalidConfigException;
... | fim | yiisoft/yii2 | php |
<|fim_suffix|> $identity = $user->getIdentity() ?: call_user_func($this->auth, $username, $password);
if ($identity === null) {
$this->handleFailure($response);
} elseif ($user->getIdentity(false) !== $identity) {
$user->login($iden... | fim | yiisoft/yii2 | php |
<|fim_suffix|>m
*/
public $realm = 'api';
/**
* {@inheritdoc}
*/
public function challenge($response)
{
$response->getHeaders()->set('WWW-Authenticate', "Bearer realm=\"{$this->realm}\"");
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copy... | 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\filters\auth;
use yii\base\Component;
/**
* HttpHeaderAuth is an action filter that supports HTTP authentication through HTTP Headers.... | fim | yiisoft/yii2 | php |
<|fim_suffix|>identity !== null) {
return $identity;
}
}
if ($accessToken !== null) {
$this->handleFailure($response);
}
return null;
}
}
<|fim_prefix|><?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Soft... | 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\grid;
use Yii;
use yii\helpers\Html;
use yii\helpers\Url;
/**
* ActionColumn is a column for the [[GridView]] widget that displays buttons for viewi... | fim | yiisoft/yii2 | php |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.