本文整理匯總了PHP中Food::getById__first方法的典型用法代碼示例。如果您正苦於以下問題:PHP Food::getById__first方法的具體用法?PHP Food::getById__first怎麽用?PHP Food::getById__first使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Food
的用法示例。
在下文中一共展示了Food::getById__first方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test
public function test()
{
$this->load()->model('Food');
$food = new Food();
echo '<pre>';
//print_r( $food->getById(14) );
//print_r( $food->getById(14, array('limit'=>1)) );
//print_r( $food->limit(10) );
//print_r( $food->limit(10,'id,name') );
//print_r( $food->limit(10,'name','id') );
//print_r( $food->limit(10,'name,id','location') );
//print_r( Food::_limit(10) );
//print_r( $food->getOne() );
//print_r( Food::_getOne() );
//$food->location = 'Asia';
//$food->food_type_id = 10;
print_r($food->count());
print_r(Food::_count());
print_r(Food::_count($food));
//Doo::cache('php')->set('foodtotal', Food::_count($food));
//echo '<h1>'. Doo::cache('php')->get('foodtotal') .'</h1>';
print_r(Food::getById__first(6));
//$food->id = 14;
//print_r( $food->getOne() );
// print_r( $food->find() );
//print_r( Food::_find($food) );
//print_r( $food->getById_location__first(6, 'Malaysia') );
//print_r( $food->getById_location(6, 'Malaysia', array('limit'=>1)) );
//print_r( $food->relateFoodType($food, array('limit'=>'first')) );
//print_r( $food->relateFoodType($food) );
//print_r( $food->relateFoodType__first($food) );
//print_r( Food::getById__location__first(6, 'Malaysia') );
//print_r( Food::getById__location(6, 'Malaysia') );
//print_r( Food::getById__first(6) );
//print_r( Food::getByLocation('Malaysia') );
//print_r( Food::relateFoodType__first($food) );
//print_r( Food::relateFoodType() );
//print_r( Food::relateFoodType_first() );
//print_r( Food::_relate('', 'FoodType') );
//
//$f = new Food;
//print_r( $f->relate('FoodType') );
//print_r( $f->relate('FoodType', array('limit'=>'first')) );
# if update/delete/insert cache auto purged on the Model.
//$food->id = 6;
//$food->name = 'Wan Tan Mee';
//$food->update();
//print_r($food->find());
//$food->purgeCache(); #to delete cache manually
//Food::_purgeCache(); #to delete cache manually
# If no SQL is displayed, it means that the data are read from cache.
# And of course your Model have to extend DooSmartModel
print_r(Doo::db()->showSQL());
}