本文整理汇总了PHP中getObject函数的典型用法代码示例。如果您正苦于以下问题:PHP getObject函数的具体用法?PHP getObject怎么用?PHP getObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSomething
function doSomething()
{
if (($object = getObject()) < 0) {
return $object;
}
return $object;
}
示例2: getStreamByObject
function getStreamByObject($object)
{
$query = "SELECT * FROM MSTREAMT WHERE oid={$object} ORDER BY(sid) DESC";
$result = mysql_query($query);
$ret = "<table class='table' style='width:300px;'>";
while ($row = mysql_fetch_array($result)) {
$o = getObject($row["oid"]);
$id = $row["oid"];
$im = getImgUri($o["oimgid"]);
$ret .= "<tr><td>" . $row["message"] . "</td><td>" . dateify($row["postedon"]) . "</td></tr>";
}
$ret .= "</table>";
return $ret;
}
示例3: listMessages
public function listMessages()
{
$user = $this->registry > getObject('authenticate')->getUser()->getUserID();
$data = array();
$sql = "SELECT * FROM `messages` WHERE `sender`=" . $user . " OR `recipient`=" . $user;
$this->registry->getObject('db')->executeQuery($sql);
if ($this->registry->getObject('db')->numRows() > 0) {
$this->empty = false;
while ($fields = $this->registry->getObject('db')->getRows) {
$this->IDs = $fields['ID'];
$data[] = $fields;
}
$this->registry->getObject('template')->buildFromTemplate('header.php', 'messages_main.php', 'footer.php');
$cacheableIDs = array();
foreach ($this->IDs as $id) {
$i = array();
$i['message_id'] = $id;
$cacheableIDs[] = $i;
}
$cache = $this->registry->getObject('db')->cacheData($cacheableIDs);
$this->registry->getObject('template')->getPage()->addTag('message', array('DATA', $cache));
$daTags = array();
$type = $this->getType($d['type']);
foreach ($data as $d) {
foreach ($d as $f => $v) {
$daTags['message_' . $f] = $v;
}
if ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 0 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-replySelf-unread.php', $daTags);
} elseif ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 1 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-replySelf-read.php', $daTags);
} elseif ($d['read'] == 0 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-reply-unread.php', $daTags);
} elseif ($d['read'] == 1 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-reply-read.php', $daTags);
} elseif ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 0) {
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-fromSelf-unread.php', $daTags);
} elseif ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 1) {
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-fromSelf-read.php', $daTags);
} elseif ($d['read'] == 0) {
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-unread.php', $daTags);
} else {
$daTags['message_replyFrom'] = '';
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-read.php', $daTags);
}
}
}
}
示例4: define
define(ROOT, $_SERVER['DOCUMENT_ROOT']);
include_once ROOT . "/functions/database_management.php";
//TODO: Reemplazar por $_SESSION['username']
switch ($_POST["functionCalled"]) {
case "hasCompleted":
echo 'ret=' . var_export(hasCompleted($_POST["eventName"], $_POST["username"], $_POST["puzzle"]), true);
break;
case "complete":
echo complete($_POST["eventName"], $_POST["username"], $_POST["puzzle"]);
break;
case "isAvailable":
echo 'ret=' . var_export(isAvailable($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
break;
case "hasObject":
echo 'ret=' . var_export(hasObject($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
break;
case "usedObject":
echo 'ret=' . var_export(usedObject($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
break;
case "releaseObject":
releaseObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
break;
case "getObject":
getObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
break;
case "useObject":
useObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
break;
}
?>
示例5: callMethod
/**
* Title
*
* Description
*
* @access public
*/
function callMethod($method_name, $params = 0)
{
$tmp = explode('.', $method_name);
if ($tmp[2]) {
$object_name = $tmp[0] . '.' . $tmp[1];
$varname = $tmp[2];
} elseif ($tmp[1]) {
$object_name = $tmp[0];
$method_name = $tmp[1];
} else {
$object_name = 'ThisComputer';
}
$obj = getObject($object_name);
if ($obj) {
return $obj->callMethod($method_name, $params);
} else {
return 0;
}
}
示例6: header
<?php
header('Content-Type: text/html; charset=utf-8');
include '../../includes/classes/core.php';
include '../../includes/classes/barcode/tfpdf.php';
include '../../includes/classes/logger.class.php';
$object_id = $_REQUEST['id'];
$status = $_REQUEST['status'];
$res = mysql_query("SELECT \t\tproduction.`name` AS `name`,\n\t\t\t\t\t\t\t\tCONCAT(sale_transaction_detail.product_quantity, ' ', production_unit.`name`) AS `quantity`\n\t\t\t\t\tFROM \t\tsale_transaction\n\t\t\t\t\tLEFT JOIN \tsale_transaction_detail ON sale_transaction.id = sale_transaction_detail.transaction_id\n\t\t\t\t\tRIGHT JOIN \tproduction ON production.id = sale_transaction_detail.production_id\n\t\t\t\t\tLEFT JOIN production_unit ON production.unit = production_unit.id\n\t\t\t\t\tWHERE \t\tsale_transaction.object_id = {$object_id} AND sale_transaction.`status` = {$status} AND sale_transaction_detail.production_id NOT IN (SELECT recipie.recipie_id FROM recipie)");
$res1 = mysql_query("SELECT \t\t\tsale_transaction_detail.id,\n\t\t\t\t\t\t\t\t\t\tpr1.`name` AS `name`,\n\t\t\t\t\t\t\t\t\t\tCONCAT(sale_transaction_detail.product_quantity, ' ', pu1.`name`) AS `quantity`,\n\t\t\t\t\t\t\t\t\t\tpr2.`name`AS `ingredient`,\n\t\t\t\t\t\t\t\t\t\trecipie_producing.quantity / recipie.quantity AS `ing_quantity`\n\t\t\t\t\t\tFROM \t\t\tsale_transaction\n\t\t\t\t\t\tLEFT JOIN \t\tsale_transaction_detail ON sale_transaction.id = sale_transaction_detail.transaction_id\n\t\t\t\t\t\tLEFT JOIN \trecipie_producing ON recipie_producing.recipie_id = sale_transaction_detail.production_id AND recipie_producing.transaction_detail_id = sale_transaction_detail.id\n\t\t\t\t\t\tLEFT JOIN \trecipie ON recipie_producing.recipie_id = recipie.recipie_id AND recipie_producing.production_id = recipie.ingredient_id\n\t\t\t\t\t\tLEFT JOIN\t\tproduction AS pr2 ON recipie_producing.production_id = pr2.id\n\t\t\t\t\t\tLEFT JOIN \t\tproduction AS pr1 ON pr1.id = sale_transaction_detail.production_id\n\t\t\t\t\t\tLEFT JOIN \tproduction_unit AS pu1 ON pr1.unit = pu1.id\n\t\t\t\t\t\tLEFT JOIN \tproduction_unit AS pu2 ON pr2.unit = pu2.id\n\t\t\t\t\t\tWHERE \t\t\tsale_transaction.object_id = {$object_id} AND sale_transaction.`status` = {$status} AND recipie_producing.quantity > 0 AND `recipie`.`visible` = 1 ");
$res3 = mysql_query("SELECT \t\tproduction.`name`,\n\t\t\t\t\t\t\t\t\tCONCAT(sale_transaction_detail.product_quantity, ' ', production_unit.`name`) AS `quantity` \n\t\t\t\t\tFROM \t\t\tsale_transaction\n\t\t\t\t\tLEFT JOIN\t \tsale_transaction_detail ON sale_transaction.id = sale_transaction_detail.transaction_id\n\t\t\t\t\tRIGHT JOIN\t \tproduction ON production.id = sale_transaction_detail.production_id\n\t\t\t\t\tLEFT JOIN \t\tproduction_unit ON production.unit = production_unit.id\n\t\t\t\t\tLEFT JOIN \trecipie ON recipie.recipie_id = production.id\n\t\t\t\t\tWHERE \t\t\tsale_transaction.object_id = 136 AND sale_transaction.`status` = 4 AND sale_transaction_detail.production_id \n\t\t\t\t\tGROUP BY recipie.recipie_id\n\t\t\t\t\tHAVING sum(recipie.visible)=0\n\t\t\t\t\t\t");
echo '<p align=center style=" font-size: 15px;"><u>' . date('Y-m-d H:i') . '</u></p>';
echo '<p align=center style=" font-size: 15px;">ობიექტი: <u>' . getObject($object_id) . '</u></p></br>';
echo '<table style="width: 100%; " cellspacing="0" cellpadding="6">';
while ($row = mysql_fetch_assoc($res)) {
echo '<tr>';
echo '<td style=" font-size: 14px; width: 35%; border-bottom:1px solid black;"><p>   ' . $row['name'] . '</p></td>';
echo '<td style=" font-size: 14px; width: 15%; border-bottom:1px solid black;"><p>' . $row['quantity'] . '</p></td>';
}
$array = array();
while ($row1 = mysql_fetch_assoc($res1)) {
echo '<tr>';
if (in_array($row1[id], $array)) {
echo '<td style=" font-size: 12px; width: 80%; border-bottom:1px solid black;"><p>      ' . $row1['ingredient'] . '</p></td>';
echo '<td style=" font-size: 12px; width: 15%; border-bottom:1px solid black;"><p>      ' . round($row1['ing_quantity'] / $row1['quantity'], 0) . '</p></td>';
} else {
echo '</tr>';
echo '<tr>';
echo '<td style=" font-size: 14px; width: 80%; border-bottom:1px solid black;"><b>   ' . $row1['name'] . '</b></td>';
echo '<td style=" font-size: 14px; width: 15%; border-bottom:1px solid black;"><p> ' . $row1['quantity'] . '</p></td>';
echo '</tr>';
示例7: SQLSelect
$sortby = $sortby . " DESC";
}
}
$session->data['commands_sort'] = $sortby;
}
$sortby = "PRIORITY DESC, TITLE";
$out['SORTBY'] = $sortby;
// SEARCH RESULTS
$res = SQLSelect("SELECT * FROM commands WHERE {$qry} ORDER BY {$sortby}");
if ($res[0]['ID']) {
if ($this->action != 'admin') {
$dynamic_res = array();
$total = count($res);
for ($i = 0; $i < $total; $i++) {
if ($res[$i]['SMART_REPEAT'] && $res[$i]['LINKED_OBJECT']) {
$obj = getObject($res[$i]['LINKED_OBJECT']);
$objects = getObjectsByClass($obj->class_id);
$total_o = count($objects);
for ($io = 0; $io < $total_o; $io++) {
$rec = $res[$i];
$rec['ID'] = $res[$i]['ID'] . '_' . $objects[$io]['ID'];
$rec['LINKED_OBJECT'] = $objects[$io]['TITLE'];
$rec['DATA'] = str_replace('%' . $res[$i]['LINKED_OBJECT'] . '.', '%' . $rec['LINKED_OBJECT'] . '.', $rec['DATA']);
$rec['CUR_VALUE'] = getGlobal($rec['LINKED_OBJECT'] . '.' . $rec['LINKED_PROPERTY']);
$rec['TITLE'] = $objects[$io]['TITLE'];
$dynamic_res[] = $rec;
}
} else {
$dynamic_res[] = $res[$i];
}
}
示例8: foreach
}
}
foreach ($bt_devices as $k => $v) {
if ($v != $last_scan) {
//device removed
echo date('Y/m/d H:i:s') . " Device gone: {$k}\n";
$user = array();
$rec = SQLSelectOne("SELECT * FROM btdevices WHERE MAC LIKE '" . $k . "'");
if ($rec['ID']) {
$rec['LOG'] = 'Device lost ' . date('Y/m/d H:i:s') . "\n" . $rec['LOG'];
SQLUpdate('btdevices', $rec);
if ($rec['USER_ID']) {
$user = SQLSelectOne("SELECT * FROM users WHERE ID='" . $rec['USER_ID'] . "'");
}
}
getObject('BlueDev')->raiseEvent("Lost", array('mac' => $k, 'user' => $user['NAME']));
unset($bt_devices[$k]);
}
}
}
} else {
echo "Running Bluetooth monitor.";
}
$first_run = 0;
if (file_exists('./reboot') || $_GET['onetime']) {
$db->Disconnect();
exit;
}
sleep(1);
}
// closing database connection
示例9: getRenditions
function getRenditions($objectId, $options = array(OPT_RENDITION_FILTER => "*"))
{
return getObject($objectId, $options);
}
示例10: getDynamicElements
/**
* Title
*
* Description
*
* @access public
*/
function getDynamicElements($qry = '1')
{
$elements = SQLSelect("SELECT elements.* FROM elements, scenes WHERE elements.SCENE_ID=scenes.ID AND {$qry} ORDER BY PRIORITY DESC, TITLE");
$totale = count($elements);
$res2 = array();
for ($ie = 0; $ie < $totale; $ie++) {
$states = SQLSelect("SELECT elm_states.*,elements.TYPE FROM elm_states, elements WHERE elm_states.ELEMENT_ID=elements.ID AND ELEMENT_ID='" . $elements[$ie]['ID'] . "' ORDER BY elm_states.PRIORITY DESC, elm_states.TITLE");
if ($elements[$ie]['SMART_REPEAT'] && !$this->action == 'admin') {
$linked_object = '';
if ($states[0]['LINKED_OBJECT']) {
$linked_object = $states[0]['LINKED_OBJECT'];
} elseif ($states[0]['ACTION_OBJECT']) {
$linked_object = $states[0]['ACTION_OBJECT'];
}
if ($linked_object) {
$obj = getObject($linked_object);
$objects = getObjectsByClass($obj->class_id);
$total_o = count($objects);
for ($io = 0; $io < $total_o; $io++) {
$rec = $elements[$ie];
$rec['ID'] = $elements[$ie] . '_' . $objects[$io]['ID'];
$new_states = array();
$total_s = count($states);
for ($is = 0; $is < $total_s; $is++) {
$state_rec = $states[$is];
if ($state_rec['LINKED_OBJECT']) {
$state_rec['LINKED_OBJECT'] = $objects[$io]['TITLE'];
}
if ($state_rec['ACTION_OBJECT']) {
$state_rec['ACTION_OBJECT'] = $objects[$io]['TITLE'];
}
if ($state_rec['HTML']) {
$state_rec['HTML'] = str_replace('%' . $linked_object . '.', '%' . $objects[$io]['TITLE'] . '.', $state_rec['HTML']);
}
$state_rec['ID'] = $state_rec['ID'] . '_' . $objects[$io]['ID'];
$new_states[] = $state_rec;
}
$rec['STATES'] = $new_states;
$res2[] = $rec;
}
} else {
$elements[$ie]['STATES'] = $states;
$elements[$ie]['SMART_REPEAT'] = 0;
$res2[] = $elements[$ie];
}
} else {
$elements[$ie]['STATES'] = $states;
$res2[] = $elements[$ie];
}
}
return $res2;
}
示例11: mysql
include_once "./lib/loader.php";
include_once DIR_MODULES . "application.class.php";
$db = new mysql(DB_HOST, '', DB_USER, DB_PASSWORD, DB_NAME);
// connecting to database
include_once "./load_settings.php";
set_time_limit(30);
if (!$width) {
$w = 610;
} else {
$w = (int) $width;
}
// Dataset definition
//$DataSet = new pData;
if ($p != '') {
if (preg_match('/(.+)\\.(.+)/is', $p, $m)) {
$obj = getObject($m[1]);
$prop_id = $obj->getPropertyByName($m[2], $obj->class_id, $obj->id);
}
}
//$type='';
$pvalue = SQLSelectOne("SELECT * FROM pvalues WHERE PROPERTY_ID='" . $prop_id . "' AND OBJECT_ID='" . $obj->id . "'");
if (!$pvalue['ID']) {
echo "Incorrect property name";
exit;
}
if ($_GET['op'] == 'value') {
echo $pvalue['VALUE'];
exit;
}
$end_time = time();
if ($_GET['px']) {
示例12: processCommand
/**
* Title
*
* Description
*
* @access public
*/
function processCommand($command) {
getObject("ThisComputer")->callMethod("commandReceived", array("command"=>$command));
}
示例13: foreach
foreach ($bt_devices as $k => $v) {
if ($v != $last_scan) {
//device removed
echo date('Y/m/d H:i:s') . ' Device gone: ' . $k . '\\n';
$user = array();
$sqlQuery = "SELECT * \n FROM btdevices \n WHERE MAC LIKE '" . $k . "'";
$rec = SQLSelectOne($sqlQuery);
if ($rec['ID']) {
$rec['LOG'] = 'Device lost ' . date('Y/m/d H:i:s') . '\\n' . $rec['LOG'];
SQLUpdate('btdevices', $rec);
if ($rec['USER_ID']) {
$sqlQuery = "SELECT * \n FROM users \n WHERE ID = '" . $rec['USER_ID'] . "'";
$user = SQLSelectOne($sqlQuery);
}
}
$objectArray = array('mac' => $k, 'user' => $user['NAME']);
getObject('BlueDev')->raiseEvent("Lost", $objectArray);
unset($bt_devices[$k]);
}
}
}
}
$first_run = 0;
if (file_exists('./reboot') || $_GET['onetime']) {
$db->Disconnect();
exit;
}
sleep(1);
}
// closing database connection
$db->Disconnect();
示例14: getEobject
final function getEobject()
{
$class = "exx{$this->getClass()}";
return getObject($class);
}
示例15: checkAllVars
/**
* Title
*
* Description
*
* @access public
*/
function checkAllVars($force=0) {
// ping hosts
if ($force) {
$pings=SQLSelect("SELECT * FROM webvars WHERE 1");
} else {
$pings=SQLSelect("SELECT * FROM webvars WHERE CHECK_NEXT<=NOW()");
}
$total=count($pings);
for($i=0;$i<$total;$i++) {
$host=$pings[$i];
if (!$force) {
echo "Checking webvar: ".$host['HOSTNAME']."\n";
}
$online_interval=$host['ONLINE_INTERVAL'];
if (!$online_interval) {
$online_interval=60;
}
$host['CHECK_NEXT']=date('Y-m-d H:i:s', time()+$online_interval);
SQLUpdate('webvars', $host);
// checking
//web host
$old_status=$host['LATEST_VALUE'];
if ($host['AUTH'] && $host['USERNAME']) {
$content=getURL($host['HOSTNAME'], $host['ONLINE_INTERVAL'], $host['USERNAME'], $host['PASSWORD']);
} else {
$content=getURL($host['HOSTNAME'], $host['ONLINE_INTERVAL']);
}
if ($host['ENCODING']!='') {
$content=iconv($host['ENCODING'], "UTF-8", $content);
}
$ok=1;
$new_status='';
if ($host['SEARCH_PATTERN']) {
if (preg_match('/'.$host['SEARCH_PATTERN'].'/is', $content, $m)) {
$new_status=$m[1];
} else {
$ok=0; // result did not matched
}
} else {
$new_status=$content;
}
if ($host['CHECK_PATTERN'] && !preg_match('/'.$host['CHECK_PATTERN'].'/is', $new_status)) {
$ok=0; // result did not pass the check
}
if (!$ok) {
$host['LOG']=date('Y-m-d H:i:s').' incorrect value:'.$new_status."\n".$host['LOG'];
SQLUpdate('webvars', $host);
continue;
}
$host['CHECK_LATEST']=date('Y-m-d H:i:s');
$host['CHECK_NEXT']=date('Y-m-d H:i:s', time()+$online_interval);
if ($old_status!=$new_status) {
$host['LOG']=date('Y-m-d H:i:s').' new value:'.$new_status."\n".$host['LOG'];
}
$host['LATEST_VALUE']=$new_status;
SQLUpdate('webvars', $host);
if ($host['LINKED_OBJECT']!='' && $host['LINKED_PROPERTY']!='') {
getObject($host['LINKED_OBJECT'])->setProperty($host['LINKED_PROPERTY'], $new_status);
}
if ($old_status!=$new_status && $old_status!='') {
// do some status change actions
$run_script_id=0;
$run_code='';
// got online
if ($host['SCRIPT_ID']) {
$run_script_id=$host['SCRIPT_ID'];
} elseif ($host['CODE']) {
$run_code=$host['CODE'];
}
if ($run_script_id) {
//run script
runScript($run_script_id);
} elseif ($run_code) {
//run code
eval($run_code);
}
}
//.........这里部分代码省略.........