PHP Method User::className, codiad Code Examples

This page contains top rated real world PHP examples of method User::className from package codiad extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: BoardRights.php Project: JiltImageBoard/jilt-backend
0
 /**
  * @param int $boardId
  * @return User[]
  */
 public function getUsers($boardId = null)
 {
     return $this->hasMany(User::className(), ['id' => 'user_id'])->viaTable('cp_users_board_rights', ['board_rights_id' => 'id'], function ($query) use($boardId) {
         if ($boardId != null && is_numeric($boardId)) {
             $query->andWhere(['board_id' => $boardId]);
         }
     });
 }
Example #2
Show file File: EventTest.php Project: howq/yii2
0
 public function testHasHandlers()
 {
     $this->assertFalse(Event::hasHandlers(Post::className(), 'save'));
     $this->assertFalse(Event::hasHandlers(ActiveRecord::className(), 'save'));
     Event::on(Post::className(), 'save', function ($event) {
         $this->counter += 1;
     });
     $this->assertTrue(Event::hasHandlers(Post::className(), 'save'));
     $this->assertFalse(Event::hasHandlers(ActiveRecord::className(), 'save'));
     $this->assertFalse(Event::hasHandlers(User::className(), 'save'));
     Event::on(ActiveRecord::className(), 'save', function ($event) {
         $this->counter += 1;
     });
     $this->assertTrue(Event::hasHandlers(User::className(), 'save'));
     $this->assertTrue(Event::hasHandlers(ActiveRecord::className(), 'save'));
 }
Example #3
Show file File: Comment.php Project: obuhovski/my-site
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCreatedBy()
 {
     return $this->hasOne(User::className(), ['id' => 'created_by']);
 }
Example #4
Show file File: Profile.php Project: rhopress/yii2-rhopress
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUser()
 {
     $user = User::buildNoInitModel();
     return $this->hasOne(User::className(), [$user->guidAttribute => $this->createdByAttribute]);
 }
Example #5
Show file File: Post.php Project: pathman/yii-basic
0
 /**
  * @return \yii\db\ActiveRelation
  */
 public function getAuthor()
 {
     return $this->hasOne(User::className(), ['id' => 'author_id']);
 }
Example #6
Show file File: News.php Project: kabiraparesh/yii2-tookee
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getOwner0()
 {
     return $this->hasOne(User::className(), ['id' => 'owner']);
 }
Example #7
Show file File: Todo.php Project: alicanakkus/yii_todolist
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAuthors()
 {
     return $this->hasOne(User::className(), ['ID' => 'userId']);
     //bizdeki bir kayıt 1 kayıta denk geliyor ilişkiler
 }
Example #8
Show file File: Advertisement.php Project: hostingvk4/build
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdUser()
 {
     return $this->hasOne(User::className(), ['id' => 'id_user']);
 }
Example #9
Show file File: Email.php Project: infoweb-internet-solutions/yii2-cms-email
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['email' => 'to'])->andWhere(['scope' => User::SCOPE_FRONTEND]);
 }
Example #10
Show file File: Module.php Project: rifaideen/album
0
 /**
  * @inheritdoc
  */
 public function getContentContainerTypes()
 {
     return [User::className()];
 }
Example #11
Show file File: FormSubmit.php Project: cmsgears/module-forms
0
 /**
  * @return User - who submitted the form
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'submittedBy']);
 }
Example #12
Show file File: UserItemTrait.php Project: rhosocial/rho.social
0
 public function attachUserClass()
 {
     $this->userClass = User::className();
 }
Example #13
Show file File: BatchExecution.php Project: alexander-suter/yii2-batch
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getExecutor()
 {
     return $this->hasOne(User::className(), ['id' => 'executor']);
 }
Example #14
Show file File: CategoryList.php Project: nhatvuvan/yii2-widgets
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEditor()
 {
     return $this->hasOne(User::className(), ['id' => 'editor_id']);
 }
Example #15
Show file File: AuditEntry.php Project: cornernote/yii2-audit
0
 /**
  * Returns all linked AuditData instances
  * @return AuditData[]
  */
 public function getUser()
 {
     return static::hasOne(User::className(), ['user_id' => 'id']);
 }
Example #16
Show file File: Reservation.php Project: ufrgs-hyman/meican
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRequesterUser()
 {
     return $this->hasOne(User::className(), ['id' => 'request_user_id']);
 }
Example #17
Show file File: Contractor.php Project: alexshadie/wallet
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'user_id']);
 }
Example #18
Show file File: Profile.php Project: dvizh/yii2-users-module
0
 /**
  * @return Profile|null Profile user
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'user_id'])->inverseOf('profile');
 }