/** * @inheritdoc */ public function addRemoteIdentity($provider, $identifier) { if ($this->_id === null) { return false; } UserRemoteIdentity::model()->deleteAllByAttributes(array('provider' => $provider, 'identifier' => $identifier)); $model = new UserRemoteIdentity(); $model->setAttributes(array('user_id' => $this->_id, 'provider' => $provider, 'identifier' => $identifier), false); return $model->save(); }
public function addRemoteIdentity($provider, $identifier) { $model = new UserRemoteIdentity(); $model->setAttributes(['user_id' => $this->id, 'provider' => $provider, 'identifier' => $identifier], false); return $model->save(); }