CIParamTransformation.php
918 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace Qcloud\Cos\ImageParamTemplate;
class CIParamTransformation extends ImageTemplate{
private $tranParams;
private $tranString;
private $spilt;
public function __construct($spilt = "|") {
parent::__construct();
$this->spilt = $spilt;
$this->tranParams = array();
$this->tranString = "";
}
public function addRule(ImageTemplate $template) {
if($template->queryString()){
$this->tranParams[] = $template->queryString();
}
}
public function queryString() {
if($this->tranParams) {
$this->tranString = implode($this->spilt, $this->tranParams);
}
return $this->tranString;
}
public function resetRule() {
$this->tranParams = array();
$this->tranString = "";
}
public function defineRule($value) {
$this->tranParams[] = $value;
}
}