class_WebNewsFactory.php
Go to the documentation of this file.00001 <?php
00024 class WebNewsFactory extends BaseFactory {
00028 private $requestInstance = null;
00029
00035 protected function __construct () {
00036
00037 parent::__construct(__CLASS__);
00038 }
00039
00047 public final static function createFactoryByRequest (Requestable $requestInstance) {
00048
00049 $configEntry = "news_reader_class";
00050
00051
00052 $page = $requestInstance->getRequestElement('page');
00053
00054
00055 if (!empty($page)) {
00056
00057 $configEntry = sprintf("news_reader_%s_class", $page);
00058
00059
00060 $action = $requestInstance->getRequestElement('action');
00061
00062
00063 if (!empty($action)) {
00064
00065 $configEntry = sprintf("news_reader_%s_%s_class", $page, $action);
00066 }
00067 }
00068
00069
00070 $className = $requestInstance->getConfigInstance()->readConfig($configEntry);
00071
00072
00073 $newsInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
00074
00075
00076 $newsInstance->initializeReader();
00077
00078
00079 return $newsInstance;
00080 }
00081 }
00082
00083
00084 ?>