Another option is to lazily calculate it:

    class Category
    {
        private $total;

        public function getTotal()
        {
            if ($this->total === null) {
                $this->total = // calucate it here
            }

            return $this->total;
        }
    }

--  
Jasper N. Brouwer
(@jaspernbrouwer)


On 21 November 2014 at 12:16:43, [email protected] 
([email protected]) wrote:
> i don't will like create a column, because that attribute can change accord
> with period the attribute $date.
>  
> class Operation {
> $description;
> $value;
> $date;
> }
>  
> Ex:
>  
> category: fuel in jun/2014 ($total = 100.00)
> category: fuel in jul/2014 ($total = 150.00)


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to