<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Data\Repository; use ModStart\Core\Dao\ModelUtil; use ModStart\Data\AbstractDataRepository; use ModStart\Data\AbstractDataStorage; class DatabaseDataRepository extends AbstractDataRepository { public function maxFilenameByte() { return 200; } public function addTemp($PW0Jg, $QTKvb, $jB_yb, $Klf84, $ntCzO = null) { $dTnlu = array('category' => $PW0Jg, 'path' => $QTKvb, 'filename' => $jB_yb, 'size' => $Klf84, 'md5' => $ntCzO); return ModelUtil::insert('data_temp', $dTnlu); } public function getTemp($PW0Jg, $QTKvb) { return ModelUtil::get('data_temp', array('category' => $PW0Jg, 'path' => $QTKvb)); } public function getTempByPath($kEdn5) { if (preg_match(AbstractDataStorage::PATTERN_DATA_TEMP, $kEdn5, $YANPA)) { return ModelUtil::get('data_temp', array('category' => $YANPA[1], 'path' => $YANPA[2])); } return null; } public function deleteTempById($Zzend) { ModelUtil::delete('data_temp', array('id' => $Zzend)); } public function addData($PW0Jg, $QTKvb, $jB_yb, $Klf84, $ntCzO = null) { $dTnlu = array('category' => $PW0Jg, 'path' => $QTKvb, 'filename' => $jB_yb, 'size' => $Klf84, 'md5' => $ntCzO); return ModelUtil::insert('data', $dTnlu); } public function updateData($DZWCe, $E3ui1) { ModelUtil::update('data', $DZWCe, $E3ui1); } public function getDataById($Zzend) { return ModelUtil::get('data', array('id' => $Zzend)); } public function getDataByPath($QTKvb) { if (preg_match(AbstractDataStorage::PATTERN_DATA, $QTKvb, $YANPA)) { return ModelUtil::get('data', array('category' => $YANPA[1], 'path' => $YANPA[2])); } else { if (preg_match(AbstractDataStorage::PATTERN_DATA_STRING, $QTKvb, $YANPA)) { return ModelUtil::get('data', array('category' => $YANPA[1], 'path' => $YANPA[2])); } } return null; } public function deleteDataById($Zzend) { ModelUtil::delete('data', array('id' => $Zzend)); } }