Yii Framework Forum: 是否可以考虑现Yii\db中加入Db.php - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

是否可以考虑现Yii\db中加入Db.php

#1 User is offline   jackiesun 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 358
  • Joined: 04-January 09

Posted 17 May 2013 - 05:45 AM

http://four.laravel.com/docs/queries

主要是简化操作。

DB::from('user')->limit(1)->one();
DB::from('user')->limit(1)->all();

DB::createTable();

0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,777
  • Joined: 17-January 09
  • Location:Russia

Posted 17 May 2013 - 07:25 AM

Proposed lacks IDE support and is no better than the current

User::find(1);
User::find()->limit(10)->all();

Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   jackiesun 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 358
  • Joined: 04-January 09

Posted 21 May 2013 - 11:19 PM

View Postsamdark, on 17 May 2013 - 07:25 AM, said:

Proposed lacks IDE support and is no better than the current

User::find(1);
User::find()->limit(10)->all();


ORM is good code.like you write.
but DAO also
 \Yii::$app->db->createCommand()->queryRow();  

is it can be add DB.php then code like
DB:from('users')->where(array('id'=>1))->order('id','desc')->one();
OR ->all();

some code like this.
just think.lol
maybe looks better.
and also support master/slaver
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users