/** * @return \yii\db\ActiveQuery */ public function getFacebook() { return $this->hasOne(RedSocialAuth::className(), ['usuario_id' => 'idusuario']); }
/** * Guarda información del perfil * @param $userId * @return bool */ private function guardarPerfilFacebook($userId) { $rs = new RedSocialAuth(); $rs->redsocial = $this->red_social; $rs->usuario_id = $userId; $rs->redsocial_id = $this->perfil_id; $rs->url = $this->url_perfil; $rs->localidad = $this->localidad; $rs->estado = $this->estado; $rs->access_token = $this->access_token; return $rs->save(); }