<?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($IaATa, $aurrr, $CoAhX, $TUjAS, $JsbGs = null) { $IaeCl = array('category' => $IaATa, 'path' => $aurrr, 'filename' => $CoAhX, 'size' => $TUjAS, 'md5' => $JsbGs); return ModelUtil::insert('data_temp', $IaeCl); } public function getTemp($IaATa, $aurrr) { return ModelUtil::get('data_temp', array('category' => $IaATa, 'path' => $aurrr)); } public function getTempByPath($cZSgT) { if (preg_match(AbstractDataStorage::PATTERN_DATA_TEMP, $cZSgT, $wsKBJ)) { return ModelUtil::get('data_temp', array('category' => $wsKBJ[1], 'path' => $wsKBJ[2])); } return null; } public function deleteTempById($jkTHm) { ModelUtil::delete('data_temp', array('id' => $jkTHm)); } public function addData($IaATa, $aurrr, $CoAhX, $TUjAS, $JsbGs = null) { $IaeCl = array('category' => $IaATa, 'path' => $aurrr, 'filename' => $CoAhX, 'size' => $TUjAS, 'md5' => $JsbGs); return ModelUtil::insert('data', $IaeCl); } public function updateData($S0eG7, $bxz93) { ModelUtil::update('data', $S0eG7, $bxz93); } public function getDataById($jkTHm) { return ModelUtil::get('data', array('id' => $jkTHm)); } public function getDataByPath($aurrr) { if (preg_match(AbstractDataStorage::PATTERN_DATA, $aurrr, $wsKBJ)) { return ModelUtil::get('data', array('category' => $wsKBJ[1], 'path' => $wsKBJ[2])); } else { if (preg_match(AbstractDataStorage::PATTERN_DATA_STRING, $aurrr, $wsKBJ)) { return ModelUtil::get('data', array('category' => $wsKBJ[1], 'path' => $wsKBJ[2])); } } return null; } public function deleteDataById($jkTHm) { ModelUtil::delete('data', array('id' => $jkTHm)); } }