當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::tableName方法代碼示例

本文整理匯總了PHP中app\modules\user\models\User::tableName方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::tableName方法的具體用法?PHP User::tableName怎麽用?PHP User::tableName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\modules\user\models\User的用法示例。


在下文中一共展示了User::tableName方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: up

 public function up()
 {
     $table = Vote::tableName();
     $this->createTable($table, ['answer_id' => $this->integer(), 'user_id' => $this->integer(), 'created_at' => $this->integer()]);
     MigrationHelper::addForeignKey($table, 'answer_id', Answer::tableName(), 'id', 'CASCADE', 'CASCADE');
     MigrationHelper::addForeignKey($table, 'user_id', User::tableName(), 'id', 'SET NULL', 'CASCADE');
 }
開發者ID:bariew,項目名稱:sitown,代碼行數:7,代碼來源:m160422_075642_poll_vote.php

示例2: up

 public function up()
 {
     $table = \app\modules\poll\models\Comment::tableName();
     $this->createTable($table, ['id' => $this->primaryKey(), 'user_id' => $this->integer(), 'question_id' => $this->integer(), 'created_at' => $this->integer(), 'message' => $this->text()]);
     MigrationHelper::addForeignKey($table, 'user_id', \app\modules\user\models\User::tableName(), 'id', 'SET NULL', 'CASCADE');
     MigrationHelper::addForeignKey($table, 'question_id', \app\modules\poll\models\Question::tableName(), 'id', 'CASCADE', 'CASCADE');
 }
開發者ID:bariew,項目名稱:sitown,代碼行數:7,代碼來源:m160424_063433_poll_comment.php

示例3: getManagersList

 protected function getManagersList()
 {
     $managers = Yii::$app->cache->get('ManagersList');
     if ($managers === false) {
         $managers = User::find()->join('INNER JOIN', '{{%auth_assignment}}', '{{%auth_assignment}}.user_id = ' . User::tableName() . '.id')->where(['{{%auth_assignment}}.item_name' => 'manager'])->all();
         $managers = ArrayHelper::map($managers, 'id', 'username');
         Yii::$app->cache->set('ManagersList', $managers, 86400, new TagDependency(['tags' => [\devgroup\TagDependencyHelper\ActiveRecordHelper::getCommonTag(User::className())]]));
     }
     return $managers;
 }
開發者ID:Razzwan,項目名稱:dotplant2,代碼行數:10,代碼來源:BackendOrderController.php

示例4: hasUser

 /**
  * We just check whether module is installed and user is logged in.
  * @return bool
  */
 public static function hasUser()
 {
     if (!Yii::$app instanceof Application) {
         return false;
     }
     if (!Yii::$app->db->getTableSchema(User::tableName())) {
         return false;
     }
     try {
         $identityClass = Yii::$app->user->identityClass;
     } catch (\Exception $e) {
         $identityClass = false;
     }
     if (!$identityClass) {
         return false;
     }
     return !Yii::$app->user->isGuest;
 }
開發者ID:bariew,項目名稱:sitown,代碼行數:22,代碼來源:Module.php

示例5: search

 /**
  * Search tasks
  * @param $params
  * @param bool $withUser
  * @return ActiveDataProvider
  */
 public function search($params, $withUser = false)
 {
     $query = self::find();
     $query->joinWith(['task', 'task.initiatorUser']);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 10], 'sort' => ['defaultOrder' => ['ts' => SORT_DESC]]]);
     $dataProvider->sort->attributes['name'] = ['asc' => [Task::tableName() . '.name' => SORT_ASC], 'desc' => [Task::tableName() . '.name' => SORT_DESC]];
     $dataProvider->sort->attributes['username'] = ['asc' => [\app\modules\user\models\User::tableName() . '.username' => SORT_ASC], 'desc' => [User::tableName() . '.username' => SORT_DESC]];
     if ($withUser) {
         $query->andWhere([Task::tableName() . '.initiator' => \Yii::$app->user->id]);
     }
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $this->addCondition($query, User::tableName(), 'username', true);
     $this->addCondition($query, $this->tableName(), 'ts', true);
     $this->addCondition($query, Task::tableName(), 'name', true);
     $this->addCondition($query, $this->tableName(), 'result_status');
     return $dataProvider;
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:25,代碼來源:NotifyMessage.php

