TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'], ], ], ]; } /** * {@inheritdoc} */ public function rules() { return [ [['food_name', 'file_name', 'calories', 'protein', 'fat', 'carbohydrates', 'fiber'], 'required'], [['user_id', 'calories', 'protein', 'fat', 'carbohydrates', 'fiber', 'created_at', 'updated_at'], 'integer'], [['file_name'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'file_name' => 'File Name', 'calories' => 'Calories', 'protein' => 'Protein', 'fat' => 'Fat', 'carbohydrates' => 'Carbohydrates', 'fiber' => 'Fiber', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } }