Hello,

With Doctrine 1, usually i have code like this
=====================================
<?php

class A
{
    protected $code;
    protected $value;

    public function setCode($code)
    {
        if($code) $this->code = $code;
        return $this;
    }

    public function setValue($value)
    {
        if($value) $this->value = $value;
        return $this;
    }

    public function result()
    {
        $query = Doctrine_Query::create()
               ->from('Table');
        if($this->code) $query->andWhere('code = ?', $this->code);
        if($this->value) $query->andWhere('value = ?', $this->value);

        return $query->execute();
    }
}

$object = new A();
print_r($object->setCode('AAA')->result());
====================================
http://en.wikipedia.org/wiki/Fluent_interface

How implemented that methode with Doctrine 2?


Thanks,
hdg

-- 
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