The thing you should change is your boss ;)

I'm kidding :P There are several ways for making a counter and depending of
required stats, each solution has his advantages.

In your case, create an integer field on your model and increment it each
time the object is displayed.

public function executeIndex(...)
{
  ...
  $myModel->hitView();
  ...
}

And in your model :

public function hitView()
{
 $this->setDisplayed($this->getDisplayed() + 1);
 $this->save();
}


Simple is better,

Alex'

2009/10/21 aymeric <[email protected]>

>
> My boss is happy with the stats he gets from the current hit function
> (even if it is totally overestimated since the sales division use this
> site at least 10 times/person/day). I just need somthing simple
> (GAnalytics will come someday but not from me).
>
> thanks for the advices
>
> On Oct 20, 8:13 pm, Eno <[email protected]> wrote:
> > On Tue, 20 Oct 2009, Gareth McCumskey wrote:
> > > True. But again some people don't want the n'th degree of statistics
> and a
> > > basic counter is sufficient. Its all about his requirements. I'm a fan
> of
> > > not over complicating a solution to your needs.
> >
> > Pretty funny statement, considering that most analytics are simple
> > Javascript includes (vs. writing some action/database code :-)
> >
> > --
> >
>


-- 
Alexandre Salomé -- [email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to