Is there a simple way to enforce a private method in a subclass?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

If I have an abstract class of Task and I want all subclasses of Task
to have a private method _runTask, is there a way to enforce this?

Currently an abstract private function in an abstract class isn't allowed.

Fatal error: Abstract function Task::_runTask() cannot be declared
private in D:\PHP\Includes\Task.php on line 91

Now I'm pretty sure there are valid reasons for this, but, for me, the
key part here is the "abstract" modifier.

This should be read first and foremost and simply say that somewhere
in the subclasses, this method must defined. And if it must be defined
as private, then so be it.

Richard.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux