<?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($FVUIh, $adFNb, $JWce1, $xR91w, $uC3vd = null) { $Sj05q = array('category' => $FVUIh, 'path' => $adFNb, 'filename' => $JWce1, 'size' => $xR91w, 'md5' => $uC3vd); return ModelUtil::insert('data_temp', $Sj05q); } public function getTemp($FVUIh, $adFNb) { return ModelUtil::get('data_temp', array('category' => $FVUIh, 'path' => $adFNb)); } public function getTempByPath($rzE6R) { if (preg_match(AbstractDataStorage::PATTERN_DATA_TEMP, $rzE6R, $EbeBB)) { return ModelUtil::get('data_temp', array('category' => $EbeBB[1], 'path' => $EbeBB[2])); } return null; } public function deleteTempById($PMDE9) { ModelUtil::delete('data_temp', array('id' => $PMDE9)); } public function addData($FVUIh, $adFNb, $JWce1, $xR91w, $uC3vd = null) { $Sj05q = array('category' => $FVUIh, 'path' => $adFNb, 'filename' => $JWce1, 'size' => $xR91w, 'md5' => $uC3vd); return ModelUtil::insert('data', $Sj05q); } public function updateData($qvobN, $zWmx6) { ModelUtil::update('data', $qvobN, $zWmx6); } public function getDataById($PMDE9) { return ModelUtil::get('data', array('id' => $PMDE9)); } public function getDataByPath($adFNb) { if (preg_match(AbstractDataStorage::PATTERN_DATA, $adFNb, $EbeBB)) { return ModelUtil::get('data', array('category' => $EbeBB[1], 'path' => $EbeBB[2])); } else { if (preg_match(AbstractDataStorage::PATTERN_DATA_STRING, $adFNb, $EbeBB)) { return ModelUtil::get('data', array('category' => $EbeBB[1], 'path' => $EbeBB[2])); } } return null; } public function deleteDataById($PMDE9) { ModelUtil::delete('data', array('id' => $PMDE9)); } }