Copy file name of one model to other model

Hi. I have two models

  1. Quotations

  2. Order

I want to create order from quotation. Means i want to copy all fields to order table. Both have attribute


file

file can accept only two formats. When I try


$order->file=$quotation->file;

$order->save();

It says "File cannot be empty". What it is doing that $order->file does not accept strings and database shows this error. How can it be accomplished?

Thanks

Hi,

Please share your model’s rules for a better support. You can try this code below in your rules:


array('file','file','empty' = true)