• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP db_table_factory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中db_table_factory的典型用法代码示例。如果您正苦于以下问题:PHP db_table_factory类的具体用法?PHP db_table_factory怎么用?PHP db_table_factory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了db_table_factory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _get_theme_subscribers

  function _get_theme_subscribers($theme_id)
  {
    $db_table	=  & db_table_factory :: instance('subscribe_member');
    $subscribers = $db_table->get_list(array('theme_id' => $theme_id), '', 'member_id');

    if (!count($subscribers))
      return array();

    $members_list = $this->_get_subscribers_from_branch('/root/admin/members');
    $users_list = $this->_get_subscribers_from_branch('/root/admin/users');

    $total_list = array_merge($members_list, $users_list);

    foreach($total_list as $key => $data)
    {
      if (!isset($data['email']) || !$data['email'])
        continue;

      $user_id = $data['id'];
      if(array_key_exists($user_id, $subscribers))
      {
        $subscribers[$user_id]['email'] = $data['email'];
        $subscribers[$user_id]['name'] = $data['name'];
      }
    }

    return $subscribers;
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:28,代码来源:subscribe_mail.class.php


示例2: array

 function &get_dataset(&$counter, $params = array())
 {
     $object_data = fetch_mapped_by_url();
     if (!count($object_data)) {
         return new array_dataset(array());
     }
     $db_table =& db_table_factory::instance('sys_object_version');
     $arr = $db_table->get_list('object_id=' . $object_data['id'], 'version DESC');
     $result = array();
     $users =& fetch_sub_branch('/root/users', 'user_object', $counter);
     foreach ($arr as $data) {
         $record = $data;
         $user = '';
         if (count($users)) {
             foreach ($users as $user_data) {
                 if ($user_data['id'] == $data['creator_id']) {
                     $user = $user_data;
                     break;
                 }
             }
         }
         if ($user) {
             $record['creator_identifier'] = $user['identifier'];
             $record['creator_email'] = $user['email'];
             $record['creator_name'] = $user['name'];
             $record['creator_lastname'] = isset($user['lastname']) ? $user['lastname'] : '';
         }
         $result[] = $record;
     }
     return new array_dataset($result);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:object_versions_datasource.class.php


示例3: array

 function &get_dataset($params = array())
 {
     $request = request::instance();
     if (!($class_id = $request->get_attribute('class_id'))) {
         return new array_dataset();
     }
     $db_table =& db_table_factory::instance('sys_class');
     $class_data = $db_table->get_row_by_id($class_id);
     if (!$class_data) {
         return new array_dataset();
     }
     $c =& site_object_factory::instance($class_data['class_name']);
     $site_object_controller =& $c->get_controller();
     $actions = $site_object_controller->get_actions_definitions();
     $result = array();
     foreach ($actions as $action => $action_params) {
         if (!isset($action_params['can_have_access_template']) || !$action_params['can_have_access_template']) {
             continue;
         }
         if (isset($action_params['action_name'])) {
             $result[$action]['action_name'] = $action_params['action_name'];
         } else {
             $result[$action]['action_name'] = str_replace('_', ' ', strtoupper($action[0]) . substr($action, 1));
         }
     }
     return new array_dataset($result);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:class_template_actions_list_datasource.class.php


示例4: _update_media_record

 function _update_media_record($id, $tmp_file_path, $file_name, $mime_type)
 {
     if (!file_exists($tmp_file_path)) {
         debug::write_error('file doesnt exist', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('tmp' => $tmp_file_path));
         return false;
     }
     if (function_exists('md5_file')) {
         $etag = md5_file($tmp_file_path);
     } else {
         $fd = fopen($data['tmp_name'], 'rb');
         $contents = fread($fd, filesize($tmp_file_path));
         fclose($fd);
         $etag = md5($contents);
     }
     if (!is_dir(MEDIA_DIR)) {
         dir::mkdir(MEDIA_DIR, 777, true);
     }
     if (!copy($tmp_file_path, MEDIA_DIR . $id . '.media')) {
         debug::write_error('temporary file copy failed', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('src' => $tmp_file_path, 'dst' => MEDIA_DIR . $id . '.media'));
         return false;
     }
     $media_db_table = db_table_factory::instance('media');
     $media_db_table->update_by_id($id, array('file_name' => $file_name, 'mime_type' => $mime_type, 'size' => filesize($tmp_file_path), 'etag' => $etag));
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:25,代码来源:media_object.class.php


示例5: setUp

 function setUp()
 {
     $this->image =& db_table_factory::instance('test_image');
     $this->image_variation =& db_table_factory::instance('test_image_variation');
     $this->media =& db_table_factory::instance('test_media');
     parent::setUp();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:db_table_cascade_delete_test.class.php


示例6: load_metadata

 function load_metadata()
 {
     $ids_array = $this->_get_path_objects_ids_array();
     if (!count($ids_array)) {
         return false;
     }
     $sys_metadata_db_table =& db_table_factory::instance('sys_metadata');
     $objects_metadata = $sys_metadata_db_table->get_list(sql_in('object_id', $ids_array), '', 'object_id');
     if (!count($objects_metadata)) {
         return false;
     }
     $ids_array = array_reverse($ids_array);
     $got_keywords = false;
     $got_description = false;
     foreach ($ids_array as $object_id) {
         if ($got_keywords && $got_description) {
             break;
         }
         if (!$got_keywords && !empty($objects_metadata[$object_id]['keywords'])) {
             $this->object_metadata['keywords'] = $objects_metadata[$object_id]['keywords'];
             $got_keywords = true;
         }
         if (!$got_description && !empty($objects_metadata[$object_id]['description'])) {
             $this->object_metadata['description'] = $objects_metadata[$object_id]['description'];
             $got_description = true;
         }
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:29,代码来源:metadata_component.class.php


示例7: get_dataset

	function & get_dataset($params = array())
	{
		if(!$arr = fetch_requested_object())
			return new array_dataset();
		
		$db_table =& db_table_factory :: instance('sys_class');
		$classes = $db_table->get_list('', 'class_name');
		
		$result = array();
		$params = array();

		foreach($classes as $class_id => $class_data)
		{
			$result[$class_id] = $class_data;
			$result[$class_id]['path'] = $arr['path'];
			$params['class_id'] = $class_id;
			$result[$class_id]['node_id'] = $arr['node_id'];
			
			foreach($arr['actions'] as $action_name => $action_params)
				$arr['actions'][$action_name]['extra'] = $params;

			$result[$class_id]['actions'] = $arr['actions'];
		}
		
		return new array_dataset($result);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:26,代码来源:class_list_datasource.class.php


示例8: get_dataset

  function & get_dataset($params = array())
  {
    $request = request :: instance();

    if(!$controller_id = $this->_get_controller_id())
      return new array_dataset();

    $db_table =& db_table_factory :: instance('sys_controller');
    $controller_data = $db_table->get_row_by_id($controller_id);

    if (!$controller_data)
      return new array_dataset();

    $site_object_controller =& site_object_controller :: create($controller_data['name']);

    $actions = $site_object_controller->get_actions_definitions();

    $result = array();
    foreach($actions as $action => $action_params)
    {
      if (!isset($action_params['can_have_access_template']) || !$action_params['can_have_access_template'])
        continue;

      if(isset($action_params['action_name']))
        $result[$action]['action_name'] = $action_params['action_name'];
      else
        $result[$action]['action_name'] = str_replace('_', ' ', strtoupper($action{0}) . substr($action, 1));
    }

    return new array_dataset($result);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:controller_template_actions_list_datasource.class.php


示例9: array

 function &get_dataset($params = array())
 {
     $request = request::instance();
     if (!($controller_id = $request->get_attribute('controller_id'))) {
         return new array_dataset();
     }
     $db_table =& db_table_factory::instance('sys_controller');
     $controller_data = $db_table->get_row_by_id($controller_id);
     if (!$controller_data) {
         return new array_dataset();
     }
     $site_object_controller =& site_object_controller::create($controller_data['name']);
     $actions = $site_object_controller->get_actions_definitions();
     $user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter);
     $result = array();
     foreach ($actions as $action => $action_params) {
         if (isset($action_params['action_name'])) {
             $result[$action]['action_name'] = $action_params['action_name'];
         } else {
             $result[$action]['action_name'] = str_replace('_', ' ', strtoupper($action[0]) . substr($action, 1));
         }
         $result[$action]['permissions_required'] = $action_params['permissions_required'];
         foreach ($user_groups as $group_id => $group_data) {
             $result[$action]['groups'][$group_id]['selector_name'] = 'policy[' . $group_id . '][' . $action . ']';
         }
     }
     return new array_dataset($result);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:28,代码来源:controller_group_action_access_datasource.class.php


示例10: test_save

  function test_save()
  {
  	$metadata['id'] = 1;
  	$metadata['keywords'] = 'keywords';
  	$metadata['description'] = 'description';
  	
  	$o =& site_object_factory :: create('site_object');
  	
  	$o->import_attributes($metadata);
  	$result_id = $o->save_metadata();
  	
  	$this->assertNotNull($result_id);
  	
  	$sys_metadata_db_table =& db_table_factory :: instance('sys_metadata');
  	$metadata_row = $sys_metadata_db_table->get_row_by_id($result_id);
  	
  	$this->assertTrue(is_array($metadata_row));
  	$this->assertTrue(isset($metadata_row['object_id']));
  	$this->assertTrue(isset($metadata_row['keywords']));
  	$this->assertTrue(isset($metadata_row['description']));

  	$this->assertEqual($metadata_row['object_id'], 1);
  	$this->assertEqual($metadata_row['keywords'], 'keywords');
  	$this->assertEqual($metadata_row['description'], 'description');
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:25,代码来源:save_metadata_test.class.php


示例11: test_db_table_cascade_delete

 function test_db_table_cascade_delete($name = 'db table test case')
 {
     $this->image =& db_table_factory::instance('test_image');
     $this->image_variation =& db_table_factory::instance('test_image_variation');
     $this->media =& db_table_factory::instance('test_media');
     parent::test_db_case($name);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:test_db_table_cascade_delete.php


示例12: array

 function &get_dataset($params = array())
 {
     $request = request::instance();
     if (!($class_id = $request->get_attribute('class_id'))) {
         return new array_dataset();
     }
     $db_table =& db_table_factory::instance('sys_class');
     $class_data = $db_table->get_row_by_id($class_id);
     if (!$class_data) {
         return new array_dataset();
     }
     $c =& site_object_factory::instance($class_data['class_name']);
     $site_object_controller =& $c->get_controller();
     $actions = $site_object_controller->get_actions_definitions();
     $user_groups =& fetch_sub_branch('/root/user_groups', 'user_group', $counter);
     $result = array();
     foreach ($user_groups as $group_id => $group_data) {
         foreach ($actions as $action => $action_params) {
             if (!isset($action_params['can_have_access_template']) || !$action_params['can_have_access_template']) {
                 continue;
             }
             if (isset($action_params['action_name'])) {
                 $result[$group_id]['actions'][$action]['action_name'] = $action_params['action_name'];
             } else {
                 $result[$group_id]['actions'][$action]['action_name'] = str_replace('_', ' ', strtoupper($action[0]) . substr($action, 1));
             }
             $result[$group_id]['group_name'] = $group_data['identifier'];
             $result[$group_id]['actions'][$action]['read_selector_name'] = 'template[' . $action . '][' . $group_id . '][r]';
             $result[$group_id]['actions'][$action]['write_selector_name'] = 'template[' . $action . '][' . $group_id . '][w]';
         }
     }
     return new array_dataset($result);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:33,代码来源:class_group_access_template_datasource.class.php


示例13: db_cart_handler

	function db_cart_handler($cart_id)
	{
	  parent :: cart_handler($cart_id);
	  
	  $this->cart_db_table =& db_table_factory :: instance('cart');
	  
	  register_shutdown_function(array(&$this, '_db_cart_handler'));
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:db_cart_handler.class.php


示例14: _insert_user_site_object_access_records

 function _insert_user_site_object_access_records()
 {
     $access_db_table =& db_table_factory::instance('sys_object_access');
     $data = array();
     for ($i = 8; $i <= 10; $i++) {
         $this->db->sql_insert('sys_object_access', array('object_id' => $i, 'accessor_id' => 200, 'r' => 1, 'w' => 1, 'accessor_type' => ACCESSOR_TYPE_USER));
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:site_object_fetch_accessible_test_init.php


示例15: array

 function &get_dataset($params = array())
 {
     if (!fetch_requested_object()) {
         return new array_dataset();
     }
     $db_table =& db_table_factory::instance('sys_controller');
     $controllers = $db_table->get_list('', 'name');
     return new array_dataset($controllers);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:controller_list_datasource.class.php


示例16: _insert_object_version_records

 function _insert_object_version_records($object_id, $version_max)
 {
     $version_db_table =& db_table_factory::instance('sys_object_version');
     for ($i = 1; $i <= $version_max; $i++) {
         $data = array();
         $data['version'] = $i;
         $data['object_id'] = $object_id;
         $version_db_table->insert($data);
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:content_object_fetch_test_init.php


示例17: _create_version_record

 function _create_version_record()
 {
     $version_db_table =& db_table_factory::instance('sys_object_version');
     $time = time();
     $data['object_id'] = $this->get_id();
     $data['version'] = $this->get_version();
     $data['created_date'] = $time;
     $data['modified_date'] = $time;
     $data['creator_id'] = user::get_id();
     $version_db_table->insert($data);
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:content_object.class.php


示例18: get_id

 function get_id($controller_name)
 {
     $db_table =& db_table_factory::instance('sys_controller');
     $list = $db_table->get_list('name="' . $controller_name . '"');
     if (count($list) == 1) {
         return key($list);
     } elseif (count($list) > 1) {
         error('there are more than 1 controller found', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('controller_name' => $controller_name));
     }
     $db_table->insert(array('name' => $controller_name));
     return $db_table->get_last_insert_id();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:site_object_controller.class.php


示例19: test_save_wrong_membership

 function test_save_wrong_membership()
 {
     $membership = array(100 => 1, 103 => 1, ';drop user_in_group;' => 1);
     $obj =& site_object_factory::create('user_object');
     $obj->save_membership(10, $membership);
     $db_table =& db_table_factory::instance('user_in_group');
     $rows = $db_table->get_list('', 'id');
     $this->assertTrue(is_array($rows));
     $this->assertEqual(count($rows), 4);
     $record = end($rows);
     $this->assertEqual($record['group_id'], (int) ';drop user_in_group;');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:test_user_object.php


示例20: _init_dataspace

 function _init_dataspace()
 {
     $object_data =& fetch_mapped_by_url();
     $phpbb_users_db_table =& db_table_factory::create('phpbb_users');
     $conditions['user_id'] = $object_data['id'];
     $list = $phpbb_users_db_table->get_list($conditions);
     if (!count($list)) {
         return;
     }
     $phpbb_user_data = current($list);
     $data['rank'] = $phpbb_user_data['user_rank'];
     $this->dataspace->import($data);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:set_phpbb_rank_action.class.php



注:本文中的db_table_factory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP db_test类代码示例发布时间:2022-05-23
下一篇:
PHP db_factory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap