php - Yii - find all by composite key -



php - Yii - find all by composite key -

how find primary key? don't want specify start , end dates aren't relevant when opening within booking form

$bookingroom = bookingroom::model()->findbypk(array('roomid' => 1, 'bookingid' => 1, 'startdate' => '20140619', 'enddate' => '20140620'));

you should utilize findallbyattributes() option:

$bookingroom = bookingroom::model()->findallbyattributes(array('roomid' => 1, 'bookingid' => 1, 'startdate' => '20140619', 'enddate' => '20140620'));

if don't want startdate , enddate included remove array.

here documentation: http://www.yiiframework.com/doc/api/1.1/cactiverecord#findallbyattributes-detail

php activerecord yii

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -