protected/models/Dish.php
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* This is the model class for table "dish".
*
* The followings are the available columns in table 'dish':
* @property string $id
* @property string $dishName
* @property string $dishPrice
* @property string $dishPouplarity
* @property string $dishImgUrl
* @property string $dishCreateTime
* @property string $dishDesc
* @property string $userId
* @property string $typeId
* @property string $dishFlag
*
* The followings are the available model relations:
* @property User $user
* @property Type $type
* @property DishOrder[] $dishOrders
* @property FavoriteDish[] $favoriteDishes
*/
class Dish extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Dish the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'dish';
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('dishName, dishPrice, dishImgUrl, dishDesc, typeId', 'required'),
array('dishPrice','numerical','message'=>'请输入数字'),
array('dishName, dishPrice, dishPouplarity, dishImgUrl, dishDesc', 'length', 'max'=>45),
array('userId, typeId, dishFlag', 'length', 'max'=>10),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, dishName, dishPrice, dishPouplarity, dishImgUrl, dishCreateTime, dishDesc, userId, typeId, dishFlag', 'safe', 'on'=>'search'),
);
}
后面还有 62 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
