29 lines
463 B
PHP
Executable File
29 lines
463 B
PHP
Executable File
<?php
|
|
namespace Westdc\Metadata;
|
|
|
|
class Metadata
|
|
{
|
|
private $db; //传入PDO对象.
|
|
|
|
//使用到的公共变量
|
|
public $tbl_metadata = "metadata";
|
|
|
|
function __construct()
|
|
{
|
|
$this->db = \Zend_Registry::get('db');
|
|
}
|
|
|
|
function view($uuid)
|
|
{
|
|
if(\Helpers\Uuid::test($uuid) !== true)
|
|
{
|
|
return "参数错误";
|
|
}
|
|
|
|
$sql = "SELECT * FROM ".$this->tbl_metadata." WHERE uuid='$uuid'";
|
|
$rs = $this->db->query($sql);
|
|
return $rs->fetch();
|
|
}
|
|
|
|
}
|