1 | <?php |
||
9 | class UrlRewrite extends Model |
||
10 | { |
||
11 | /** @var int */ |
||
12 | public const FORWARD = 0; |
||
13 | |||
14 | /** @var int */ |
||
15 | public const PERMANENT = 1; |
||
16 | |||
17 | /** @var int */ |
||
18 | public const TEMPORARY = 2; |
||
19 | |||
20 | /** @var array */ |
||
21 | protected $fillable = [ |
||
22 | 'type', |
||
23 | 'type_attributes', |
||
24 | 'request_path', |
||
25 | 'target_path', |
||
26 | 'redirect_type', |
||
27 | 'description', |
||
28 | ]; |
||
29 | |||
30 | /** @var array */ |
||
31 | protected $casts = [ |
||
32 | 'type_attributes' => 'array', |
||
33 | ]; |
||
34 | |||
35 | public function __construct(?array $attributes = []) |
||
43 | |||
44 | public function isForward(): bool |
||
48 | |||
49 | public function isRedirect(): bool |
||
53 | |||
54 | public function getRedirectType(): int |
||
58 | |||
59 | public function getByTypeAndAttributes(string $type, array $attributes) |
||
69 | |||
70 | public static function getRedirectTypeOptionsArray(): array |
||
78 | |||
79 | public static function getPossibleTypesArray(): array |
||
89 | } |
||
90 |