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