本文整理汇总了PHP中site_object_controller::get_id方法的典型用法代码示例。如果您正苦于以下问题:PHP site_object_controller::get_id方法的具体用法?PHP site_object_controller::get_id怎么用?PHP site_object_controller::get_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类site_object_controller
的用法示例。
在下文中一共展示了site_object_controller::get_id方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
function setUp()
{
$this->db =& db_factory::instance();
$this->_clean_up();
$this->_init_site_object();
$this->object->set_attribute('controller_name', 'site_object_controller');
$controller_id = site_object_controller::get_id('site_object_controller');
$this->object->set_attribute('controller_id', $controller_id);
debug_mock::init($this);
$user =& user::instance();
$user->_set_id(10);
$tree =& tree::instance();
$values['identifier'] = 'root';
$values['object_id'] = 100;
$this->root_node_id = $tree->create_root_node($values, false, true);
$class_id = $this->object->get_class_id();
$this->db->sql_insert('sys_site_object', array('id' => 100, 'class_id' => $class_id, 'current_version' => 1));
$values['identifier'] = 'ru';
$values['object_id'] = 1;
$this->parent_node_id = $tree->create_sub_node($this->root_node_id, $values);
$this->db->sql_insert('sys_site_object', array('id' => 1, 'class_id' => $class_id, 'current_version' => 1));
$values['identifier'] = 'document';
$values['object_id'] = 10;
$this->sub_node_id = $tree->create_sub_node($this->parent_node_id, $values);
$this->db->sql_insert('sys_site_object', array('id' => 10, 'class_id' => $class_id, 'current_version' => 1));
}
示例2: init
function init(&$object)
{
$this->class_id = $object->get_class_id();
$this->controller_id = site_object_controller::get_id(get_class($object) . '_controller');
$this->_insert_sys_site_object_records();
$this->_insert_fake_sys_site_object_records();
}
示例3: _valid_perform
function _valid_perform(&$request, &$response)
{
$tree =& tree::instance();
$params = array();
$params['identifier'] = $this->dataspace->get('identifier');
$params['class'] = $this->dataspace->get('class_name');
$params['title'] = $this->dataspace->get('title');
$params['parent_node_id'] = $this->dataspace->get('parent_node_id');
$params['controller_id'] = site_object_controller::get_id($this->dataspace->get('controller_name'));
$object =& site_object_factory::create($params['class']);
if (!($parent_data = fetch_one_by_node_id($params['parent_node_id']))) {
error("parent wasn't retrieved", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
$object->merge_attributes($params);
if (!$object->create()) {
error("object wasn't registered", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
}
$parent_object =& site_object_factory::create($parent_data['class_name']);
$parent_object->merge_attributes($parent_data);
$access_policy =& access_policy::instance();
$access_policy->save_initial_object_access($object, $parent_object);
$request->set_status(REQUEST_STATUS_FORM_SUBMITTED);
if ($request->has_attribute('popup')) {
$response->write(close_popup_response($request));
}
}
示例4: _valid_perform
function _valid_perform(&$request, &$response)
{
$node_id = $this->dataspace->get('id');
if (!($object = wrap_with_site_object(fetch_one_by_node_id($node_id)))) {
$request->set_status(REQUEST_STATUS_FAILURE);
return;
}
$object->set_attribute('controller_id', site_object_controller::get_id($this->dataspace->get('controller_name')));
$object->update(false);
$request->set_status(REQUEST_STATUS_SUCCESS);
if ($request->has_attribute('popup')) {
$response->write(close_popup_response($request));
}
}
示例5: _get_controller_id
function _get_controller_id()
{
$controller_name = $this->_define_controller_name();
return site_object_controller::get_id($controller_name);
}
示例6: die
*
* $Id$
*
***********************************************************************************/
if (isset($argv[1])) {
$project_dir = $argv[1];
} else {
die('project dir required');
}
require_once $project_dir . '/setup.php';
require_once LIMB_DIR . '/core/lib/db/db_table_factory.class.php';
require_once LIMB_DIR . '/core/controllers/site_object_controller.class.php';
$site_object_db_table = db_table_factory::create('sys_site_object');
$class_db_table = db_table_factory::create('sys_class');
$action_access_db_table = db_table_factory::create('sys_action_access');
$group_object_access_template_db_table = db_table_factory::create('sys_group_object_access_template');
$user_object_access_template_db_table = db_table_factory::create('sys_user_object_access_template');
$classes = $class_db_table->get_list();
foreach ($classes as $class) {
$class_id = $class['id'];
$controller_name = $class['class_name'] . '_controller';
$controller_id = site_object_controller::get_id($controller_name);
$conditions['class_id'] = $class_id;
$row['controller_id'] = $controller_id;
$site_object_db_table->update($row, $conditions);
$action_access_db_table->update($row, $conditions);
$group_object_access_template_db_table->update($row, $conditions);
$user_object_access_template_db_table->update($row, $conditions);
echo $class['class_name'] . " objects updated...\n";
}
echo 'done';
示例7:
function get_controller_id()
{
if($controller_name = $this->get_controller_name())
return site_object_controller :: get_id($controller_name);
else
return null;
}
示例8: setUp
function setUp()
{
parent :: setUp();
$this->fetcher =& new fetcher();
$this->fetcher->set_jip_status(true);
$user_id = 10;
$this->_login_user($user_id, array(103 => 'visitors', 104 => 'admin'));
$controller_id = site_object_controller :: get_id('fetching_test_controller_test_version');
$obj1 = site_object_factory :: create('fetching_object1_test_version');
$obj2 = site_object_factory :: create('fetching_object2_test_version');
$obj1->set_identifier('root');
$obj1->set_title('Root');
$obj1->set_attribute('controller_id', $controller_id);
$obj2->set_attribute('controller_name', 'fetching_test_controller_test_version');
$obj1->create(true);
$access[$obj1->get_id()] = array($user_id => 1);
$this->root_node_id = $obj1->get_node_id();
$this->_add_object($obj1);
$obj1->set_parent_node_id($this->root_node_id);
$obj1->set_identifier('articles');
$obj1->set_title('Articles');
$obj2->set_attribute('controller_name', 'fetching_test_controller_test_version');
$obj1->set_attribute('controller_id', $controller_id);
$obj1->create();
$access[$obj1->get_id()] = array($user_id => 1);
$this->_add_object($obj1);
$this->articles_object = $obj1;
$obj2->set_parent_node_id($obj1->get_node_id());
$obj2->set_identifier('article1');
$obj2->set_title('Article1');
$obj2->set_attribute('controller_name', 'fetching_test_controller_test_version');
$obj2->set_attribute('controller_id', $controller_id);
$obj2->create();
$access[$obj2->get_id()] = array($user_id => 1);
$this->child_node_ids[] = $obj2->get_node_id();
$this->_add_object($obj2);
$this->article_object = $obj2;
$obj2->set_parent_node_id($obj1->get_node_id());
$obj2->set_identifier('article2');
$obj2->set_title('Article2');
$obj2->set_attribute('controller_id', $controller_id);
$obj2->set_attribute('controller_name', 'fetching_test_controller_test_version');
$obj2->create();
$access[$obj2->get_id()] = array($user_id => 1);
$this->child_node_ids[] = $obj2->get_node_id();
$this->_add_object($obj2);
$obj2->set_parent_node_id($obj1->get_node_id());
$obj2->set_identifier('article3');
$obj2->set_title('Article3');
$obj2->set_attribute('controller_id', $controller_id);
$obj2->set_attribute('controller_name', 'fetching_test_controller_test_version');
$obj2->create();
$access[$obj2->get_id()] = array($user_id => 0);
$this->child_node_ids[] = $obj2->get_node_id();
$this->_add_object($obj2);
$this->access_policy =& access_policy :: instance();
$this->access_policy->save_object_access($access, ACCESSOR_TYPE_USER);
$actions = array(
$user_id => array(
'display' => 1,
),
);
$this->access_policy->save_action_access($obj1->get_class_id(), $actions, ACCESSOR_TYPE_USER);
$this->access_policy->save_action_access($obj2->get_class_id(), $actions, ACCESSOR_TYPE_USER);
}
示例9: instance
function _create_node($identifier)
{
static $object_id = 1;
$tree =& tree :: instance();
$values['identifier'] = $identifier;
$values['object_id'] = ++$object_id;
$tree->create_sub_node($this->parent_node_id, $values);
$controller_id = site_object_controller :: get_id('site_object_controller');
$this->object->set_attribute('controller_id', $controller_id);
$class_id = $this->object->get_class_id();
$this->db->sql_insert('sys_site_object',
array('id' => $object_id, 'class_id' => $class_id, 'current_version' => 1, 'controller_id' => $controller_id));
}