本文整理汇总了PHP中CLink::load方法的典型用法代码示例。如果您正苦于以下问题:PHP CLink::load方法的具体用法?PHP CLink::load怎么用?PHP CLink::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLink
的用法示例。
在下文中一共展示了CLink::load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeleteLink
/**
* Tests the delete of a link
*/
public function testDeleteLink()
{
global $AppUI;
$this->obj->bind($this->post_data);
$result = $this->obj->store($AppUI);
$this->assertTrue($result);
$original_id = $this->obj->link_id;
$result = $this->obj->delete($AppUI);
$this->assertTrue($result);
$link = new CLink();
$link->load($original_id);
$this->assertEquals('', $link->link_name);
$this->assertEquals('', $link->link_url);
}
示例2: testDelete
/**
* Tests the delete of a link
*/
public function testDelete()
{
$this->obj->bind($this->post_data);
$result = $this->obj->store();
$this->assertTrue($result);
$original_id = $this->obj->link_id;
$result = $this->obj->delete();
$item = new CLink();
$item->overrideDatabase($this->mockDB);
$this->mockDB->stageHash(array('link_name' => '', 'link_url' => ''));
$item->load($original_id);
$this->assertTrue(is_a($item, 'CLink'));
$this->assertEquals('', $item->link_name);
$this->assertEquals('', $item->link_url);
}
示例3: date
if ($link_id) {
$obj->_message = 'updated';
} else {
$obj->_message = 'added';
}
$obj->link_date = date('Y-m-d H:i:s');
$obj->link_category = intval(dPgetParam($_POST, 'link_category', 0));
if (!$obj->bind($_POST)) {
$AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
$AppUI->redirect();
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Link');
// delete the link
if ($del) {
$obj->load($link_id);
if ($msg = $obj->delete()) {
$AppUI->setMsg($msg, UI_MSG_ERROR);
$AppUI->redirect();
} else {
if ($not == '1') {
$obj->notify();
}
$AppUI->setMsg("deleted", UI_MSG_ALERT, true);
$AppUI->redirect("m=links");
}
}
if (!$link_id) {
$obj->link_owner = $AppUI->user_id;
}
if ($msg = $obj->store()) {
示例4: die
<?php
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$link_id = (int) w2PgetParam($_GET, 'link_id', 0);
$link = new CLink();
if (!$link->load($link_id)) {
$AppUI->redirect(ACCESS_DENIED);
}
header("Location: " . $link->link_url);