本文整理汇总了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);
}