I have two database fields $object->value and $object->max_value and want to store the proportion in $object->percent_value without having a db field for it.
Is there a way to do this in a doctrine model?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should have an
ObjectBaseclass (obviously named something different) where the database attributes are defined. There should also be anObjectclass. Here you can define thepercent_valueattribute which calculates and returns the percentage on the fly.