<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "food_items".
 *
 * @property int $id
 * @property string|null $name
 * @property string|null $description
 * @property string|null $image
 * @property int|null $category
 * @property int|null $calories
 * @property int|null $carbs
 * @property int|null $fat
 * @property int|null $protein
 * @property int|null $fiber
 * @property int|null $quantity
 * @property int|null $unit
 * @property int|null $created_by
 * @property int|null $created_at
 * @property int|null $updated_at
 */
class FoodItems extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'food_items';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name', 'calories','quantity','unit','created_by'],'required'],
            [['description', 'unit','measurement','base_food_details'], 'string'],
            [['category', 'created_by', 'created_at', 'updated_at','base_qty'], 'integer'],
            [['name', 'image', 'food_id'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'description' => 'Description',
            'image' => 'Image',
            'category' => 'Category',
            'calories' => 'Calories',
            'carbs' => 'Carbs',
            'fat' => 'Fat',
            'protein' => 'Protein',
            'fiber' => 'Fiber',
            'quantity' => 'Quantity',
            'unit' => 'Unit',
            'created_by' => 'Created By',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
