<?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($KD2ht, $ceAjB, $fHqPM, $DJshY) { return ModelUtil::insert('data_temp', array('category' => $KD2ht, 'path' => $ceAjB, 'filename' => $fHqPM, 'size' => $DJshY)); } public function getTemp($KD2ht, $ceAjB) { return ModelUtil::get('data_temp', array('category' => $KD2ht, 'path' => $ceAjB)); } public function getTempByPath($ctWhU) { if (preg_match(AbstractDataStorage::PATTERN_DATA_TEMP, $ctWhU, $zhVL6)) { return ModelUtil::get('data_temp', array('category' => $zhVL6[1], 'path' => $zhVL6[2])); } return null; } public function deleteTempById($UFOLC) { ModelUtil::delete('data_temp', array('id' => $UFOLC)); } public function addData($KD2ht, $ceAjB, $fHqPM, $DJshY) { return ModelUtil::insert('data', array('category' => $KD2ht, 'path' => $ceAjB, 'filename' => $fHqPM, 'size' => $DJshY)); } public function updateData($Mha5D, $DGU8T) { ModelUtil::update('data', $Mha5D, $DGU8T); } public function getDataById($UFOLC) { return ModelUtil::get('data', array('id' => $UFOLC)); } public function getDataByPath($ceAjB) { if (preg_match(AbstractDataStorage::PATTERN_DATA, $ceAjB, $zhVL6)) { return ModelUtil::get('data', array('category' => $zhVL6[1], 'path' => $zhVL6[2])); } else { if (preg_match(AbstractDataStorage::PATTERN_DATA_STRING, $ceAjB, $zhVL6)) { return ModelUtil::get('data', array('category' => $zhVL6[1], 'path' => $zhVL6[2])); } } return null; } public function deleteDataById($UFOLC) { ModelUtil::delete('data', array('id' => $UFOLC)); } }