* @return TableSchema the schema information of the DB table associated with this AR class. * @throws InvalidConfigException if the table for the AR class does not exist. */ public static function getTableSchema() { $schema = static::getDb()->getSchema()->getTableSchema(static::tableName()); if ($schema !== null) { return $schema; } else { throw new InvalidConfigException("The table does not exist: " . static::tableName()); } } /** * Returns the primary key name(s) for this AR class. * The default implementation will return the primary key(s) as declared * in the DB table that is associated with this AR class. * * If the DB table does not declare any primary key, you should override
* Returns the list of all attribute names of the model. * The default implementation will return all column names of the table associated with this AR class. * @return array list of attribute names. */ public function attributes() { return array_keys(static::getTableSchema()->columns); } /** * Declares which DB operations should be performed within a transaction in different scenarios. * The supported DB operations are: [[OP_INSERT]], [[OP_UPDATE]] and [[OP_DELETE]], * which correspond to the [[insert()]], [[update()]] and [[delete()]] methods, respectively.
* Returns a value indicating whether the model has an attribute with the specified name. * @param string $name the name of the attribute * @return boolean whether the model has an attribute with the specified name. */ public function hasAttribute($name) { return isset($this->_attributes[$name]) || in_array($name, $this->attributes()); } /** * Returns the named attribute value. * If this record is the result of a query and the attribute is not loaded, * null will be returned.
* @see getAttribute() */ public function __get($name) { if (isset($this->_attributes[$name]) || array_key_exists($name, $this->_attributes)) { return $this->_attributes[$name]; } elseif ($this->hasAttribute($name)) { return null; } else { if (isset($this->_related[$name]) || array_key_exists($name, $this->_related)) { return $this->_related[$name]; } $value = parent::__get($name);
$attributes = array_intersect($this->attributes, $attributes); } else { $attributes = $this->attributes; } foreach ($attributes as $attribute) { $skip = $this->skipOnError && $model->hasErrors($attribute) || $this->skipOnEmpty && $this->isEmpty($model->$attribute); if (!$skip) { if ($this->when === null || call_user_func($this->when, $model, $attribute)) { $this->validateAttribute($model, $attribute); } } }
if ($attributeNames === null) { $attributeNames = $this->activeAttributes(); } foreach ($this->getActiveValidators() as $validator) { $validator->validateAttributes($this, $attributeNames); } $this->afterValidate(); return !$this->hasErrors(); }
$dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails $query->where('0=1'); return $dataProvider; } if (isset($params["MetricSnapshotSearch"]["catalogue_id"]) && $params["MetricSnapshotSearch"]["catalogue_id"]!= "") { foreach ($params["MetricSnapshotSearch"]["catalogue_id"] as $item) { //echo $item;
$this->layout="main_dashboard"; /* filters on the left */ $searchModel = new MetricSnapshotSearch(); // $searchModel = $searchModel->search(Yii::$app->request->queryParams); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $query = new \yii\db\Query(); $query->select('datacatalogue.country_code AS country_code, country.name_en AS name_en') ->from('datacatalogue') ->innerJoin('country', 'datacatalogue.country_code = country.country_id') ->groupBy('country_code')
$args = $this->controller->bindActionParams($this, $params); Yii::trace('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); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
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__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'r' => 'dashboard/cmpcountryindex', ]; $_SERVER = [ 'TMPDIR' => '/var/www/clients/client1/web3/tmp', 'PHPRC' => '/etc/opt/remi/php56/', 'TEMP' => '/var/www/clients/client1/web3/tmp', 'PHP_DOCUMENT_ROOT' => '/var/www/clients/client1/web3', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin', 'PWD' => '/var/www/php-fcgi-scripts/web3', 'SHLVL' => '0', 'TMP' => '/var/www/clients/client1/web3/tmp', 'PHP_FCGI_MAX_REQUESTS' => '7000', 'HTTP_CONNECTION' => 'close', 'SCRIPT_NAME' => '/frontend/web/index.php', 'REQUEST_URI' => '/frontend/web/index.php?r=dashboard%2Fcmpcountryindex', 'QUERY_STRING' => 'r=dashboard%2Fcmpcountryindex', 'REQUEST_METHOD' => 'GET', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'REMOTE_PORT' => '32870', 'SCRIPT_FILENAME' => '/var/www/demo.opendatamonitor.eu/web/frontend/web/index.php', 'SERVER_ADMIN' => 'webmaster@demo.opendatamonitor.eu', 'CONTEXT_DOCUMENT_ROOT' => '/var/www/demo.opendatamonitor.eu/web', 'CONTEXT_PREFIX' => '', 'REQUEST_SCHEME' => 'http', 'DOCUMENT_ROOT' => '/var/www/demo.opendatamonitor.eu/web', 'REMOTE_ADDR' => '18.208.203.36', 'SERVER_PORT' => '80', 'SERVER_ADDR' => '148.251.70.49', 'SERVER_NAME' => 'demo.opendatamonitor.eu', 'SERVER_SOFTWARE' => 'Apache', 'SERVER_SIGNATURE' => '', 'HTTP_HOST' => 'demo.opendatamonitor.eu', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_ACCEPT' => '*/*', 'PERL5LIB' => '/usr/share/awstats/lib:/usr/share/awstats/plugins', 'UNIQUE_ID' => 'Zfl22bzwOYjM544Bu3PEKwAAAA4', 'FCGI_ROLE' => 'RESPONDER', 'PHP_SELF' => '/frontend/web/index.php', 'REQUEST_TIME_FLOAT' => 1710847705.038511, 'REQUEST_TIME' => 1710847705, ];