本文整理汇总了PHP中app\models\Profile类的典型用法代码示例。如果您正苦于以下问题:PHP Profile类的具体用法?PHP Profile怎么用?PHP Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Profile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createProfile
/**
* Create user profile
*
* @param Request $data
* @param type $id int
*/
public static function createProfile($data, $id)
{
$profile = new Profile();
$profile->user_id = $id;
$profile->about = "Моя информация";
$profile->save();
}
开发者ID:lyovkin,项目名称:elcoinbank,代码行数:13,代码来源:ProfileService.php
示例2: socialSave
public static function socialSave($user, $info)
{
$prof = new Profile();
$prof->user_id = $user->id;
$prof->name = $info['name'];
//common
if (!empty($info['first_name'])) {
$prof->name = $info['first_name'];
}
if (!empty($info['last_name'])) {
$prof->last_name = $info['last_name'];
}
//vk
if (!empty($info['photo_rec'])) {
$prof->thumb_photo = $info['photo_rec'];
}
if (!empty($info['photo_medium'])) {
$prof->thumb_photo = $info['photo_medium'];
}
if (!empty($info['photo_big'])) {
$prof->photo = $info['photo_big'];
}
//fb
if (!empty($info['picture'])) {
$prof->thumb_photo = $info['picture']['data']['url'];
}
//set default
if (!$prof->thumb_photo) {
$prof->thumb_photo = '/web/images/profile_thumb_photo_default.png';
}
$prof->save(false);
/* echo '<pre>';
print_r($info);
die(); */
}
开发者ID:efabrikov,项目名称:chomu,代码行数:35,代码来源:Profile.php
示例3: actionInit
public function actionInit()
{
//roles
//user admin psychologist school
$auth = Yii::$app->authManager;
//$user = $auth->createRole('user');
$adminUser = new User();
$adminUser->email = '[email protected]';
$adminUser->setPassword('123456');
$adminUser->generateAuthKey();
$adminUser->save();
$admin = $auth->createRole('admin');
$auth->add($admin);
$averageUser = new User();
$averageUser->email = '[email protected]';
$averageUser->setPassword('123456');
$averageUser->generateAuthKey();
$averageUser->save();
$profile = new Profile();
$model = new SignupForm();
$model->first_name = "Юзер";
$model->last_name = "Юзерович";
$model->second_name = "Юзеров";
$profile->initProfile($model, $averageUser->id);
$user = $auth->createRole('user');
$auth->add($user);
/* $accessAdmin = $auth->createPermission('accessAdmin');
$accessAdmin->description = 'Access admin';
$auth->add($accessAdmin);
$auth->addChild($admin, $accessAdmin);*/
//$psychologist = $auth->createRole('psychologist');
/*// add "createPost" permission
$createPost = $auth->createPermission('createPost');
$createPost->description = 'Create a post';
$auth->add($createPost);
// add "updatePost" permission
$updatePost = $auth->createPermission('updatePost');
$updatePost->description = 'Update post';
$auth->add($updatePost);
// add "author" role and give this role the "createPost" permission
$author = $auth->createRole('author');
$auth->add($author);
$auth->addChild($author, $createPost);
// add "admin" role and give this role the "updatePost" permission
// as well as the permissions of the "author" role
$admin = $auth->createRole('admin');
$auth->add($admin);
$auth->addChild($admin, $updatePost);
$auth->addChild($admin, $author);
// Assign roles to users. 1 and 2 are IDs returned by IdentityInterface::getId()
// usually implemented in your User model.
$auth->assign($author, 2);*/
$auth->assign($admin, 1);
$auth->assign($user, 2);
}
开发者ID:Akelcehg,项目名称:psycho,代码行数:59,代码来源:RbacController.php
示例4: actionLoadProfiles
public function actionLoadProfiles()
{
$profileData = [['user_id' => '14', 'birthday' => '1942-02-02', 'nickname' => 'testing', 'background_img' => 'forback.png', 'avatar' => 'forback.png'], ['user_id' => '15', 'birthday' => '1998-02-02', 'nickname' => 'testing2', 'background_img' => 'forback.png', 'avatar' => 'forback.png']];
foreach ($profileData as $data) {
$profile = new Profile($data);
$profile->save();
}
}
开发者ID:phstoned,项目名称:blog-boostrap,代码行数:8,代码来源:ProfileController.php
示例5: store
public function store(Request $request)
{
$this->validate($request, ['name' => 'required|min:1']);
$profile = new ProfileModel();
$profile->name = $request->input('name');
$profile->surname = $request->input('surname');
$profile->phone = $request->input('phone');
$profile->email = $request->input('email');
$profile->save();
return redirect()->action('UsersController@index');
}
开发者ID:christopherstock,项目名称:laravel-workshop1,代码行数:11,代码来源:Profile.php
示例6: facebookCallback
public function facebookCallback()
{
try {
$state = $this->security->getToken();
$code = $this->request->getQuery('code');
$error = $this->request->getQuery('error');
$callback = $this->request->getQuery('callback');
if (!empty($error)) {
if ($error === 'access_denied') {
throw new FbCallbackException('FB authorization error: ' . $error);
} else {
throw new FbCallbackException('FB authorization error: ' . $error);
}
}
if (empty($code)) {
throw new FbCallbackException('Ups, something went wrong during authorization');
}
$facebook_response = $this->facebook->getAccessToken($code, $state, $callback);
$access_token = $facebook_response->access_token;
$uid = $this->facebook->getUid($access_token);
$profile = Profile::findFirst(['uid = ?0', 'bind' => [$uid]]);
if (empty($profile)) {
// No user, let's register it
// TODO: encrypt access_token
// TODO: Change default facebook avatar by ours
// TODO: if user doesn't provide us with email we can't register it
// TODO: facebook date format can vary
$me = $this->facebook->me($access_token);
// Create user
$user = new User();
$user = $user->assignFromFacebook($me);
if ($user->save()) {
// Create profile and assign to the user
$profile = new Profile();
$profile->createFromFacebook($me->id, $access_token, $user->id);
return new Response(json_encode($user));
} else {
throw new InvalidFbUser($user);
}
} else {
// User already registered, update access_token
$profile->save(['access_token' => $access_token]);
$user = $profile->getUser();
return new Response(json_encode($user->toArray()));
}
} catch (FbCallbackException $e) {
return $e->returnResponse();
} catch (InvalidFbUser $e) {
return $e->returnResponse();
} catch (\Exception $e) {
return new Response($e->getMessage(), 409);
}
}
开发者ID:soutoner,项目名称:api-desconecta,代码行数:53,代码来源:RegisterController.php
示例7: postCreate
public function postCreate()
{
$postValue = $this->getProfileInput();
$profile = new Profile();
if ($profile->validate($postValue)) {
$profile->fill($postValue);
$profile->save();
return redirect(route('home'));
} else {
return view('profile.create', compact('profile'));
}
}
开发者ID:juliardi,项目名称:jualjasa,代码行数:12,代码来源:ProfileController.php
示例8: findOrCreateUser
public static function findOrCreateUser($vk_id)
{
if (!User::findByVkId($vk_id)) {
$model = new User();
$model->vk_id = $vk_id;
$model->save();
$profile = new Profile();
$profile->user_id = $model->id;
$profile->save();
}
return User::findByVkId($vk_id);
}
开发者ID:CatherineCD,项目名称:project,代码行数:12,代码来源:User.php
示例9: actionRegister
public function actionRegister()
{
$model = new Register();
$profile = new Profile();
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($id = $model->register()) {
$profile->createProfile($id);
return $this->goHome();
}
}
}
return $this->render('register', ['model' => $model]);
}
开发者ID:fosker,项目名称:sim,代码行数:14,代码来源:SiteController.php
示例10: actionRegister
public function actionRegister()
{
$model = new User();
$profile = new Profile();
if ($model->load(Yii::$app->request->getBodyParams(), '') && $model->validate()) {
if ($model->validate()) {
$id = $model->register();
$profile->createProfile($id);
return ['success' => true];
}
} else {
return $model;
}
}
开发者ID:fosker,项目名称:dbm,代码行数:14,代码来源:DefaultController.php
示例11: actionSignup
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
$profile = new Profile();
if ($profile->initProfile($model, $user->id)) {
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:Akelcehg,项目名称:psycho,代码行数:15,代码来源:SiteController.php
示例12: createShop
private function createShop($login, $buyer_bonus, $recommender_bonus)
{
$user = new User();
$user->email = $login;
$user->setPassword($user->email);
$user->generateAuthKey();
$user->save(false);
$profile = new Profile();
$profile->user_id = $user->id;
$profile->url = 'https://temp-mail.ru';
$profile->buyer_bonus = $buyer_bonus;
$profile->recommender_bonus = $recommender_bonus;
$profile->save(false);
$this->auth->assign($this->auth->createRole(User::ROLE_SHOP), $user->id);
return $user;
}
开发者ID:akoch-ov,项目名称:skidos,代码行数:16,代码来源:UserController.php
示例13: search
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Profile::find();
$dataProvider = new ActiveDataProvider(['query' => $query]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
//$query->where('0=1');
return $dataProvider;
}
if ($this['directions'] != '') {
$query->join("inner join", "psychologist_directions", "psychologist_directions.psychologist_id=profile.user_id");
$query->andOnCondition("psychologist_directions.direction_id in ('" . $this['directions'] . "')");
}
if ($this['problems'] != '') {
$query->join("inner join", "psychologist_problems", "psychologist_problems.psychologist_id=profile.user_id");
$query->andOnCondition("psychologist_problems.problem_id in ('" . $this['problems'] . "')");
}
if ($this['pricef'] != '') {
$query->andOnCondition('price >= ' . $this->pricef);
}
if ($this['pricet'] != '') {
$query->andOnCondition('price <= ' . $this->pricet);
}
$query->andFilterWhere(['id' => $this->id, 'user_id' => $this->user_id, 'has_diplom' => $this->has_diplom, 'city_id' => $this->city_id, 'updated_at' => $this->updated_at, 'created_at' => $this->created_at]);
$query->andFilterWhere(['like', 'firstname', $this->firstname])->andFilterWhere(['like', 'lastname', $this->lastname])->andFilterWhere(['like', 'secondname', $this->secondname])->andFilterWhere(['like', 'education', $this->education])->andFilterWhere(['like', 'experience', $this->experience])->andFilterWhere(['=', 'gender', $this->gender]);
return $dataProvider;
}
开发者ID:Akelcehg,项目名称:psycho,代码行数:35,代码来源:ProfileSearch.php
示例14: actionView
public function actionView($title)
{
$eventId = explode('-', $title)[1];
//$training = Events::find(['id' => $eventId[1]])->one();
$training = $this->findModel($eventId);
return $this->render('training', ['training' => $training, 'organizer' => Profile::findOne(['user_id' => $training['organizer_id']]), 'eventsList' => Events::find()->limit('4')->all()]);
}
开发者ID:Akelcehg,项目名称:psycho,代码行数:7,代码来源:TrainingsController.php
示例15: actionIndex
public function actionIndex()
{
if (!Yii::$app->user->identity) {
return $this->goHome();
}
$profile = new Profile();
$this->_profile = $profile->getProfile();
/*if(Yii::$app->user->identity->status == User::STATUS_WAIT){
return $this->goHome();
} else*/
if (Yii::$app->user->identity->status == User::STATUS_BLOCKED) {
return $this->goHome();
}
\Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => '']);
return $this->render('index', ['model' => $this->findModel(), '_profile' => $this->_profile]);
}
开发者ID:efabrikov,项目名称:chomu,代码行数:16,代码来源:ProfileController.php
示例16: store
/**
* Store a newly created resource in storage.
*
* @param AdduserRequest $request
* @return \Illuminate\Http\Response
*/
public function store(AdduserRequest $request)
{
// $input = $request->all(); // get all data
// $input['confirmed'] = 1; // set confirmed to 1
// $input['password'] = Hash::make($input['password']); // hash password
//
// $user = User::create($input); // save above details
$user = User::create(['first_name' => $request->first_name, 'last_name' => $request->last_name, 'email' => $request->email, 'confirmed' => 1, 'password' => Hash::make($request->password)]);
// $profile = $user->profile()->save(new Profile); // also create new profile
// $profile->apartment_id = Auth::user()->profile->defaultApartment; // get current defaultApartment
// $profile->save(); // save details on profile
$profile = Profile::create(['user_id' => $user->id, 'apartment_id' => Auth::user()->profile->defaultApartment]);
dd(Auth::user()->profile->defaultApartment);
$role = Role::whereName('user')->first();
$user->assignRole($role);
//Assign Role
$block_no = $request->blockno;
// get block_no from profileform
$floor_no = $request->floorno;
// get floor_no from profileform
$profile->apartments()->attach($profile->defaultApartment, ['approved' => '1', 'block_no' => $block_no, 'floor_no' => $floor_no]);
// attach this profile with default apartment, with approved = 1, and block_no, floor_no according to profileform in apartment_profile pivot table.
Crm_account::create(['account' => $user->first_name . $user->last_name, 'fname' => $user->first_name, 'lname' => $user->last_name, 'company' => 'Company Name', 'email' => $user->email, 'address' => 'Current Address', 'city' => 'Nagpur', 'state' => 'Maharashtra', 'zip' => '440012', 'country' => 'India']);
return redirect()->back()->withMessage('User has been Added')->withStatus('success');
}
开发者ID:suchayj,项目名称:easymanage,代码行数:31,代码来源:AdduserController.php
示例17: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::statement("SET foreign_key_checks = 0");
Profile::truncate();
Profile::create(array('user_id' => '1', 'defaultApartment' => '1', 'gender' => 'Male', 'mobile_no' => '8600012345', 'verified' => '1'));
Profile::create(array('user_id' => '2', 'defaultApartment' => '1', 'gender' => 'Male', 'mobile_no' => '8600012345', 'verified' => '1'));
}
开发者ID:suchayj,项目名称:easymanage,代码行数:12,代码来源:ProfileSeeder.php
示例18: run
public function run()
{
$faker = Faker::create('en_US');
/*
* Base User Accounts
*/
// Mike's account
$michael = User::create(['name' => 'Michael Norris', 'email' => '[email protected]', 'password' => bcrypt('password'), 'must_reset_password' => false, 'verify_token' => null, 'verified_on' => Carbon::now(), 'active_on' => Carbon::now(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$michaelProfile = Profile::create(['user_id' => $michael->id, 'username' => 'mstnorris', 'salutation' => 'Mr', 'first_name' => 'Michael', 'middle_name' => 'Stephen Thomas', 'last_name' => 'Norris', 'nick_name' => 'Mike', 'date_of_birth' => '1988-08-17', 'address_line_1' => '78A Sackville Road', 'address_line_2' => '', 'address_line_3' => '', 'address_line_4' => '', 'address_city' => 'Hove', 'address_county' => 'East Sussex', 'address_postcode' => 'BN3 3HB', 'private_email_address' => '[email protected]', 'mobile_number' => '+44 (0) 7446 990 061', 'twitter_username' => 'mstnorris', 'facebook_username' => 'mstnorris', 'google_plus_username' => 'mstnorris', 'instagram_username' => 'mstnorris', 'profile_photo_url' => '/images/mike.jpg', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$michael->profile()->save($michaelProfile);
// Sezer's account
$sezer = User::create(['name' => 'Sezer Tunca', 'email' => '[email protected]', 'password' => bcrypt('password'), 'must_reset_password' => false, 'verify_token' => null, 'verified_on' => Carbon::now(), 'active_on' => Carbon::now(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$sezerProfile = Profile::create(['user_id' => $sezer->id, 'username' => 'sezertunca', 'salutation' => 'Mr', 'first_name' => 'Sezer', 'middle_name' => '', 'last_name' => 'Tunca', 'nick_name' => 'Sezer', 'date_of_birth' => '1989-05-02', 'address_line_1' => 'Flat 4', 'address_line_2' => '15 Burlington Street', 'address_line_3' => '', 'address_line_4' => '', 'address_city' => 'Brighton', 'address_county' => 'East Sussex', 'address_postcode' => 'BN2 1AA', 'private_email_address' => '[email protected]', 'mobile_number' => '+44 (0) 7545 278 156', 'twitter_username' => 'sezertunca', 'facebook_username' => 'sezertunca', 'google_plus_username' => 'sezertunca', 'instagram_username' => 'sezertunca', 'profile_photo_url' => '/images/sezer.jpg', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$sezer->profile()->save($sezerProfile);
// Holly's account
$holly = User::create(['name' => 'Holly McNicol', 'email' => '[email protected]', 'password' => bcrypt('password'), 'must_reset_password' => false, 'verify_token' => null, 'verified_on' => Carbon::now(), 'active_on' => Carbon::now(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$hollyProfile = Profile::create(['user_id' => $holly->id, 'username' => 'hjmcnicol', 'salutation' => 'Miss', 'first_name' => 'Holly', 'middle_name' => 'Jane', 'last_name' => 'McNicol', 'nick_name' => 'Holly', 'date_of_birth' => '1990-05-16', 'address_line_1' => '78A Sackville Road', 'address_line_2' => '', 'address_line_3' => '', 'address_line_4' => '', 'address_city' => 'Hove', 'address_county' => 'East Sussex', 'address_postcode' => 'BN3 3HB', 'private_email_address' => '[email protected]', 'mobile_number' => '+44 (0) 7950 994 570', 'twitter_username' => 'hjmcnicol', 'facebook_username' => 'hjmcnicol', 'google_plus_username' => 'hjmcnicol', 'instagram_username' => 'hjmcnicol', 'profile_photo_url' => '/images/holly.jpg', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$holly->profile()->save($hollyProfile);
// Jane's account
$jane = User::create(['name' => 'Jane Challenger-Gillitt', 'email' => '[email protected]', 'password' => bcrypt('password'), 'must_reset_password' => false, 'verify_token' => null, 'verified_on' => Carbon::now(), 'active_on' => Carbon::now(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$janeProfile = Profile::create(['user_id' => $jane->id, 'username' => 'jmchallengergillitt', 'salutation' => 'Mrs', 'first_name' => 'Jane', 'middle_name' => '', 'last_name' => 'Challenger-Gillitt', 'nick_name' => 'Jane', 'date_of_birth' => '1980-01-01', 'address_line_1' => '1 Hove Road', 'address_line_2' => '', 'address_line_3' => '', 'address_line_4' => '', 'address_city' => 'Hove', 'address_county' => 'East Sussex', 'address_postcode' => 'BN3 3BN', 'private_email_address' => '[email protected]', 'mobile_number' => '+44 (0) 7987 654 321', 'twitter_username' => 'jmchallengergillitt', 'facebook_username' => 'jmchallengergillitt', 'google_plus_username' => 'jmchallengergillitt', 'instagram_username' => 'jmchallengergillitt', 'profile_photo_url' => 'https://placeholdit.imgix.net/~text?txt=JCG&txtsize=80&bg=eceff1&txtclr=607d8b&w=640&h=640', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$jane->profile()->save($janeProfile);
// Super Administrator (User)
$superU = User::create(['name' => 'Super Administrator', 'email' => '[email protected]', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$superUProfile = Profile::create(['user_id' => $superU->id, 'username' => 'superadmin', 'salutation' => 'Mr', 'first_name' => 'Super', 'middle_name' => '', 'last_name' => 'Administrator', 'nick_name' => 'SuperAdmin', 'date_of_birth' => '1980-01-01', 'address_line_1' => 'Address line 1', 'address_line_2' => '', 'address_line_3' => '', 'address_line_4' => '', 'address_city' => 'Hove', 'address_county' => 'East Sussex', 'address_postcode' => 'BN3 3HB', 'private_email_address' => '[email protected]', 'mobile_number' => '+44 (0) 7950 994 570', 'twitter_username' => 'superadmin', 'facebook_username' => 'superadmin', 'google_plus_username' => 'superadmin', 'instagram_username' => 'superadmin', 'profile_photo_url' => 'https://placeholdit.imgix.net/~text?txt=SUP&txtsize=80&bg=eceff1&txtclr=607d8b&w=640&h=640', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$superU->profile()->save($superUProfile);
// Administrator (User)
$adminU = User::create(['name' => 'Administrator', 'email' => '[email protected]', 'password' => bcrypt('password'), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$adminUProfile = Profile::create(['user_id' => $adminU->id, 'username' => 'admin', 'salutation' => 'Mr', 'first_name' => 'Admin', 'middle_name' => '', 'last_name' => 'Istrator', 'nick_name' => 'Admin', 'date_of_birth' => '1990-05-16', 'address_line_1' => '78A Sackville Road', 'address_line_2' => '', 'address_line_3' => '', 'address_line_4' => '', 'address_city' => 'Hove', 'address_county' => 'East Sussex', 'address_postcode' => 'BN3 3HB', 'private_email_address' => '[email protected]', 'mobile_number' => '+44 (0) 7950 994 570', 'twitter_username' => 'admin', 'facebook_username' => 'admin', 'google_plus_username' => 'admin', 'instagram_username' => 'admin', 'profile_photo_url' => 'https://placeholdit.imgix.net/~text?txt=ADM&txtsize=90&bg=eceff1&txtclr=607d8b&w=640&h=640', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$adminU->profile()->save($adminUProfile);
// Super Administrator (Role)
$superR = Role::create(['name' => 'super-admin', 'label' => 'Super Administrator']);
// Administrator (Role)
$adminR = Role::create(['name' => 'admin', 'label' => 'Administrator']);
// Student (Role)
$studentR = Role::create(['name' => 'student', 'label' => 'Student']);
//create 20 users
foreach (range(1, 20) as $index) {
$user_wbid = str_random(16);
$user_updated_at = $faker->dateTimeBetween($startDate = '-6 months', $endDate = 'now');
$user_created_at = $faker->dateTimeBetween($startDate = '-2 years', $endDate = $user_updated_at);
$user_name = $faker->firstName;
$user_username = strtolower($user_name . $faker->lastName);
$user_email = $user_username . $faker->companyEmail;
$user_dob = $faker->dateTimeBetween($startDate = '-25 years', $endDate = '-18 years');
$user = User::create(['wbid' => $user_wbid, 'name' => $user_name, 'dob' => $user_dob, 'email' => $user_email, 'username' => $user_username, 'password' => bcrypt('password'), 'key' => str_random(11), 'confirmed' => $faker->boolean(), 'created_at' => $user_created_at, 'updated_at' => $user_updated_at]);
$user->roles()->attach($studentR);
}
$michael->roles()->attach($studentR);
$sezer->roles()->attach($studentR);
$holly->roles()->attach($studentR);
$superU->roles()->attach($superR);
$adminU->roles()->attach($adminR);
$michael->roles()->attach($superR);
$sezer->roles()->attach($superR);
$michael->roles()->attach($adminR);
$sezer->roles()->attach($adminR);
$jane->roles()->attach($adminR);
}
开发者ID:mstnorris,项目名称:gallery.michaelnorris.co.uk,代码行数:59,代码来源:UsersTableSeeder.php
示例19: callbackHasNoCode
public function callbackHasNoCode(FunctionalTester $I)
{
$count = User::count() + Profile::count();
$I->sendGET($this->endpoint . '/facebook/callback');
$I->seeResponseCodeIs(409);
$I->seeResponseContainsJson(['status' => 'ERROR', 'message' => 'Ups, something went wrong during authorization']);
$I->assertEquals($count, User::count() + Profile::count());
}
开发者ID:soutoner,项目名称:api-desconecta,代码行数:8,代码来源:CallbackCest.php
示例20: findModel
protected function findModel($id)
{
if (($model = Profile::findOne(['user_id' => $id])) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
开发者ID:Akelcehg,项目名称:psycho,代码行数:8,代码来源:Module.php
注:本文中的app\models\Profile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论