westdc-zf1/application/module/Westdc/Metadata/Metadata.php

36 lines
661 B
PHP
Executable File

<?php
namespace Westdc\Metadata;
class Metadata
{
public $db;
public $config;
//使用到的公共变量
public $tbl_metadata = "metadata";
function __construct()
{
$this->db = \Zend_Registry::get('db');
$this->config = \Zend_Registry::get('config');
if(isset($this->config->sub->metadata) && !empty($this->config->sub->metadata))
{
$this->tbl_metadata = $this->config->sub->metadata;
}
}
public 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();
}
}