本文整理匯總了PHP中DatabaseConnection::isChildAvailable方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseConnection::isChildAvailable方法的具體用法?PHP DatabaseConnection::isChildAvailable怎麽用?PHP DatabaseConnection::isChildAvailable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DatabaseConnection
的用法示例。
在下文中一共展示了DatabaseConnection::isChildAvailable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DatabaseConnection
<?php
/**
* Created by PhpStorm.
* User: poovarasanv
* Date: 02-11-2015
* Time: 09:47
*/
require "DatabaseConnection.php";
$db = new DatabaseConnection();
$db->createConnection();
$parent = $_GET['parent'];
$type = $_GET['type'];
$sql = "SELECT *\n FROM artefact\n WHERE ArtefactPID = '{$parent}' AND VisibleStatus='on' ORDER BY CreatedDate DESC";
//echo $sql;
$result = $db->setQuery($sql);
$resultArray = array();
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$temp["title"] = $row['ArtefactName'];
$temp["key"] = $row['ArtefactCode'];
if ($db->isChildAvailable($row['ArtefactName'])) {
$temp['lazy'] = true;
$temp['folder'] = true;
}
array_push($resultArray, $temp);
}
echo json_encode($resultArray);
} else {
return null;
}
示例2: DatabaseConnection
* Time: 10:05
*/
ini_set('max_execution_time', 30000);
include_once 'DatabaseConnection.php';
$type = $_GET['type'];
session_start();
$_SESSION['type'] = $type;
$db = new DatabaseConnection();
$conn = $db->createConnection();
$parentArray = array();
//Associate Array with ArtefactCode and ArtefactPID
$sql = "SELECT\n artefactname,\n artefactcode\n FROM artefact\n WHERE artefactPID IS NULL AND artefactTypeCode = '{$type}' AND visiblestatus = 'on'\n ORDER BY CreatedDate DESC";
//echo $sql;
$result = $db->setQuery($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$temp['title'] = $row['artefactname'];
$temp['key'] = $row['artefactcode'];
if ($db->isChildAvailable($row['artefactname']) > 0) {
$temp['lazy'] = true;
$temp['folder'] = true;
// $temp['cc'] = $db->isChildAvailable($row['artefactname']);
}
array_push($parentArray, $temp);
}
//echo "<pre>";
//print_r($parentArray);
echo json_encode($parentArray);
} else {
return null;
}