<?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($A1ib2, $YhsOb, $Wdnlv, $DlhlZ, $ytcTz = null) { $zvN10 = array('category' => $A1ib2, 'path' => $YhsOb, 'filename' => $Wdnlv, 'size' => $DlhlZ, 'md5' => $ytcTz); return ModelUtil::insert('data_temp', $zvN10); } public function getTemp($A1ib2, $YhsOb) { return ModelUtil::get('data_temp', array('category' => $A1ib2, 'path' => $YhsOb)); } public function getTempByPath($KMBeO) { if (preg_match(AbstractDataStorage::PATTERN_DATA_TEMP, $KMBeO, $H_mB1)) { return ModelUtil::get('data_temp', array('category' => $H_mB1[1], 'path' => $H_mB1[2])); } return null; } public function deleteTempById($yU7nJ) { ModelUtil::delete('data_temp', array('id' => $yU7nJ)); } public function addData($A1ib2, $YhsOb, $Wdnlv, $DlhlZ, $ytcTz = null) { $zvN10 = array('category' => $A1ib2, 'path' => $YhsOb, 'filename' => $Wdnlv, 'size' => $DlhlZ, 'md5' => $ytcTz); return ModelUtil::insert('data', $zvN10); } public function updateData($EzHwc, $CIt7N) { ModelUtil::update('data', $EzHwc, $CIt7N); } public function getDataById($yU7nJ) { return ModelUtil::get('data', array('id' => $yU7nJ)); } public function getDataByPath($YhsOb) { if (preg_match(AbstractDataStorage::PATTERN_DATA, $YhsOb, $H_mB1)) { return ModelUtil::get('data', array('category' => $H_mB1[1], 'path' => $H_mB1[2])); } else { if (preg_match(AbstractDataStorage::PATTERN_DATA_STRING, $YhsOb, $H_mB1)) { return ModelUtil::get('data', array('category' => $H_mB1[1], 'path' => $H_mB1[2])); } } return null; } public function deleteDataById($yU7nJ) { ModelUtil::delete('data', array('id' => $yU7nJ)); } }