Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter + Doctrine = Me Going Crazy
#6

[eluser]kaejiavo[/eluser]
I use doctrine like this:
In my doctrine model the functions are declared
Code:
class Test extends BaseTest
{
    public function get_image()
    {
        if (!empty($this->image))
        {
            return $this->image;
        }
        else
        {
            return 'noimage.jpg';
        }
    }


}
In the controller i call the model using DQL
Code:
$q = Doctrine_Query::create()
                        ->from('Test t')
                        ->leftJoin('t.Type ty')
        $tests = $q->execute();

// then i can use the method as you asked:

$image = $tests->get_image();

I don't use the Doctrine::getTable() syntax, so i don't know if it should work the same way.
Marco


Messages In This Thread
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-30-2010, 04:50 AM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-30-2010, 10:32 PM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 03:30 AM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 07:43 AM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 07:54 AM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 08:54 AM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 09:23 AM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 01:18 PM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 01:26 PM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 10-31-2010, 01:53 PM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 11-02-2010, 07:34 PM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 11-03-2010, 02:34 PM
CodeIgniter + Doctrine = Me Going Crazy - by El Forum - 11-03-2010, 06:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB