blob: 424974f16bd130260d0a2ffe17cc127bf1152b7a (
plain)
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
|
<?php
namespace Aws\Arn;
/**
* @internal
*/
trait ResourceTypeAndIdTrait
{
public function getResourceType()
{
return $this->data['resource_type'];
}
public function getResourceId()
{
return $this->data['resource_id'];
}
protected static function parseResourceTypeAndId(array $data)
{
$resourceData = preg_split("/[\/:]/", $data['resource'], 2);
$data['resource_type'] = isset($resourceData[0])
? $resourceData[0]
: null;
$data['resource_id'] = isset($resourceData[1])
? $resourceData[1]
: null;
return $data;
}
}
|