Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Yii フレームワークのBlameble Behavior拡張機能を使用して、作成者と更新者を追跡したいと考えました。ここで私は彼らのIDを記録することができます、そして今私はそこから彼らの名前を取得する方法を知りたいです.
このためには、モデルに aa リレーションを追加する必要があります
'creator' => array(self::BELONGS_TO, 'User', 'my_own_creator_column_name'), 'updater' => array(self::BELONGS_TO, 'User', 'my_own_updater_column_name'),
$model->creatorそして、ユーザーの名前/電子メールを取得できます$model->updater
$model->creator
$model->updater