Error Info: Array ( [0] => 23000 [1] => 1062 [2] => Duplicate entry '832-uz' for key 'sgcc_message.PRIMARY' )
in /var/www/sgcc.uz/vendor/yiisoft/yii2/db/Command.php at line 1302
$exceptionClass = '\yii\db\Exception'; foreach ($this->exceptionMap as $error => $class) { if (strpos($e->getMessage(), $error) !== false) { $exceptionClass = $class; } } $message = $e->getMessage() . "\nThe SQL being executed was: $rawSql"; $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null; return new $exceptionClass($message, $errorInfo, $e->getCode(), $e); } /** * Returns a value indicating whether a SQL statement is for read purpose. * @param string $sql the SQL statement * @return bool whether a SQL statement is for read purpose. */ public function isReadQuery($sql) {
} else { $this->pdoStatement->execute(); } break; } catch (\Exception $e) { $rawSql = $rawSql ?: $this->getRawSql(); $e = $this->db->getSchema()->convertException($e, $rawSql); if ($this->_retryHandler === null || !call_user_func($this->_retryHandler, $e, $attempt)) { throw $e; } } } }
$this->prepare(false); try { $profile and Yii::beginProfile($rawSql, __METHOD__); $this->internalExecute($rawSql); $n = $this->pdoStatement->rowCount(); $profile and Yii::endProfile($rawSql, __METHOD__); $this->refreshTableSchema();
* @return array|false primary key values or false if the command fails * @since 2.0.4 */ public function insert($table, $columns) { $command = $this->db->createCommand()->insert($table, $columns); if (!$command->execute()) { return false; } $tableSchema = $this->getTableSchema($table); $result = []; foreach ($tableSchema->primaryKey as $name) { if ($tableSchema->columns[$name]->autoIncrement) {
protected function insertInternal($attributes = null) { if (!$this->beforeSave(true)) { return false; } $values = $this->getDirtyAttributes($attributes); if (($primaryKeys = static::getDb()->schema->insert(static::tableName(), $values)) === false) { return false; } foreach ($primaryKeys as $name => $value) { $id = static::getTableSchema()->columns[$name]->phpTypecast($value); $this->setAttribute($name, $id); $values[$name] = $id;
if ($runValidation && !$this->validate($attributes)) { Yii::info('Model not inserted due to validation error.', __METHOD__); return false; } if (!$this->isTransactional(self::OP_INSERT)) { return $this->insertInternal($attributes); } $transaction = static::getDb()->beginTransaction(); try { $result = $this->insertInternal($attributes); if ($result === false) {
* meaning all attributes that are loaded from DB will be saved. * @return bool whether the saving succeeded (i.e. no validation errors occurred). */ public function save($runValidation = true, $attributeNames = null) { if ($this->getIsNewRecord()) { return $this->insert($runValidation, $attributeNames); } return $this->update($runValidation, $attributeNames) !== false; } /**
if (is_array($foreignModel->$fk)) { // relation via array valued attribute $foreignModel->{$fk}[] = $value; } else { $foreignModel->{$fk} = $value; } } $foreignModel->save(false); } /** * Returns a value indicating whether the given set of attributes represents the primary key for this model. * @param array $keys the set of attributes to check * @return bool whether the given set of attributes represents the primary key for this model
} else { $this->bindModels($relation->link, $model, $this); } } elseif ($p1) { $this->bindModels(array_flip($relation->link), $this, $model); } elseif ($p2) { $this->bindModels($relation->link, $model, $this); } else { throw new InvalidCallException('Unable to link models: the link defining the relation does not involve any primary key.'); } } // update lazily loaded related objects
$i18n = Yii::$app->getI18n(); /* @var Cache $cache */ $cache = $i18n->enableCaching ? Instance::ensure($i18n->cache, Cache::className()) : null; /* @var Message $message */ foreach ($this->messages as $message) { $this->link('messages', $message); $message->save(); if ($i18n->enableCaching) { $key = [ DbMessageSource::className(), $this->category,
'category' => $event->category, 'message' => $event->message ], false); $sourceMessage->save(false); } $sourceMessage->initMessages(); $sourceMessage->saveMessages(); } } }
$event->sender = $this; } $event->handled = false; $event->name = $name; foreach ($eventHandlers as $handler) { $event->data = $handler[1]; call_user_func($handler[0], $event); // stop further handling if the event is handled if ($event->handled) { return; } } }
} elseif ($this->hasEventHandlers(self::EVENT_MISSING_TRANSLATION)) { $event = new MissingTranslationEvent([ 'category' => $category, 'message' => $message, 'language' => $language, ]); $this->trigger(self::EVENT_MISSING_TRANSLATION, $event); if ($event->translatedMessage !== null) { return $this->_messages[$key][$message] = $event->translatedMessage; } } return $this->_messages[$key][$message] = false;
* @param string $language the target language * @return string|bool the translated message or false if translation wasn't found or isn't required */ public function translate($category, $message, $language) { if ($this->forceTranslation || $language !== $this->sourceLanguage) { return $this->translateMessage($category, $message, $language); } return false; } /**
* @param string $language the language code (e.g. `en-US`, `en`). * @return string the translated and formatted message. */ public function translate($category, $message, $params, $language) { $messageSource = $this->getMessageSource($category); $translation = $messageSource->translate($category, $message, $language); if ($translation === false) { return $this->format($message, $params, $messageSource->sourceLanguage); } return $this->format($translation, $params, $language); }
* [[\yii\base\Application::language|application language]] will be used. * @return string the translated message. */ public static function t($category, $message, $params = [], $language = null) { if (static::$app !== null) { return static::$app->getI18n()->translate($category, $message, $params, $language ?: static::$app->language); } $placeholders = []; foreach ((array) $params as $name => $value) { $placeholders['{' . $name . '}'] = $value; }
'label' => Yii::t('main', 'Google Translator'), 'url' => '#!', 'options' => ['class' => 'nav-item dropdown'], 'template' => '<a href="{url}" class="nav-link dropdown-toggle">{label}</a>', 'items' => [ [ 'label' => Yii::t('main', 'google'), 'template' => '<div style="padding:0 25px" id="google_translate_element"></div> ', ], ] ]
{ $_obInitialLevel_ = ob_get_level(); ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); try { require $_file_; return ob_get_clean(); } catch (\Exception $e) { while (ob_get_level() > $_obInitialLevel_) { if (!@ob_end_clean()) { ob_clean(); }
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @since 2.0.1 */ public function renderContent($content) { $layoutFile = $this->findLayoutFile($this->getView()); if ($layoutFile !== false) { return $this->getView()->renderFile($layoutFile, ['content' => $content], $this); } return $content; } /**
* @return string the rendering result. * @throws InvalidArgumentException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered * @return string the rendering result of the layout with the given static string as the `$content` variable.
* @throws NotFoundHttpException */ public function actionView($uri) { $model = $this->findNews($uri); return $this->render('view', [ 'model' => $model, ]); } /** * Finds the Posts model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown.
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'uri' => 'mini-futbol-2022-chempionatining-3-tur-bahslari-bolib-otdi', ];