本文整理汇总了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());
}