You can have another layer of business logic classes that you store in
lib/ which interact with your
models directly.
gabriel
On Oct 6, 7:24 am, Sebastien Armand [Pink] khe...@gmail.com wrote:
Most of the times in symfony applications, we'll have a model let's say it's
'Product' and then
class WebModelClass extends ModelClass
{
public function __toString()
{
return this-getUrl();
}
public function getUrl()
{
return Whatever I decide to do to generate URL here!;
}
public function initialiseForm()
{
//Whatever I want to do to initialise the correct form
I rather prefer to compose than to subclass here.
class ProductView
{
public function __construct(Product $product)
{
$this-product = $product;
}
public function setSelected($selected)...
public function getUrl()...
etc.
}
Bernhard
--
If you want to report a vulnerability
Bunch of nice ideas here! Gotta find how to make my own sauce now!
On Thu, Oct 7, 2010 at 9:40 PM, Bernhard Schussek bschus...@gmail.comwrote:
I rather prefer to compose than to subclass here.
class ProductView
{
public function __construct(Product $product)
{
$this-product =
Hey Sebastien,
your intuition is right, those things don't belong in the model, as
they differ from application to application.
There are easy ways to have the best of both worlds though.
First, links to, say, a product I find pretty simple:
link_to($product, product_show, $product);
However, if
It does indeed!
Thanks
On Thu, Oct 7, 2010 at 12:37 AM, Richtermeister nex...@gmail.com wrote:
Hey Sebastien,
your intuition is right, those things don't belong in the model, as
they differ from application to application.
There are easy ways to have the best of both worlds though.