Use static public function to declare it.
2010/4/2 Andrzej <[email protected]> > But now I have error: > Non-static method Test::getNews() should not be called statically, > assuming $this from incompatible context > > On 2 Kwi, 19:52, Rodrigo <[email protected]> wrote: > > Hi Andrzej. > > Try with $this->nevs = test::getNews(); > > > > I suggest you to call class with Caps... 'class Test extends > > Doctrine_Table', same with filename, Test.class.php, just following > > standars. > > > > Blesses.- > > > > 2010/4/2 Andrzej <[email protected]> > > > > > > > > > I have model News. I would like to build independent module with forms > > > and queries inside because then I would like to send it to my friend. > > > So I have module with name 'fresh_news'. Inside module 'fresh_news' I > > > created folder 'lib' and there file 'test.class.php' with code (I > > > think I should extends Doctrine_Table): > > > > > class test extends Doctrine_Table > > > { > > > public function getNews() > > > { > > > $q = Doctrine_Query::create() > > > ->from('News'); > > > > > return $q->execute(); > > > } > > > } > > > > > In actions.class.php I have: > > > $this->nevs = Doctrine::getTable('test')->getNews(); > > > > > But I have an error: > > > Catchable fatal error: Argument 2 passed to > > > Doctrine_Table::__construct() must be an instance of > > > Doctrine_Connection, none given....... > > > > > what can I do ? > > > > > -- > > > If you want to report a vulnerability issue on symfony, please send it > to > > > security at symfony-project.com > > > > > 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]<symfony-users%[email protected]> > <symfony-users%2bunsubscr...@goog legroups.com> > > > For more options, visit this group at > > >http://groups.google.com/group/symfony-users?hl=en > > > > > To unsubscribe, reply using "remove me" as the subject. > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > 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]<symfony-users%[email protected]> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com 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
