Reply to Abstract classes

Your name:

Reply:


Posted by Craig Taylor on 07/02/07 20:52

I've got an abstract class:

abstract class dbTable {
abstract static function fn1();
static function update()
{
// blah
$var = self::fn1();
// blah
}
}

And then sombody that uses it:

static class example extends dbTable {
static function fn1( ) { // blah
}

static fn2()
{
self::update();
}

}

The problem I'm running into is that the self::fn1() reference in the
abstract class is failing with a Cannot call abstract method fn1()
when I try to invoke it indirectly through dbTest.

Note: I do want them to be static classes as the lifetime of the usage
is not worth creating an object, calling 1 function, and then
destroying it.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация