當前位置: 首頁>>代碼示例>>PHP>>正文


PHP factory::load方法代碼示例

本文整理匯總了PHP中factory::load方法的典型用法代碼示例。如果您正苦於以下問題:PHP factory::load方法的具體用法?PHP factory::load怎麽用?PHP factory::load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在factory的用法示例。


在下文中一共展示了factory::load方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create


//.........這裏部分代碼省略.........
             break;
         case 'leaflet_category':
             require_once 'table_classes/config.php';
             require_once 'table_classes/leaflet_category.php';
             if (!$require_only) {
                 $object = DB_DataObject::factory($class_name);
             }
             break;
         case 'leaflet_election':
             require_once 'table_classes/config.php';
             require_once 'table_classes/leaflet_election.php';
             if (!$require_only) {
                 $object = DB_DataObject::factory($class_name);
             }
             break;
         case 'party':
             require_once 'table_classes/config.php';
             require_once 'table_classes/party.php';
             if (!$require_only) {
                 $object = DB_DataObject::factory($class_name);
             }
             break;
         case 'party_election':
             require_once 'table_classes/config.php';
             require_once 'table_classes/party_election.php';
             if (!$require_only) {
                 $object = DB_DataObject::factory($class_name);
             }
             break;
         case 'promise':
             require_once 'table_classes/config.php';
             require_once 'table_classes/promise.php';
             if (!$require_only) {
                 $object = DB_DataObject::factory($class_name);
             }
             break;
         case 'tag':
             require_once 'table_classes/config.php';
             require_once 'table_classes/tag.php';
             if (!$require_only) {
                 $object = DB_DataObject::factory($class_name);
             }
             break;
         case 'json':
             require_once 'json.php';
             if (!$require_only) {
                 $object = new Services_JSON();
             }
             break;
         case 'geocoder':
             require_once 'geocoder.php';
             if (!$require_only) {
                 $object = new geocoder();
             }
             break;
         case 'image':
             require_once 'image.php';
             if (!$require_only) {
                 $object = new image();
             }
             break;
         case 'geograph':
             require_once 'apis/geograph.php';
             if (!$require_only) {
                 $object = new geograph();
             }
         case 'twfy':
             require_once 'apis/theyworkforyou.php';
             if (!$require_only) {
                 $object = new TWFYAPI(THEYWORKFORYOU_API_KEY);
             }
             break;
         case 's3':
             require_once 'apis/s3/S3.php';
             if (!$require_only) {
                 $object = new S3();
             }
             break;
         case 'pdfer':
             require_once 'pdfer.php';
             if (!$require_only) {
                 $object = new pdfer();
             }
             break;
             // Catch all
         // Catch all
         default:
             if (!$require_only) {
                 trigger_error('Unknown class: ' . $class_name, 'The class that was thrown at this factory method is unknown. Check that you\'re passing the right data or that you haven\'t forgotten to define the class here!');
             } else {
                 // We'll mention something in the error log as this is an
                 // error
                 error_log('Could not load class ' . $class_name . ' via require_only in teh factory');
             }
             break;
     }
     // And if we're here, we should have an object that we can now apply
     // the loading rules to
     return factory::load($object, $element_id, $cache);
 }
開發者ID:schlos,項目名稱:electionleaflets,代碼行數:101,代碼來源:factory.php


注:本文中的factory::load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。