本文整理汇总了PHP中Assets::getAsset方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::getAsset方法的具体用法?PHP Assets::getAsset怎么用?PHP Assets::getAsset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets
的用法示例。
在下文中一共展示了Assets::getAsset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRentDemandProcesses
public static function getRentDemandProcesses($rentDemandID)
{
global $db;
$processes = $db->select('rentProcesses', '*', ['rentDemand' => $rentDemandID]);
$ans = [];
foreach ($processes as $process) {
$process['assetName'] = Assets::getAsset($process['asset'])['name'];
$assetContacts = Contacts::getAssetContacts($process['asset']);
if (!empty($assetContacts)) {
$process['assetContact'] = $assetContacts[0]['fullName'];
$process['assetPhone'] = $assetContacts[0]['mobilePhone'];
}
array_push($ans, $process);
}
return $ans;
}
示例2: header
header("Access-Control-Allow-Origin: *");
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
}
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=building.doc");
// Load system.
require_once __DIR__ . '/../libs/medoo-db/medoo.min.php';
require_once __DIR__ . '/../libs/medoo-db/db.php';
require_once __DIR__ . '/../loader/load-user-system.php';
require_once __DIR__ . '/../loader/load-models.php';
if (!User::isLoggedIn()) {
die;
}
if (isset($_GET['id'])) {
$asset = Assets::getAsset($_GET['id']);
$investors = Investors::getAssetInvestors($_GET['id']);
} else {
die;
}
?>
<html dir="rtl" lang="he">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<style>
<!--
/* Font Definitions */
@font-face {
font-family: "Cambria Math";
panose-1: 2 4 5 3 5 4 6 3 2 4;
示例3: function
}
});
$this->respond(['GET', 'POST'], '/get/[i:id]', function ($request, $response, $service, $app) {
$id = $request->param('id');
$assetData = Assets::getAsset($id);
$assetInvestors = Investors::getAssetInvestors($id);
$result = array("assetData" => $assetData, "assetInvestors" => $assetInvestors);
if ($assetData) {
$response->json(Result::success('', $result));
} else {
$response->json(Result::error('Asset not found'));
}
});
$this->respond(['GET', 'POST'], '/get-for-edit/[i:id]', function ($request, $response, $service, $app) {
$id = $request->param('id');
$assetData = Assets::getAsset($id);
$assetContacts = Contacts::getAssetContacts($id);
$assetInvestors = Investors::getAssetInvestors($id);
$assetAreas = RentAreas::getAssetRentAreas($id);
$assetProcesses = RentProcesses::getAssetRentProcesses($id);
$result = array("assetData" => $assetData, "assetContacts" => $assetContacts, "assetInvestors" => $assetInvestors, "assetAreas" => $assetAreas, "assetProcesses" => $assetProcesses);
if ($assetData) {
$response->json(Result::success('', $result));
} else {
$response->json(Result::error('Asset not found'));
}
});
$this->respond(['GET', 'POST'], '/get/all', function ($request, $response, $service, $app) {
$result = Assets::getAllAssets();
$response->json(Result::success('', $result));
});
示例4: updateAssetRent
public static function updateAssetRent($assetID, $assetData, $contactsData, $investorsData)
{
global $db;
// check if asset exists
if (Assets::getAsset($assetID)) {
// update asset contacts
$db->delete('assetContacts', ['asset' => $assetID]);
foreach ($contactsData as $contact) {
$db->insert('assetContacts', ['asset' => $assetID, 'contact' => $contact['id']]);
}
// update asset investors
$db->delete('owners', ['asset' => $assetID]);
foreach ($investorsData as $investor) {
$db->insert('owners', ['asset' => $assetID, 'investor' => $investor['id'], 'percentage' => $investor['percentage']]);
}
// update asset
$assetData['lastUpdate'] = date('Y-m-d');
if (isset($assetData['sellingProfile'])) {
$assetData['sellingProfile'] = json_encode($assetData['sellingProfile']);
}
return $db->update('assets', $assetData, ['id' => $assetID]);
}
return -1;
}