示例6: down

 public function down()
 {
     $this->dropTable('{{%user_category}}');
     $this->dropTable('{{%user_eav}}');
     $this->dropTable('{{%user_property}}');
     $this->dropTable(UserService::tableName());
     $this->dropTable(User::tableName());
     $this->dropTable('{{%auth_assignment}}');
     $this->dropTable('{{%auth_item_child}}');
     $this->dropTable('{{%auth_item}}');
     $this->dropTable('{{%auth_rule}}');
     $this->dropTable(ErrorUrl::tableName());
     $this->dropTable(ErrorLog::tableName());
     $this->dropTable(Review::tableName());
     $this->dropTable(Notification::tableName());
     $this->dropTable('{{%submission_eav}}');
     $this->dropTable('{{%submission_category}}');
     $this->dropTable('{{%submission_property}}');
     $this->dropTable(Submission::tableName());
     $this->dropTable('{{%form_property}}');
     $this->dropTable('{{%form_eav}}');
     $this->dropTable(Form::tableName());
     $this->dropTable('{{%order_category}}');
     $this->dropTable('{{%order_eav}}');
     $this->dropTable('{{%order_property}}');
     $this->dropTable(PaymentType::tableName());
     $this->dropTable(ShippingOption::tableName());
     $this->dropTable(OrderChat::tableName());
     $this->dropTable(OrderTransaction::tableName());
     $this->dropTable(OrderItem::tableName());
     $this->dropTable(Order::tableName());
     $this->dropTable(SubscribeEmail::tableName());
     $this->dropTable(CategoryGroupRouteTemplates::tableName());
     $this->dropTable('{{%product_category}}');
     $this->dropTable('{{%property_category}}');
     $this->dropTable('{{%category_eav}}');
     $this->dropTable(Category::tableName());
     $this->dropTable(CategoryGroup::tableName());
     $this->dropTable('{{%page_eav}}');
     $this->dropTable('{{%page_category}}');
     $this->dropTable('{{%page_property}}');
     $this->dropTable(Page::tableName());
     $this->dropTable(ViewObject::tableName());
     $this->dropTable(View::tableName());
     $this->dropTable(Layout::tableName());
     $this->dropTable('{{%product_property}}');
     $this->dropTable(Product::tableName());
     $this->dropTable(Property::tableName());
     $this->dropTable(Route::tableName());
     $this->dropTable('{{%product_eav}}');
     $this->dropTable('{{%product_static_value_full_slug}}');
     $this->dropTable('{{%product_category_full_slug}}');
     $this->dropTable(PropertyStaticValues::tableName());
     $this->dropTable(PropertyHandler::tableName());
     $this->dropTable(PropertyGroup::tableName());
     $this->dropTable(ObjectStaticValues::tableName());
     $this->dropTable(ObjectPropertyGroup::tableName());
     $this->dropTable(Object::tableName());
     $this->dropTable(DynamicContent::tableName());
     $this->dropTable(Navigation::tableName());
     $this->dropTable(Image::tableName());
     $this->dropTable('{{%session}}');
     $this->dropTable(ApiService::tableName());
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:64,代碼來源:m141023_084857_init.php

示例7: up

 public function up()
 {
     $this->createTable(Question::tableName(), ['id' => $this->primaryKey(), 'user_id' => $this->integer(), 'status' => $this->smallInteger(), 'type' => $this->smallInteger(), 'relation_id' => $this->string(), 'event_object' => $this->text(), 'title' => $this->string(), 'description' => $this->text(), 'created_at' => $this->integer()]);
     MigrationHelper::addForeignKey(Question::tableName(), 'user_id', User::tableName(), 'id', 'SET NULL', 'CASCADE');
 }
開發者ID:bariew,項目名稱:sitown,代碼行數:5,代碼來源:m160422_075623_poll_question.php

示例8: search

 /**
  * Search tasks
  * @param $params
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     /* @var $query \yii\db\ActiveQuery */
     $query = self::find();
     $query->joinWith('initiatorUser');
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 10]]);
     $dataProvider->sort->attributes['username'] = ['asc' => [User::tableName() . '.username' => SORT_ASC], 'desc' => [User::tableName() . '.username' => SORT_DESC]];
     $query->andWhere($this->tableName() . '.type = :type', [':type' => 'REPEAT']);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $this->addCondition($query, $this->tableName(), 'id');
     $this->addCondition($query, $this->tableName(), 'name', true);
     $this->addCondition($query, $this->tableName(), 'description', true);
     $this->addCondition($query, $this->tableName(), 'action', true);
     $this->addCondition($query, $this->tableName(), 'params', true);
     $this->addCondition($query, $this->tableName(), 'cron_expression', true);
     $this->addCondition($query, $this->tableName(), 'ts', true);
     $this->addCondition($query, $this->tableName(), 'status');
     $this->addCondition($query, User::tableName(), 'username', true);
     return $dataProvider;
 }
開發者ID:yii2ApplicationCollect,項目名稱:dotplant2,代碼行數:27,代碼來源:Task.php

示例9: down

 public function down()
 {
     $this->dropTable(User::tableName());
 }
開發者ID:bariew,項目名稱:sitown,代碼行數:4,代碼來源:m140417_081329_user_user.php

示例10: down

 public function down()
 {
     $this->dropTable(User::tableName());
     $this->dropTable(Avatar::tableName());
     $this->dropTable(Meta::tableName());
 }
開發者ID:hackvijay,項目名稱:yii-qa,代碼行數:6,代碼來源:m140910_100200_initUserTable.php

示例11: down

 public function down()
 {
     $this->alterColumn(User::tableName(), 'password_reset_token', 'VARBINARY(32)');
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:4,代碼來源:m150824_073350_password_reset_token_length.php

示例12: minusBalance

 public static function minusBalance($user_id, $sum = 0)
 {
     //если не указали сумму, значит берём из настроек сумму за одну проверку и списываем её
     if ($sum == 0) {
         $sum = \Yii::$app->params['task.cost'];
     }
     if ($user_id) {
         $query = \Yii::$app->db->createCommand('UPDATE ' . User::tableName() . ' SET balance=(balance-:sum_minus) WHERE id=:id');
         $query->bindValues([':id' => $user_id, ':sum_minus' => $sum]);
         $query->execute();
     }
 }
開發者ID:goncharovln,項目名稱:keywords,代碼行數:12,代碼來源:User.php


注:本文中的app\modules\user\models\User::tableName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。