本文整理汇总了PHP中app\models\Profile::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::className方法的具体用法?PHP Profile::className怎么用?PHP Profile::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Profile
的用法示例。
在下文中一共展示了Profile::className方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDelete
public function actionDelete($id)
{
if ($this->findModel(Profile::className(), $id)->delete() !== false) {
$this->setFlash('success', \Yii::t('app', 'Modifications have been saved'));
} else {
$this->setFlash('error', \Yii::t('app', 'Modifications have not been saved'));
}
return $this->redirect(['/profile/index']);
}
示例2: getProfile
public function getProfile()
{
return $this->hasOne(Profile::className(), ['user_id' => 'id']);
}
示例3: getCommentOwner
public function getCommentOwner()
{
return $this->hasOne(Profile::className(), ['user_id' => 'user_id']);
}
示例4: getTopProfile
public function getTopProfile()
{
return $this->hasOne(Profile::className(), ['user_id' => 'psychologist_id']);
}
示例5: getProfiles
/**
* @return \yii\db\ActiveQuery
*/
public function getProfiles()
{
return $this->hasMany(Profile::className(), ['region_id' => 'id']);
}
示例6: getProfile
public function getProfile()
{
return $this->hasOne(Profile::className(), ['user_id' => 'user_id'])->setModelScenario(Profile::SCENARIO_LIMITED);
}
示例7: getMessageFrom
/**
* @return \yii\db\ActiveQuery
*/
public function getMessageFrom()
{
return $this->hasOne(Profile::className(), ['user_id' => 'message_from']);
}
示例8: afterSave
/** @inheritdoc */
public function afterSave($insert, $changedAttributes)
{
if ($insert) {
$profile = \Yii::createObject(['class' => Profile::className(), 'user_id' => $this->id, 'gravatar_email' => $this->email]);
$profile->save(false);
}
parent::afterSave($insert, $changedAttributes);
}
示例9: getProfiles
/**
* @return \yii\db\ActiveQuery
*/
public function getProfiles()
{
return $this->hasMany(\app\models\Profile::className(), ['user_id' => 'id']);
}