本文整理匯總了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']);
}