国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

laravel eloquent implementation principle
滿天的星座
滿天的星座 2017-05-16 16:56:22
0
4
855

laravel eloquent implementation principle

滿天的星座
滿天的星座

reply all(4)
世界只因有你

For example:
<?php

class BusinessWork extends Eloquent
{

/**
 * The database table used by the model.
 * @var string
 */
protected $table = 'businessWork';
protected $connection = 'mysql';
public $timestamps = 0;
protected $fillable = array(
    'businessId',
    'title',
    'content',
    'createAt',
);

}

BusinessWork::find(1); This is how table binding is implemented

Ty80

Let me try to answer. I'm not familiar with it, I'm new to it, I hope I'm not misleading.
You can see that BusinessWork inherits Eloquent and has its own tables, operable field properties, etc.
BusinessWork::find(1) is inherited from Eloquent. It also has some common operations such as fetching all records: BusinessWork::all(), which can also be rewritten in BusinessWork.
You can take the time to go out and turn left to Baidu or right to Google to download Laravel's Eloquent ORM documentation.
hope this helps.

習(xí)慣沉默

Use the class reflection mechanism to obtain the class name, and then parse it into a table name.
Any questions?

淡淡煙草味

For delayed binding implementation, refer to PHP 5.3’s static

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template